Changeset 21217
- Timestamp:
- Jan 28, 2009, 5:12:09 PM (17 years ago)
- Location:
- branches/pap_branch_20090128/ppImage/src
- Files:
-
- 5 edited
-
ppImage.h (modified) (3 diffs)
-
ppImageDetrendReadout.c (modified) (1 diff)
-
ppImageFileCheck.c (modified) (4 diffs)
-
ppImageOptions.c (modified) (5 diffs)
-
ppImageParseCamera.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/ppImage/src/ppImage.h
r20774 r21217 25 25 // actions which ppImage should perform 26 26 bool doMaskBuild; // Build internal mask 27 bool do WeightBuild; // Build internal mask27 bool doVarianceBuild; // Build internal variance map 28 28 bool doMask; // Mask bad pixels 29 29 bool doNonLin; // Non-linearity correction … … 44 44 bool BaseFITS; 45 45 bool BaseMaskFITS; 46 bool Base WeightFITS;46 bool BaseVarianceFITS; 47 47 48 48 bool ChipFITS; 49 49 bool ChipMaskFITS; 50 bool Chip WeightFITS;50 bool ChipVarianceFITS; 51 51 52 52 bool FPA1FITS; … … 58 58 59 59 // make values for abstract concepts of masking 60 ps MaskType maskValue;// apply this bit-mask to choose masked bits61 ps MaskType markValue;// apply this bit-mask to choose masked bits62 ps MaskType satMask;// Mask value to give saturated pixels63 ps MaskType badMask;// Mask value to give bad pixels64 ps MaskType flatMask;// Mask value to give bad flat pixels65 ps MaskType blankMask;// Mask value to give blank pixels60 psImageMaskType maskValue; // apply this bit-mask to choose masked bits 61 psImageMaskType markValue; // apply this bit-mask to choose masked bits 62 psImageMaskType satMask; // Mask value to give saturated pixels 63 psImageMaskType badMask; // Mask value to give bad pixels 64 psImageMaskType flatMask; // Mask value to give bad flat pixels 65 psImageMaskType blankMask; // Mask value to give blank pixels 66 66 67 67 // non-linear correction parameters -
branches/pap_branch_20090128/ppImage/src/ppImageDetrendReadout.c
r20626 r21217 59 59 60 60 // Weight on the basis of pixel value needs to be done after the overscan has been subtracted 61 if (options->do WeightBuild) {62 // create the target mask and weightimages63 pmReadoutGenerate Weight(input, true);61 if (options->doVarianceBuild) { 62 // create the target mask and variance images 63 pmReadoutGenerateVariance(input, true); 64 64 } 65 65 -
branches/pap_branch_20090128/ppImage/src/ppImageFileCheck.c
r14001 r21217 20 20 if (fpa->hdu) { 21 21 if (fpa->hdu->images) fprintf (stderr, " (%d,%d) images\n", -1, -1); 22 if (fpa->hdu-> weights) fprintf (stderr, " (%d,%d) weights\n", -1, -1);22 if (fpa->hdu->variances) fprintf (stderr, " (%d,%d) variances\n", -1, -1); 23 23 if (fpa->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", -1, -1); 24 24 if (fpa->hdu->header) fprintf (stderr, " (%d,%d) header\n", -1, -1); … … 30 30 if (chip->hdu) { 31 31 if (chip->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, -1); 32 if (chip->hdu-> weights) fprintf (stderr, " (%d,%d) weights\n", i, -1);32 if (chip->hdu->variances) fprintf (stderr, " (%d,%d) variances\n", i, -1); 33 33 if (chip->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, -1); 34 34 if (chip->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, -1); … … 40 40 if (cell->hdu) { 41 41 if (cell->hdu->images) fprintf (stderr, " (%d,%d) images\n", i, j); 42 if (cell->hdu-> weights) fprintf (stderr, " (%d,%d) weights\n", i, j);42 if (cell->hdu->variances) fprintf (stderr, " (%d,%d) variances\n", i, j); 43 43 if (cell->hdu->masks) fprintf (stderr, " (%d,%d) masks\n", i, j); 44 44 if (cell->hdu->header) fprintf (stderr, " (%d,%d) header\n", i, j); … … 50 50 if (readout) { 51 51 if (readout->image) fprintf (stderr, " (%d,%d,%d) image\n", i, j, k); 52 if (readout-> weight) fprintf (stderr, " (%d,%d,%d) weight\n", i, j, k);52 if (readout->variance) fprintf (stderr, " (%d,%d,%d) variance\n", i, j, k); 53 53 if (readout->mask) fprintf (stderr, " (%d,%d,%d) masks\n", i, j, k); 54 54 } -
branches/pap_branch_20090128/ppImage/src/ppImageOptions.c
r20626 r21217 19 19 // actions which ppImage should perform 20 20 options->doMaskBuild = false; // Build internal mask 21 options->do WeightBuild = false; // Build internal weight21 options->doVarianceBuild = false; // Build internal variance 22 22 options->doMask = false; // Mask bad pixels 23 23 options->doNonLin = false; // Non-linearity correction … … 37 37 options->BaseFITS = false; // create output image 38 38 options->BaseMaskFITS = false; // create output mask image 39 options->Base WeightFITS = false; // create output weightimage39 options->BaseVarianceFITS = false; // create output variance image 40 40 41 41 options->ChipFITS = false; // create output chip-mosaic image 42 42 options->ChipMaskFITS = false; // create output chip-mosaic mask image 43 options->Chip WeightFITS = false; // create output chip-mosaic weightimage43 options->ChipVarianceFITS = false; // create output chip-mosaic variance image 44 44 45 45 options->FPA1FITS = false; // create fpa-mosaic binned image (scale 1) … … 194 194 // for these images, even if not required otherwise 195 195 options->doMaskBuild = psMetadataLookupBool(NULL, recipe, "MASK.BUILD"); 196 options->do WeightBuild = psMetadataLookupBool(NULL, recipe, "WEIGHT.BUILD");196 options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD"); 197 197 198 198 // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c) … … 236 236 options->BaseFITS = psMetadataLookupBool(NULL, recipe, "BASE.FITS"); 237 237 options->BaseMaskFITS = psMetadataLookupBool(NULL, recipe, "BASE.MASK.FITS"); 238 options->Base WeightFITS = psMetadataLookupBool(NULL, recipe, "BASE.WEIGHT.FITS");238 options->BaseVarianceFITS = psMetadataLookupBool(NULL, recipe, "BASE.VARIANCE.FITS"); 239 239 240 240 options->ChipFITS = psMetadataLookupBool(NULL, recipe, "CHIP.FITS"); 241 241 options->ChipMaskFITS = psMetadataLookupBool(NULL, recipe, "CHIP.MASK.FITS"); 242 options->Chip WeightFITS = psMetadataLookupBool(NULL, recipe, "CHIP.WEIGHT.FITS");242 options->ChipVarianceFITS = psMetadataLookupBool(NULL, recipe, "CHIP.VARIANCE.FITS"); 243 243 244 244 options->FPA1FITS = psMetadataLookupBool(NULL, recipe, "FPA1.FITS"); … … 255 255 options->doBG = psMetadataLookupBool(NULL, recipe, "BACKGROUND"); 256 256 257 // even if not requested explicitly, if any of these are set, build an internal mask and weight:257 // even if not requested explicitly, if any of these are set, build an internal mask and variance: 258 258 if (options->doBias || options->doOverscan || options->doDark || options->doShutter || options->doFlat || 259 259 options->doPhotom) { 260 260 options->doMaskBuild = true; 261 options->do WeightBuild = true;261 options->doVarianceBuild = true; 262 262 } else if (options->doMask || options->doBG) { 263 263 options->doMaskBuild = true; -
branches/pap_branch_20090128/ppImage/src/ppImageParseCamera.c
r20647 r21217 20 20 } 21 21 22 // if MASK or WEIGHTwas supplied on command line, bind files to 'input'.23 // the mask and weightwill be mosaicked with the image22 // if MASK or VARIANCE was supplied on command line, bind files to 'input'. 23 // the mask and variance will be mosaicked with the image 24 24 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "PPIMAGE.INPUT.MASK"); 25 25 if (!status) { … … 34 34 } 35 35 36 pmFPAfile *input Weight = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.WEIGHT", "PPIMAGE.INPUT.WEIGHT");36 pmFPAfile *inputVariance = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.VARIANCE", "PPIMAGE.INPUT.VARIANCE"); 37 37 if (!status) { 38 38 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 39 39 return NULL; 40 40 } 41 if (input Weight && inputWeight->type != PM_FPA_FILE_WEIGHT) {42 psError(PS_ERR_IO, true, "PPIMAGE.INPUT. WEIGHT is not of type WEIGHT");41 if (inputVariance && inputVariance->type != PM_FPA_FILE_VARIANCE) { 42 psError(PS_ERR_IO, true, "PPIMAGE.INPUT.VARIANCE is not of type VARIANCE"); 43 43 return NULL; 44 44 } … … 195 195 return NULL; 196 196 } 197 pmFPAfile *out Weight = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT.WEIGHT");198 if (!out Weight) {199 psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT. WEIGHT"));200 psFree(options); 201 return NULL; 202 } 203 if (out Weight->type != PM_FPA_FILE_WEIGHT) {204 psError(PS_ERR_IO, true, "PPIMAGE.OUTPUT. WEIGHT is not of type WEIGHT");197 pmFPAfile *outVariance = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT.VARIANCE"); 198 if (!outVariance) { 199 psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.OUTPUT.VARIANCE")); 200 psFree(options); 201 return NULL; 202 } 203 if (outVariance->type != PM_FPA_FILE_VARIANCE) { 204 psError(PS_ERR_IO, true, "PPIMAGE.OUTPUT.VARIANCE is not of type VARIANCE"); 205 205 psFree(options); 206 206 return NULL; … … 230 230 return NULL; 231 231 } 232 pmFPAfile *chip Weight = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.WEIGHT");233 if (!chip Weight) {234 psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHIP. WEIGHT"));235 psFree(options); 236 return NULL; 237 } 238 if (chip Weight->type != PM_FPA_FILE_WEIGHT) {239 psError(PS_ERR_IO, true, "PPIMAGE.CHIP. WEIGHT is not of type WEIGHT");232 pmFPAfile *chipVariance = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.VARIANCE"); 233 if (!chipVariance) { 234 psError(PS_ERR_IO, false, _("Unable to generate output file from PPIMAGE.CHIP.VARIANCE")); 235 psFree(options); 236 return NULL; 237 } 238 if (chipVariance->type != PM_FPA_FILE_VARIANCE) { 239 psError(PS_ERR_IO, true, "PPIMAGE.CHIP.VARIANCE is not of type VARIANCE"); 240 240 psFree(options); 241 241 return NULL; … … 315 315 outImage->save = options->BaseFITS; 316 316 outMask->save = options->BaseMaskFITS; 317 out Weight->save = options->BaseWeightFITS;317 outVariance->save = options->BaseVarianceFITS; 318 318 319 319 chipImage->save = options->ChipFITS; 320 320 chipMask->save = options->ChipMaskFITS; 321 chip Weight->save = options->ChipWeightFITS;321 chipVariance->save = options->ChipVarianceFITS; 322 322 323 323 byFPA1->save = options->FPA1FITS; … … 329 329 outImage->fileLevel = PS_MIN (outImage->fileLevel, outImage->dataLevel); 330 330 331 // outMask and out Weightmust be freed at the same level as outImage (all freed by pmFPAFreeData)331 // outMask and outVariance must be freed at the same level as outImage (all freed by pmFPAFreeData) 332 332 outMask->freeLevel = outImage->freeLevel; 333 out Weight->freeLevel = outImage->freeLevel;333 outVariance->freeLevel = outImage->freeLevel; 334 334 outMask->dataLevel = outImage->dataLevel; 335 out Weight->dataLevel = outImage->dataLevel;335 outVariance->dataLevel = outImage->dataLevel; 336 336 337 337 // Ditto for the chip-mosaicked version 338 338 chipMask->freeLevel = chipImage->freeLevel; 339 chip Weight->freeLevel = chipImage->freeLevel;339 chipVariance->freeLevel = chipImage->freeLevel; 340 340 chipMask->dataLevel = chipImage->dataLevel; 341 chip Weight->dataLevel = chipImage->dataLevel;341 chipVariance->dataLevel = chipImage->dataLevel; 342 342 343 343 // the input data is the same as the outImage data : force the free levels to match … … 434 434 } 435 435 436 // Turn off mask and weightoutput if we're not doing anything interesting436 // Turn off mask and variance output if we're not doing anything interesting 437 437 if (!options->doMaskBuild && outMask->save) { 438 438 psWarning("output mask image (BASE.MASK.FITS) requested, but not generated: skipping.\n"); 439 439 outMask->save = false; 440 440 } 441 if (!options->do WeightBuild && outWeight->save) {442 psWarning("output weight image (BASE.WEIGHT.FITS) requested, but not generated: skipping.\n");443 out Weight->save = false;441 if (!options->doVarianceBuild && outVariance->save) { 442 psWarning("output variance image (BASE.VARIANCE.FITS) requested, but not generated: skipping.\n"); 443 outVariance->save = false; 444 444 } 445 445 if (!options->doMaskBuild && chipMask->save) { … … 447 447 chipMask->save = false; 448 448 } 449 if (!options->do WeightBuild && chipWeight->save) {450 psWarning("output weight image (CHIP.WEIGHT.FITS) requested, but not generated: skipping.\n");451 chip Weight->save = false;449 if (!options->doVarianceBuild && chipVariance->save) { 450 psWarning("output variance image (CHIP.VARIANCE.FITS) requested, but not generated: skipping.\n"); 451 chipVariance->save = false; 452 452 } 453 453
Note:
See TracChangeset
for help on using the changeset viewer.
