- Timestamp:
- May 8, 2013, 4:41:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419/pswarp/src/pswarpLoop.c
r35527 r35535 1 1 /** @file pswarpLoop.c 2 2 * 3 * @brief mai lprocessing loop for pswarp3 * @brief main processing loop for pswarp 4 4 * @ingroup pswarp 5 5 * … … 13 13 #include "pswarpFileNames.h" // Lists of file rules used at different stages 14 14 15 // Loop over the inputs, warp them to the output skycell and then write out the output.15 // Loop over the inputs, warp them to the output skycell and then update metadata 16 16 bool pswarpLoop(pmConfig *config, psMetadata *stats) 17 17 { 18 const char *skyCamera = psMetadataLookupStr(NULL, config->arguments,19 "SKYCELL.CAMERA"); // Name of camera for skycell20 pmConfigCamerasCull(config, skyCamera);21 pmConfigRecipesCull(config, "PSWARP,PPSTATS,PSPHOT,PSASTRO,MASKS,JPEG");22 18 23 19 // load the recipe … … 26 22 if (!recipe) { 27 23 psError(PSWARP_ERR_CONFIG, false, "missing recipe %s", PSWARP_RECIPE); 28 return false;29 }30 31 // XXX move this to pswarpParseCamera? has to come after input mask header is read32 if (!pswarpSetMaskBits(config)) {33 psError(psErrorCodeLast(), false, "failed to set mask bits");34 24 return false; 35 25 } … … 66 56 } 67 57 68 fprintf (stderr, "loading file %s\n", input->filename); 69 70 // use the external astrometry source if supplied 58 // select the input data sources 71 59 pmFPAfile *astrom = pmFPAfileSelectSingle(config->files, "PSWARP.ASTROM", i); 72 60 if (!astrom) { … … 74 62 } 75 63 76 if (astrom->camera != input->camera) { 77 psError(PSWARP_ERR_DATA, true, "Input camera and astrometry camera do not match."); 78 return false; 79 } 80 81 // ensure everyone is off except what we need below 82 pswarpFileActivation(config, detectorFiles, false); 64 // ensure everyone is off except what we need below 65 // XXX double-check activation issues in general 66 pswarpFileActivation(config, detectorFiles, true); 83 67 pswarpFileActivation(config, photFiles, false); 84 68 pswarpFileActivation(config, independentFiles, false); 85 69 pswarpFileActivation(config, skycellFiles, false); 86 70 87 // the loops below load the input data 88 pswarpFileActivation(config, detectorFiles, true); 89 90 // need to read in these (but only if CMF, right?) 71 // We re-activate the CMF load so we can transform the sources as well as the pixels. 72 // We only need to read in these if the astrometry source is CMF. 91 73 pmFPAfileActivate(config->files, true, "PSWARP.ASTROM"); 92 93 // pswarpFileActivation(config, independentFiles, true);94 74 95 75 pmFPAviewReset (view); … … 174 154 goto FAIL; 175 155 } 176 if (!pswarpUpdateMetadata (output->fpa, input->fpa, astrom->fpa, config)) {156 if (!pswarpUpdateMetadata (output->fpa, skycell->fpa, input->fpa, astrom->fpa, config, true)) { 177 157 psError(psErrorCodeLast(), false, "problem generating statistics."); 178 158 goto FAIL; … … 184 164 goto FAIL; 185 165 } 186 187 // XXX188 // pswarpDumpOutput (config);189 // exit (0);190 166 191 167 psFree(view); … … 196 172 return false; 197 173 } 198 199 // static int Nout = 0;200 174 201 175 // once the output fpa elements have been built, loop over the fpa and generate stats … … 219 193 while ((readout = pmFPAviewNextReadout(view, output, 1)) != NULL) { 220 194 pswarpTransformReadout (readout, input, config); 221 // char name[64];222 // snprintf (name, 64, "dumpwarp.%02d.fits", Nout);223 // Nout ++;224 //225 // psphotSaveImage (NULL, readout->image, name);226 195 } 227 196 }
Note:
See TracChangeset
for help on using the changeset viewer.
