Changeset 35416 for trunk/Ohana/src/opihi
- Timestamp:
- Apr 19, 2013, 4:31:05 PM (13 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 17 edited
- 2 copied
-
. (modified) (1 prop)
-
src/opihi (modified) (1 prop)
-
src/opihi/cmd.astro (modified) (1 prop)
-
src/opihi/cmd.astro/Makefile (modified) (1 diff)
-
src/opihi/cmd.astro/fitplx.c (copied) (copied from branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.astro/fitplx.c )
-
src/opihi/cmd.astro/init.c (modified) (2 diffs)
-
src/opihi/cmd.data (modified) (1 prop)
-
src/opihi/cmd.data/Makefile (modified) (1 diff)
-
src/opihi/cmd.data/init.c (modified) (2 diffs)
-
src/opihi/cmd.data/xsection.c (copied) (copied from branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.data/xsection.c )
-
src/opihi/dvo/avextract.c (modified) (1 diff)
-
src/opihi/dvo/avmatch.c (modified) (1 diff)
-
src/opihi/dvo/dvo_host_utils.c (modified) (5 diffs)
-
src/opihi/dvo/mextract.c (modified) (2 diffs)
-
src/opihi/dvo/mmatch.c (modified) (3 diffs)
-
src/opihi/dvo/photometry.c (modified) (3 diffs)
-
src/opihi/dvo/remote.c (modified) (1 diff)
-
src/opihi/dvo/skyregion.c (modified) (2 diffs)
-
src/opihi/include/dvoshell.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/opihi
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/Ohana/src/opihi (added) merged: 35316,35327,35339-35340,35342,35347,35350,35355,35401,35412
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.astro (added) merged: 35339-35340,35347,35350,35355,35412
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r34342 r35416 30 30 $(SRC)/drizzle.$(ARCH).o \ 31 31 $(SRC)/flux.$(ARCH).o \ 32 $(SRC)/fitplx.$(ARCH).o \ 32 33 $(SRC)/fixwrap.$(ARCH).o \ 33 34 $(SRC)/fixcols.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/init.c
r34342 r35416 14 14 int drizzle PROTO((int, char **)); 15 15 int flux PROTO((int, char **)); 16 int fitplx PROTO((int, char **)); 16 17 int fixwrap PROTO((int, char **)); 17 18 int fiximage PROTO((int, char **)); … … 71 72 {1, "drizzle", drizzle, "transform image to image"}, 72 73 {1, "flux", flux, "flux in a convex contour"}, 74 {1, "fitplx", fitplx, "fit proper motion and parallax"}, 73 75 {1, "fixwrap", fixwrap, "fix megacam over-wrapped pixels"}, 74 76 {1, "fiximage", fiximage, "fix pixels in an image by interpolation"}, -
trunk/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/Ohana/src/opihi/cmd.data (added) merged: 35316,35350,35412
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.data/Makefile
r35237 r35416 150 150 $(SRC)/vsmooth.$(ARCH).o \ 151 151 $(SRC)/vstats.$(ARCH).o \ 152 $(SRC)/xsection.$(ARCH).o \ 152 153 $(SRC)/wd.$(ARCH).o \ 153 154 $(SRC)/write_vectors.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.data/init.c
r35237 r35416 141 141 int wd PROTO((int, char **)); 142 142 int write_vectors PROTO((int, char **)); 143 int xsection PROTO((int, char **)); 143 144 int zap PROTO((int, char **)); 144 145 int zplot PROTO((int, char **)); … … 299 300 {1, "wd", wd, "write an image to a file"}, 300 301 {1, "write", write_vectors, "write vectors to datafile"}, 302 {1, "xsection", xsection, "generate cross-section histogram for an image (or region)"}, 301 303 {1, "zap", zap, "assign values to pixel regions"}, 302 304 {1, "zplot", zplot, "plot x y with size scaled by z"}, -
trunk/Ohana/src/opihi/dvo/avextract.c
r34749 r35416 137 137 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 138 138 if (PARALLEL && !HOST_ID) { 139 int status = HostTableParallelOps (argc, argv, RESULT_FILE, TRUE, 0, VERBOSE);139 int status = HostTableParallelOps (skylist, argc, argv, RESULT_FILE, TRUE, 0, VERBOSE); 140 140 141 141 dbFreeFields (fields, Nfields); -
trunk/Ohana/src/opihi/dvo/avmatch.c
r34749 r35416 95 95 96 96 // I need to pass the RA & DEC vectors to the remote clients... 97 int status = HostTableParallelOps ( argc, argv, RESULT_FILE, TRUE, RAvec->Nelements, VERBOSE);97 int status = HostTableParallelOps (skylist, argc, argv, RESULT_FILE, TRUE, RAvec->Nelements, VERBOSE); 98 98 if (vec) free (vec); 99 99 -
trunk/Ohana/src/opihi/dvo/dvo_host_utils.c
r35109 r35416 8 8 # define DIE(WHO,MSG) { perror(WHO); myAbort(MSG); } 9 9 10 int HostTableLaunchJobs ( HostTable *table, char *basecmd, char *options, int VERBOSE) {10 int HostTableLaunchJobs (SkyList *sky, HostTable *table, char *basecmd, char *options, int VERBOSE) { 11 11 12 12 char uniquer[12]; … … 35 35 36 36 int top_status = TRUE; 37 int i ;37 int i, j; 38 38 for (i = 0; i < table->Nhosts; i++) { 39 40 if (sky && (sky->Nregions < table->Nhosts)) { 41 // do any of the regions want this host? 42 int wantThisHost = FALSE; 43 for (j = 0; j < sky->Nregions; j++) { 44 if (HostTableTestHost (sky->regions[j], table->hosts[i].hostID)) { 45 wantThisHost = TRUE; 46 break; 47 } 48 } 49 if (!wantThisHost) { 50 // fprintf (stderr, "skip host %s\n", table->hosts[i].hostname); 51 continue; 52 } 53 // fprintf (stderr, "not skip host %s\n", table->hosts[i].hostname); 54 } 39 55 40 56 // ensure that the paths are absolute path names … … 88 104 // an alternative ending step ignores the result files and instead saves the names into 89 105 // the list 'result:n' for the user to access as desired 90 int HostTableParallelOps ( int argc, char **argv, char *ResultFile, int ReadVectors, int Nelements, int VERBOSE) {106 int HostTableParallelOps (SkyList *sky, int argc, char **argv, char *ResultFile, int ReadVectors, int Nelements, int VERBOSE) { 91 107 92 108 int i; 93 109 94 // load the list of hosts95 SkyTable *sky = GetSkyTable();96 if (!sky) {97 gprint (GP_ERR, "failed to load sky table for database\n");98 return FALSE;99 }110 // XX // load the list of hosts 111 // XX SkyTable *sky = GetSkyTable(); 112 // XX if (!sky) { 113 // XX gprint (GP_ERR, "failed to load sky table for database\n"); 114 // XX return FALSE; 115 // XX } 100 116 101 117 char *tmppath = GetCATDIR (); … … 145 161 146 162 // launch this command remotely 147 HostTableLaunchJobs ( table, basecmd, options, VERBOSE);163 HostTableLaunchJobs (sky, table, basecmd, options, VERBOSE); 148 164 free (options); 149 165 free (basecmd); … … 183 199 184 200 if (table->hosts[i].status) continue; 201 if (!table->hosts[i].pid) continue; 185 202 186 203 if (ReadVectors) { -
trunk/Ohana/src/opihi/dvo/mextract.c
r35263 r35416 16 16 if (field->ID == MEAS_CENTER_OFFSET) return TRUE; // 0.5*NX, 0.5*NY 17 17 if (field->ID == MEAS_EXPNAME_AS_INT) return TRUE; // expname (or as int) 18 if (field->ID == MEAS_ AIRMASS)return TRUE; // airmass18 if (field->ID == MEAS_MEAN_AIRMASS) return TRUE; // airmass 19 19 return FALSE; 20 20 } … … 171 171 172 172 // call the remote client 173 int status = HostTableParallelOps ( targc, targv, RESULT_FILE, TRUE, 0, VERBOSE);173 int status = HostTableParallelOps (skylist, targc, targv, RESULT_FILE, TRUE, 0, VERBOSE); 174 174 175 175 dbFreeFields (fields, Nfields); -
trunk/Ohana/src/opihi/dvo/mmatch.c
r35263 r35416 106 106 RAvec = NULL; 107 107 DECvec = NULL; 108 if (PARALLEL && !HOST_ID) {109 110 // We need to copy the args to a temp array and modify them so that we send the111 // correct set to the remote client. The args list looks like this:112 // if (!CoordsFile) : mmatch (RA) (DEC) (RADIUS) field, ...113 // if ( CoordsFile) : mmatch (RADIUS) field, ... [because we stripped off the -coords filename elements]114 115 // allocate the temp array and copy all but (RA) (DEC)116 int targc = 0;117 char **targv = NULL;118 ALLOCATE (targv, char *, argc + 2);119 for (i = 0; i < argc; i++) {120 if (!CoordsFile && (i == 1)) continue;121 if (!CoordsFile && (i == 2)) continue;122 targv[targc] = strcreate (argv[i]);123 targc ++;124 }125 126 // if not specified, create the coords.fits input file127 if (!CoordsFile) {128 // get vectors corresponding to coordinates of interest129 if ((RAvec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto help;130 if ((DECvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto help;131 132 ALLOCATE (vec, Vector *, 2);133 vec[0] = RAvec;134 vec[1] = DECvec;135 136 CoordsFile = abspath("coords.fits", 1024);137 int status = WriteVectorTableFITS (CoordsFile, "COORDS", vec, 2, FALSE, NULL);138 if (!status) goto escape;139 }140 141 // add the coords file to the args list142 targv[targc+0] = strcreate ("-coords");143 targv[targc+1] = CoordsFile; // this gets freed with targv144 targc += 2;145 146 // if needed, add the index vector to the args list147 if (IDXvec) {148 REALLOCATE (targv, char *, targc + 2);149 targv[targc+0] = strcreate ("-index");150 targv[targc+1] = strcreate (IDXvec[0].name);151 targc += 2;152 }153 154 if (loadImages) {155 Image *image;156 off_t Nimage;157 if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape;158 159 char *filename = abspath("image.metadata.fits", DVO_MAX_PATH);160 ImageMetadataSave (filename, image, Nimage);161 162 REALLOCATE (targv, char *, targc + 2);163 targv[targc+0] = strcreate ("-image-metadata");164 targv[targc+1] = strcreate (filename);165 targc += 2;166 }167 168 // call the remote client169 int status = HostTableParallelOps (targc, targv, RESULT_FILE, TRUE, 0, VERBOSE);170 if (vec) free (vec);171 172 // free up targv173 for (i = 0; i < targc; i++) {174 free (targv[i]);175 }176 free (targv);177 178 return status;179 }180 108 181 109 // get vectors corresponding to coordinates of interest … … 193 121 remove_argument (1, &argc, argv); 194 122 } 123 124 /* load regions which contain all supplied RA,DEC coordinates */ 125 if ((skylist = SelectRegionsByCoordVectors (RAvec, DECvec)) == NULL) goto escape; 126 127 if (PARALLEL && !HOST_ID) { 128 129 // We need to copy the args to a temp array and modify them so that we send the 130 // correct set to the remote client. The args list looks like this: 131 // if (!CoordsFile) : mmatch (RADIUS) field, ... [we removed RA & DEC above] 132 // if ( CoordsFile) : mmatch (RADIUS) field, ... [because we stripped off the -coords filename elements] 133 134 // allocate the temp array and copy all but (RA) (DEC) 135 int targc = 0; 136 char **targv = NULL; 137 ALLOCATE (targv, char *, argc + 2); 138 for (i = 0; i < argc; i++) { 139 targv[targc] = strcreate (argv[i]); 140 targc ++; 141 } 142 143 // if not specified, create the coords.fits input file 144 // NOTE: RAvec, DECvec were set above 145 if (!CoordsFile) { 146 ALLOCATE (vec, Vector *, 2); 147 vec[0] = RAvec; 148 vec[1] = DECvec; 149 150 // XXX this is now set for both cases... 151 CoordsFile = abspath("coords.fits", 1024); 152 int status = WriteVectorTableFITS (CoordsFile, "COORDS", vec, 2, FALSE, NULL); 153 if (!status) goto escape; 154 } 155 156 // add the coords file to the args list 157 targv[targc+0] = strcreate ("-coords"); 158 targv[targc+1] = CoordsFile; // this gets freed with targv 159 targc += 2; 160 161 // if needed, add the index vector to the args list 162 if (IDXvec) { 163 REALLOCATE (targv, char *, targc + 2); 164 targv[targc+0] = strcreate ("-index"); 165 targv[targc+1] = strcreate (IDXvec[0].name); 166 targc += 2; 167 } 168 169 if (loadImages) { 170 Image *image; 171 off_t Nimage; 172 if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape; 173 174 char *filename = abspath("image.metadata.fits", DVO_MAX_PATH); 175 ImageMetadataSave (filename, image, Nimage); 176 177 REALLOCATE (targv, char *, targc + 2); 178 targv[targc+0] = strcreate ("-image-metadata"); 179 targv[targc+1] = strcreate (filename); 180 targc += 2; 181 } 182 183 // call the remote client 184 int status = HostTableParallelOps (skylist, targc, targv, RESULT_FILE, TRUE, 0, VERBOSE); 185 if (vec) free (vec); 186 187 // free up targv 188 for (i = 0; i < targc; i++) { 189 free (targv[i]); 190 } 191 free (targv); 192 193 return status; 194 } // END of remote call section 195 195 196 RADIUS = atof (argv[1]); 196 197 remove_argument (1, &argc, argv); … … 209 210 } 210 211 211 /* load regions which contain all supplied RA,DEC coordinates */212 if ((skylist = SelectRegionsByCoordVectors (RAvec, DECvec)) == NULL) goto escape;213 212 214 213 /* create output storage vectors */ -
trunk/Ohana/src/opihi/dvo/photometry.c
r34405 r35416 1127 1127 double value; 1128 1128 Image *image; 1129 Coords *mosaic;1129 // Coords *mosaic; 1130 1130 1131 1131 value = 0; … … 1193 1193 # endif 1194 1194 break; 1195 # if 0 1195 1196 case MEAS_XMOSAIC: /* OK */ 1196 1197 ra = average[0].R - measure[0].dR / 3600.0; 1197 1198 dec = average[0].D - measure[0].dD / 3600.0; 1198 mosaic = MatchMosaic (measure[0].t, measure[0].photcode); 1199 mosaic = MatchMosaic (measure[0].t, measure[0].photcode); // XXX not used anymore 1199 1200 if (mosaic == NULL) break; 1200 1201 RD_to_XY (&x, &y, ra, dec, mosaic); … … 1204 1205 ra = average[0].R - measure[0].dR / 3600.0; 1205 1206 dec = average[0].D - measure[0].dD / 3600.0; 1206 mosaic = MatchMosaic (measure[0].t, measure[0].photcode); 1207 mosaic = MatchMosaic (measure[0].t, measure[0].photcode); // XXX not used anymore 1207 1208 if (mosaic == NULL) break; 1208 1209 RD_to_XY (&x, &y, ra, dec, mosaic); 1209 1210 value = y; 1210 1211 break; 1212 # endif 1211 1213 } 1212 1214 return (value); -
trunk/Ohana/src/opihi/dvo/remote.c
r35109 r35416 61 61 } 62 62 63 // load the list of hosts 64 SkyTable *sky = GetSkyTable(); 65 if (!sky) { 66 gprint (GP_ERR, "failed to load sky table for database\n"); 67 return FALSE; 68 } 69 SkyList *skylist = NULL; 70 ALLOCATE (skylist, SkyList, 1); 71 skylist[0].Nregions = sky[0].Nregions; 72 strcpy (skylist[0].hosts, sky[0].hosts); 73 63 74 // strip of the 'remote' and send the remaining arguments to the remote machine 64 int status = HostTableParallelOps (argc - 1, &argv[1], NULL, ReadVectors, 0, VERBOSE); 75 int status = HostTableParallelOps (skylist, argc - 1, &argv[1], NULL, ReadVectors, 0, VERBOSE); 76 free (skylist); 65 77 return status; 66 78 } -
trunk/Ohana/src/opihi/dvo/skyregion.c
r33662 r35416 98 98 new[0].Nregions = 0; 99 99 new[0].ownElements = FALSE; // this list is only holding a view to the elements 100 strcpy (new[0].hosts, sky[0].hosts); 100 101 101 102 // output list … … 107 108 list[0].Nregions = 0; 108 109 list[0].ownElements = FALSE; // this list is only holding a view to the elements 110 strcpy (list[0].hosts, sky[0].hosts); 109 111 110 112 for (i = 0; i < Npts; i++) { -
trunk/Ohana/src/opihi/include/dvoshell.h
r35109 r35416 99 99 dbValue dbExtractImages PROTO((Image *image, off_t Nimage, off_t N, dbField *field)); 100 100 101 int HostTableLaunchJobs PROTO(( HostTable *table, char *basecmd, char *options, int VERBOSE));102 int HostTableParallelOps PROTO(( int argc, char **argv, char *ResultFile, int ReadVectors, int Nelements, int VERBOSE));101 int HostTableLaunchJobs PROTO((SkyList *sky, HostTable *table, char *basecmd, char *options, int VERBOSE)); 102 int HostTableParallelOps PROTO((SkyList *sky, int argc, char **argv, char *ResultFile, int ReadVectors, int Nelements, int VERBOSE)); 103 103 int HostTableReloadResults PROTO((char *uniquer, int VERBOSE)); 104 104 int HostTableGetResults PROTO((char *uniquer, int VERBOSE));
Note:
See TracChangeset
for help on using the changeset viewer.
