Changeset 24485
- Timestamp:
- Jun 18, 2009, 10:42:06 AM (17 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 7 edited
-
ppImage.h (modified) (1 diff)
-
ppImageArguments.c (modified) (2 diffs)
-
ppImageDetrendFree.c (modified) (1 diff)
-
ppImageDetrendReadout.c (modified) (1 diff)
-
ppImageDetrendRecord.c (modified) (1 diff)
-
ppImageOptions.c (modified) (3 diffs)
-
ppImageParseCamera.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImage.h
r24229 r24485 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 -
trunk/ppImage/src/ppImageArguments.c
r23268 r24485 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"); -
trunk/ppImage/src/ppImageDetrendFree.c
r20774 r24485 8 8 static char *detrendTypes[] = { 9 9 "PPIMAGE.MASK", 10 "PPIMAGE.NOISEMAP", 10 11 "PPIMAGE.BIAS", 11 12 "PPIMAGE.DARK", -
trunk/ppImage/src/ppImageDetrendReadout.c
r24079 r24485 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 -
trunk/ppImage/src/ppImageDetrendRecord.c
r20773 r24485 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); -
trunk/ppImage/src/ppImageOptions.c
r24229 r24485 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; -
trunk/ppImage/src/ppImageParseCamera.c
r23411 r24485 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_BIAS /* 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.
