- Timestamp:
- Dec 6, 2012, 6:32:19 PM (14 years ago)
- Location:
- branches/czw_branch/20120906/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120905/psphot (added) merged: 34408-34409,34415-34416,34428,34466,34565,34570,34575,34735,34747
- Property svn:mergeinfo changed
-
branches/czw_branch/20120906/psphot/src
- Property svn:mergeinfo changed
-
branches/czw_branch/20120906/psphot/src/psphotStackParseCamera.c
r33913 r34772 14 14 return false; 15 15 } 16 17 // select the appropriate recipe information 18 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE); 19 bool savePSF = psMetadataLookupBool(&status, recipe, "SAVE.PSF"); 20 bool saveBackgroundModel = psMetadataLookupBool(&status, recipe, "SAVE.BACKMDL"); 21 bool saveBackground = psMetadataLookupBool(&status, recipe, "SAVE.BACKGND"); 22 bool saveBackSub = psMetadataLookupBool(&status, recipe, "SAVE.BACKSUB"); 23 bool saveResid = psMetadataLookupBool(&status, recipe, "SAVE.RESID"); 24 25 bool saveCnv = psMetadataLookupBool(&status, recipe, "SAVE.CNV"); 26 bool saveChisq = psMetadataLookupBool(&status, recipe, "SAVE.CHISQ"); 27 bool useRaw = psMetadataLookupBool(&status, recipe, "PSPHOT.STACK.USE.RAW"); 28 16 29 17 30 int nRaw = 0; … … 120 133 } 121 134 } 135 pmFPAfile *inputTemplate; 136 if (useRaw) { 137 inputTemplate = rawInputFile; 138 } else { 139 inputTemplate = cnvInputFile; 140 } 141 if (!inputTemplate) { 142 psError(PS_ERR_UNKNOWN, true, "cannot determinte inputTemplate: USE.RAW: %d\n", useRaw); 143 return false; 144 } 122 145 123 146 psString sources = psMetadataLookupStr(&status, input, "SOURCES"); // Name of mask … … 135 158 } 136 159 // generate an pmFPAimage for the output convolved image 137 // XXX output of these files should be optional138 160 { 139 161 // pmFPAfile *srcInputFile = rawInputFile ? rawInputFile : cnvInputFile; … … 143 165 return false; 144 166 } 145 outputImage->save = true;167 outputImage->save = saveCnv; 146 168 outputImage->fileID = stack_id; // this is used to generate output names 147 169 … … 155 177 return NULL; 156 178 } 157 outputMask->save = true;179 outputMask->save = saveCnv; 158 180 outputMask->fileID = stack_id; // this is used to generate output names 159 181 … … 167 189 return NULL; 168 190 } 169 outputVariance->save = true;191 outputVariance->save = saveCnv; 170 192 outputVariance->fileID = stack_id; // this is used to generate output names 171 193 … … 178 200 outsources->save = true; 179 201 outsources->fileID = stack_id; // this is used to generate output names 202 203 if (savePSF) { 204 pmFPAfile *output = pmFPAfileDefineOutputFromFile (config, inputTemplate, "PSPHOT.STACK.PSF.SAVE"); 205 if (!output) { 206 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.PSF.SAVE"); 207 return false; 208 } 209 output->save = true; 210 output->fileID = stack_id; 211 } 212 if (saveBackgroundModel) { 213 int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN"); 214 int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN"); 215 pmFPAfile *output = pmFPAfileDefineFromFile (config, inputTemplate, DX, DY, "PSPHOT.STACK.BACKMDL"); 216 if (!output) { 217 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.BACKMDL"); 218 return false; 219 } 220 221 output->save = true; 222 output->fileID = stack_id; 223 } 224 if (saveBackground) { 225 pmFPAfile *output = pmFPAfileDefineFromFile (config, inputTemplate, 1, 1, "PSPHOT.STACK.BACKGND"); 226 if (!output) { 227 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.STACK.BACKGND"); 228 return false; 229 } 230 output->save = true; 231 output->fileID = stack_id; 232 } 233 if (saveBackSub) { 234 pmFPAfile *output = pmFPAfileDefineFromFile (config, inputTemplate, 1, 1, "PSPHOT.STACK.BACKSUB"); 235 if (!output) { 236 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.STACK.BACKSUB"); 237 return false; 238 } 239 output->save = true; 240 output->fileID = stack_id; 241 } 242 if (saveResid) { 243 pmFPAfile *output = pmFPAfileDefineOutputFromFile (config, inputTemplate, "PSPHOT.STACK.RESID"); 244 if (!output) { 245 psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.STACK.RESID"); 246 return false; 247 } 248 output->save = true; 249 output->fileID = stack_id; 250 } 180 251 } 181 252 } … … 191 262 } 192 263 193 // select the appropriate recipe information194 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);195 bool saveCnv = psMetadataLookupBool(&status, recipe, "SAVE.CNV");196 bool saveChisq = psMetadataLookupBool(&status, recipe, "SAVE.CHISQ");197 198 // loop over the available readouts199 for (int i = 0; i < nInputs; i++) {200 pmFPAfile *file = NULL;201 202 file = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.IMAGE", i);203 file->save = saveCnv;204 205 file = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.MASK", i);206 file->save = saveCnv;207 208 file = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.VARIANCE", i);209 file->save = saveCnv;210 }211 212 264 // generate an pmFPAimage for the chisqImage 213 // XXX output of these files should be optional214 265 { 215 266 pmFPAfile *chisqImage = pmFPAfileDefineOutput(config, NULL, "PSPHOT.CHISQ.IMAGE");
Note:
See TracChangeset
for help on using the changeset viewer.
