Changeset 24557 for branches/eam_branches/20090522/ppImage
- Timestamp:
- Jun 25, 2009, 2:00:56 PM (17 years ago)
- Location:
- branches/eam_branches/20090522
- Files:
-
- 10 edited
-
. (modified) (1 prop)
-
ppImage (modified) (1 prop)
-
ppImage/notes.txt (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageArguments.c (modified) (2 diffs)
-
ppImage/src/ppImageDetrendFree.c (modified) (1 diff)
-
ppImage/src/ppImageDetrendReadout.c (modified) (1 diff)
-
ppImage/src/ppImageDetrendRecord.c (modified) (1 diff)
-
ppImage/src/ppImageOptions.c (modified) (3 diffs)
-
ppImage/src/ppImageParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090522
- Property svn:mergeinfo changed
-
branches/eam_branches/20090522/ppImage
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/20090522/ppImage/notes.txt
r14620 r24557 1 1 2 ppImage pmFPAfiles: 2 20090611 : adjusting things to allow the readnoise to be an image map for each cell 3 3 4 pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PPIMAGE.INPUT", "INPUT"); 5 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.MASK", "INPUT.MASK"); 6 pmFPAfile *inputWeight = pmFPAfileBindFromArgs(&status, input, config, "PPIMAGE.INPUT.WEIGHT", "INPUT.WEIGHT"); 7 pmFPAfile *output = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT"); 8 pmFPAfile *outMask = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT.MASK"); 9 pmFPAfile *outWeight = pmFPAfileDefineOutput(config, input->fpa, "PPIMAGE.OUTPUT.WEIGHT"); 10 pmFPAfile *chipImage = pmFPAfileDefineChipMosaic(config, input->fpa, "PPIMAGE.CHIP"); 11 pmFPAfile *chipMask = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.MASK"); 12 pmFPAfile *chipWeight = pmFPAfileDefineOutput(config, chipImage->fpa, "PPIMAGE.CHIP.WEIGHT"); 13 pmFPAfile *byFPA1 = pmFPAfileDefineFPAMosaic(config, input->fpa, "PPIMAGE.OUTPUT.FPA1"); 14 pmFPAfile *byFPA2 = pmFPAfileDefineFPAMosaic(config, input->fpa, "PPIMAGE.OUTPUT.FPA2"); 4 * pmReadoutSetVaraince : when variance is created, we are suppling a single CELL.READNOISE value -- change this to an optional image (carried through concepts?) 15 5 16 pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, chipImage->fpa, 1, 1, "PSPHOT.INPUT"); 17 pmFPAfile *psphotOutput = psMetadataLookupPtr (&status, config->files, "PSPHOT.OUTPUT"); 18 pmFPAfile *psastroInput = pmFPAfileDefineInput (config, psphotOutput->fpa, "PSASTRO.INPUT"); 6 I need to: 19 7 20 pmFPAfile *bin1 = pmFPAfileDefineFromFPA (config, chipImage->fpa, options->xBin1, options->yBin1, "PPIMAGE.BIN1"); 21 pmFPAfile *bin2 = pmFPAfileDefineFromFPA (config, chipImage->fpa, options->xBin2, options->yBin2, "PPIMAGE.BIN2"); 22 pmFPAfile *jpg1 = pmFPAfileDefineOutput (config, byFPA1->fpa, "PPIMAGE.JPEG1"); 23 pmFPAfile *jpg2 = pmFPAfileDefineOutput (config, byFPA2->fpa, "PPIMAGE.JPEG2"); 8 * define a format for the readnoise map (image map in SPLIT/MEF format?) 9 * load the readnoise map 10 11 * supply the map for each cell to the pmReadoutSetVariance (pointer to ppImageMap?) 12 pmReadoutSetVariance -> add psImageMap to API (also pmReadoutGenerateVariance) 13 14 * add recipe information to define the source of the READNOISE info. 15 -
branches/eam_branches/20090522/ppImage/src/ppImage.h
r24229 r24557 31 31 bool doNonLin; // Non-linearity correction 32 32 bool doOverscan; // Overscan subtraction 33 bool doNoiseMap; // Bias subtraction 33 34 bool doBias; // Bias subtraction 34 35 bool doDark; // Dark subtraction -
branches/eam_branches/20090522/ppImage/src/ppImageArguments.c
r23268 r24557 17 17 fprintf(stderr, "\n"); 18 18 fprintf(stderr, "Input options (single file / file list):\n"); 19 fprintf(stderr, "\t-noisemap/-noisemaplist: Noise Map image.\n"); 19 20 fprintf(stderr, "\t-bias/-biaslist: Bias image.\n"); 20 21 fprintf(stderr, "\t-dark/-darklist: Dark image.\n"); … … 112 113 // if these command-line options are supplied, load the file name lists into config->arguments 113 114 // override any configuration-specified source for these files 115 pmConfigFileSetsMD (config->arguments, &argc, argv, "NOISEMAP", "-noisemap", "-noisemaplist"); 114 116 pmConfigFileSetsMD (config->arguments, &argc, argv, "BIAS", "-bias", "-biaslist"); 115 117 pmConfigFileSetsMD (config->arguments, &argc, argv, "DARK", "-dark", "-darklist"); -
branches/eam_branches/20090522/ppImage/src/ppImageDetrendFree.c
r20774 r24557 8 8 static char *detrendTypes[] = { 9 9 "PPIMAGE.MASK", 10 "PPIMAGE.NOISEMAP", 10 11 "PPIMAGE.BIAS", 11 12 "PPIMAGE.DARK", -
branches/eam_branches/20090522/ppImage/src/ppImageDetrendReadout.c
r24079 r24557 64 64 if (options->doVarianceBuild) { 65 65 // create the target mask and variance images 66 pmReadoutGenerateVariance(input, true); 66 psImage *noiseImage = NULL; 67 if (options->doNoiseMap) { 68 // XXX convert the noiseMap image to a binned image 69 pmReadout *noiseMap = NULL; 70 noiseMap = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.NOISEMAP"); 71 noiseImage = psImageCopy (NULL, input->image, PS_TYPE_F32); 72 psImageInit (noiseImage, 0.0); 73 74 // XXX this works, but is not really quite right: the model shoud include the 75 // offset information, we are not really getting exactly the right mapping from the 76 // original file. 77 psImageBinning *binning = psImageBinningAlloc(); 78 binning->nXruff = noiseMap->image->numCols; 79 binning->nYruff = noiseMap->image->numRows; 80 binning->nXfine = input->image->numCols; 81 binning->nYfine = input->image->numRows; 82 psImageBinningSetScale(binning, PS_IMAGE_BINNING_LEFT); 83 84 psImageUnbin (noiseImage, noiseMap->image, binning); 85 psFree (binning); 86 } 87 pmReadoutGenerateVariance(input, noiseImage, true); 88 psFree (noiseImage); 67 89 } 68 90 -
branches/eam_branches/20090522/ppImage/src/ppImageDetrendRecord.c
r20773 r24557 67 67 psMetadataAddMetadata(cell->analysis, PS_LIST_TAIL, "DETREND", 0, "Detrend information", detrend); 68 68 69 detrendRecord(options->doMask, detrend, config, view, "PPIMAGE.MASK", "DETREND.MASK", "Mask filename"); 70 detrendRecord(options->doBias, detrend, config, view, "PPIMAGE.BIAS", "DETREND.BIAS", "Bias filename"); 71 detrendRecord(options->doDark, detrend, config, view, "PPIMAGE.DARK", "DETREND.DARK", "Dark filename"); 72 detrendRecord(options->doShutter, detrend, config, view, "PPIMAGE.SHUTTER", "DETREND.SHUTTER", 73 "Shutter correction filename"); 74 detrendRecord(options->doFlat, detrend, config, view, "PPIMAGE.FLAT", "DETREND.FLAT", "Flat filename"); 75 detrendRecord(options->doFringe, detrend, config, view, "PPIMAGE.FRINGE", "DETREND.FRINGE", 76 "Fringe filename"); 69 detrendRecord(options->doMask, detrend, config, view, "PPIMAGE.MASK", "DETREND.MASK", "Mask filename"); 70 detrendRecord(options->doNoiseMap, detrend, config, view, "PPIMAGE.NOISEMAP", "DETREND.NOISEMAP", "Noise Map filename"); 71 detrendRecord(options->doBias, detrend, config, view, "PPIMAGE.BIAS", "DETREND.BIAS", "Bias filename"); 72 detrendRecord(options->doDark, detrend, config, view, "PPIMAGE.DARK", "DETREND.DARK", "Dark filename"); 73 detrendRecord(options->doShutter, detrend, config, view, "PPIMAGE.SHUTTER", "DETREND.SHUTTER", "Shutter correction filename"); 74 detrendRecord(options->doFlat, detrend, config, view, "PPIMAGE.FLAT", "DETREND.FLAT", "Flat filename"); 75 detrendRecord(options->doFringe, detrend, config, view, "PPIMAGE.FRINGE", "DETREND.FRINGE", "Fringe filename"); 77 76 78 77 psFree (detrend); -
branches/eam_branches/20090522/ppImage/src/ppImageOptions.c
r24229 r24557 25 25 options->doNonLin = false; // Non-linearity correction 26 26 options->doOverscan = false; // Overscan subtraction 27 options->doNoiseMap = false; // Apply Read Noise Map 27 28 options->doBias = false; // Bias subtraction 28 29 options->doDark = false; // Dark subtraction … … 217 218 options->doCrosstalkCorrect = psMetadataLookupBool(NULL, recipe, "CROSSTALK.CORRECT"); 218 219 220 options->doNoiseMap = psMetadataLookupBool(NULL, recipe, "NOISEMAP"); 219 221 options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS"); 220 222 options->doDark = psMetadataLookupBool(NULL, recipe, "DARK"); … … 278 280 279 281 // even if not requested explicitly, if any of these are set, build an internal mask and variance: 280 if (options->do Bias || options->doOverscan || options->doDark || options->doShutter || options->doFlat ||282 if (options->doNoiseMap || options->doBias || options->doOverscan || options->doDark || options->doShutter || options->doFlat || 281 283 options->doPhotom) { 282 284 options->doMaskBuild = true; -
branches/eam_branches/20090522/ppImage/src/ppImageParseCamera.c
r23411 r24557 25 25 // otherwise they revert to the config information 26 26 // not all input or output images are used in a given recipe 27 if (options->doNoiseMap) { 28 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.NOISEMAP", "NOISEMAP", 29 PM_FPA_FILE_IMAGE, PM_DETREND_TYPE_NOISEMAP)) { 30 psError(PS_ERR_IO, false, "Can't find a noise map image source"); 31 psFree(options); 32 return NULL; 33 } 34 } 27 35 if (options->doBias) { 28 36 if (!ppImageDefineFile(config, input->fpa, "PPIMAGE.BIAS", "BIAS", … … 48 56 return NULL; 49 57 } 50 51 #if 052 // I think this is now done automatically in the pmFPAfileDefine and pmFPAfileIOChecks -- PAP.53 54 // XXX have ppImageDefineFile return the pmFPAfile?55 pmFPAfile *mask = psMetadataLookupPtr(&status, config->files, "PPIMAGE.MASK");56 psAssert(mask, "Just defined the mask!");57 58 // Need to read the names of bit masks from the mask header and set them in the59 // recipe. If we are loading this from the detrend db, this action will happen60 // when the file is resolved.61 if (!mask->detrend) {62 // XXX need to load the mask bit names from one of the headers63 // this grabs the first available hdu : no guarantee that it will be valid, though64 pmHDU *hdu = pmHDUGetFirst(mask->fpa);65 if (!hdu) {66 psError(PS_ERR_IO, true, "no valid HDU for PPIMAGE.INPUT.MASK");67 return NULL;68 }69 // XXX is this consistent with the pmConfigMaskReadHeader call above?70 if (!pmConfigMaskReadHeader(config, hdu->header)) {71 psError(PS_ERR_IO, false, "error in mask bits");72 return NULL;73 }74 }75 #endif76 58 } 77 59 if (options->doShutter) {
Note:
See TracChangeset
for help on using the changeset viewer.
