Changeset 35246
- Timestamp:
- Mar 6, 2013, 3:12:10 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130306/Ohana/src/opihi/dvo/mextract.c
r35244 r35246 1 1 # include "dvoshell.h" 2 3 int SaveImageMetadata () { 4 5 } 2 6 3 7 int field_needs_images (dbField *field) { … … 16 20 if (field->ID == MEAS_CENTER_OFFSET) return TRUE; // 0.5*NX, 0.5*NY 17 21 if (field->ID == MEAS_EXPNAME_AS_INT) return TRUE; // expname (or as int) 22 mean airmass; 18 23 return FALSE; 19 24 } … … 124 129 if ((skylist = SelectRegions (selection)) == NULL) goto escape; 125 130 131 // load image data if needed (for fields listed below) 132 loadImages = FALSE; 133 for (i = 0; !loadImages && (i < Nfields); i++) { 134 loadImages = field_needs_images (&fields[i]); 135 } 136 126 137 // this does all the work of re-packaging the command, calling it on the remote machines, then loading in the results 127 138 if (PARALLEL && !HOST_ID) { 139 140 // Image Metadata for remote queries: 141 // 1) figure out if we need any image metadata 142 // 2) load the images and generate a subset table with just the fields of interest 143 // 3) add the input subset filename to the dvo_client command 144 145 if (loadImages) { 146 Image *image; 147 off_t Nimage; 148 if ((image = LoadImagesDVO (&Nimage)) == NULL) goto escape; 149 150 char *filename = abspath("image.metadata.fits", DVO_MAX_PATH); 151 SaveImageMetadata (filename, image, Nimage); 152 argc += 2; 153 argv[argc-2] = strcreate ("-image-metadata"); 154 argv[argc-1] = strcreate (filename); 155 } 156 128 157 int status = HostTableParallelOps (argc, argv, RESULT_FILE, TRUE, 0, VERBOSE); 129 158 … … 134 163 dvo_catalog_free (&catalog); 135 164 165 if (loadImages) { 166 free (argv[argc-1]); 167 free (argv[argc-2]); 168 } 169 136 170 return status; 137 171 } 138 172 139 // load image data if needed (for fields listed below) 140 loadImages = FALSE; 141 for (i = 0; !loadImages && (i < Nfields); i++) { 142 loadImages = field_needs_images (&fields[i]); 143 } 144 if (loadImages && !SetImageSelection (TRUE, selection)) goto escape; 173 if (REMOTE_CLIENT) { 174 if (loadImages) { 175 ImageMetadata = *imageMetadata = LoadImageMetadata (filename, &Nimages); 176 if (!imageMetadata) goto escape; 177 SetImageMetadata (imageMetadata, Nimages); 178 } else { 179 if (loadImages && !SetImageSelection (TRUE, selection)) goto escape; 180 } 145 181 146 182 /* create storage vector */
Note:
See TracChangeset
for help on using the changeset viewer.
