- Timestamp:
- Mar 6, 2013, 4:50:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mmatch.c
r35249 r35250 49 49 } 50 50 51 // load info about the images from a reduced-size file 52 char *imageMetadataFile = FALSE; 53 if ((N = get_argument (argc, argv, "-image-metadata"))) { 54 remove_argument (N, &argc, argv); 55 imageMetadataFile = strcreate (argv[N]); 56 remove_argument (N, &argc, argv); 57 } 58 51 59 int PARALLEL = FALSE; 52 60 if ((N = get_argument (argc, argv, "-parallel"))) { … … 75 83 // HOST_ID tells library if operation is on remote client or not 76 84 dbExtractMeasuresInit(HOST_ID); 85 86 // parse the fields to be extracted and returned 87 int first = 4; 88 if (CoordsFile) { 89 first = 2; 90 } 91 fields = dbCmdlineFields (argc-first, &argv[first], DVO_TABLE_MEASURE, &last, &Nfields); 92 if (fields == NULL) goto help; 93 if ((Nfields == 0) || (last != argc - first)) { 94 dbFreeFields (fields, Nfields); 95 dvo_catalog_free (&catalog); 96 goto help; 97 } 98 99 // load image data if needed (for fields listed below) 100 int loadImages = FALSE; 101 for (i = 0; !loadImages && (i < Nfields); i++) { 102 loadImages = field_needs_images (&fields[i]); 103 } 77 104 78 105 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results … … 124 151 targc += 2; 125 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 } 126 167 127 168 // call the remote client … … 155 196 remove_argument (1, &argc, argv); 156 197 157 // parse the fields to be extracted and returned158 fields = dbCmdlineFields (argc, argv, DVO_TABLE_MEASURE, &last, &Nfields);159 if (fields == NULL) goto help;160 if ((Nfields == 0) || (last != argc)) {161 dbFreeFields (fields, Nfields);162 dvo_catalog_free (&catalog);163 goto help;164 }165 166 // load image data if needed (for fields listed below)167 int loadImages = FALSE;168 for (i = 0; !loadImages && (i < Nfields); i++) {169 loadImages = field_needs_images (&fields[i]);170 }171 172 198 // use the whole sky (since we select random points around the sky) 173 199 SkyRegionSelection selection; 174 200 selection.useDisplay = FALSE; 175 201 selection.useSkyregion = FALSE; 176 if (loadImages && !SetImageSelection (TRUE, &selection)) goto escape; 202 203 if (loadImages) { 204 if (HOST_ID) { 205 if (!SetImageMetadataSelection (imageMetadataFile)) goto escape; 206 } else { 207 if (!SetImageSelection (TRUE, &selection)) goto escape; 208 } 209 } 177 210 178 211 /* load regions which contain all supplied RA,DEC coordinates */ … … 309 342 if (invec) FreeVectorArray (invec, Ninvec); 310 343 dbFreeFields (fields, Nfields); 344 FreeImageSelection (); 345 FreeImageMetadataSelection (); 311 346 SkyListFree (skylist); 312 347 return (TRUE); … … 317 352 if (invec) FreeVectorArray (invec, Ninvec); 318 353 dbFreeFields (fields, Nfields); 354 FreeImageSelection (); 355 FreeImageMetadataSelection (); 319 356 SkyListFree (skylist); 320 357 return (FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.
