Changeset 17813 for trunk/ppSub/src/ppSubReadout.c
- Timestamp:
- May 27, 2008, 9:32:16 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubReadout.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubReadout.c
r17798 r17813 184 184 #endif 185 185 186 // "Subtract" the mask and weight map 187 outRO->mask = (psImage*)psBinaryOp(outRO->mask, inConv->mask, "|", refConv->mask); 188 if (inConv->weight && refConv->weight) { 189 outRO->weight = (psImage*)psBinaryOp(outRO->weight, inConv->weight, "+", refConv->weight); 190 } 191 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true; 192 193 // Photometry is to be performed in two stages: 194 // 1. Measure the PSF using the PSF-matched images 195 // 2. Find and measure sources on the subtracted image 196 197 // Photometry stage 1: measure the PSF 198 if (psMetadataLookupBool(NULL, config->arguments, "PHOTOMETRY")) { 199 // We use a summed image as the basis for the PSF: this will have the maximum S/N. 200 outRO->image = (psImage*)psBinaryOp(outRO->image, inConv->image, "+", refConv->image); 201 202 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); 203 pmFPACopy(photFile->fpa, outRO->parent->parent->parent); 204 205 // We have a list of sources, so we could use those to redetermine the PSF model. 206 // Until Gene makes the necessary adaptations to psphot, we will simply redetermine the PSF model from 207 // scratch. 208 209 // Need to ensure aperture residual is not calculated 210 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PSPHOT_RECIPE); // Recipe 211 if (!recipe) { 212 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE); 213 return false; 214 } 215 const char *breakpoint = psMetadataLookupStr(NULL, recipe, "BREAK_POINT"); // Current break point 216 psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, 217 "ALTERED break point for psphot operations", "PSFMODEL"); 218 219 if (!psphotReadout(config, view)) { 220 psWarning("Unable to perform photometry on subtracted image."); 221 psErrorStackPrint(stderr, "Error stack from photometry:"); 222 psErrorClear(); 223 } 224 225 psMetadataAddStr(recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, 226 "RESTORED break point for psphot operations", breakpoint); 227 } 228 186 229 // Do the subtraction 187 230 { … … 197 240 198 241 outRO->image = (psImage*)psBinaryOp(outRO->image, minuend->image, "-", subtrahend->image); 199 outRO->mask = (psImage*)psBinaryOp(outRO->mask, minuend->mask, "|", subtrahend->mask);200 if (minuend->weight && subtrahend->weight) {201 outRO->weight = (psImage*)psBinaryOp(outRO->weight, minuend->weight, "+", subtrahend->weight);202 }203 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true;204 242 205 243 #ifdef TESTING … … 249 287 } 250 288 289 // Photometry stage 2: find and measure sources on the subtracted image 251 290 if (psMetadataLookupBool(NULL, config->arguments, "PHOTOMETRY")) { 291 // The PSF should already be stored for the readout 252 292 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); 253 pmFPACopy(photFile->fpa, outRO->parent->parent->parent);254 293 255 294 // Need to ensure aperture residual is not calculated
Note:
See TracChangeset
for help on using the changeset viewer.
