- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
ppImage (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppImage/src/ppImageDetrendReadout.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ppImage
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ppImage/src
- Property svn:ignore
-
old new 9 9 stamp-h1 10 10 .libs 11 ppImageVersionDefinitions.h
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageDetrendReadout.c
r23352 r24244 17 17 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. 18 18 if (options->doMaskBuild) { 19 pmReadoutGenerateMask(input, options->satMask, options->badMask); 19 psImageMaskType satMask = options->doMaskSat ? options->satMask : 0; 20 psImageMaskType lowMask = options->doMaskLow ? options->lowMask : 0; 21 pmReadoutGenerateMask(input, satMask, lowMask); 20 22 } 21 23 // apply the externally supplied mask to the input->mask pixels … … 54 56 if (!pmBiasSubtract(input, options->overscan, bias, oldDark, view)) { 55 57 psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias."); 56 psFree(detview);58 psFree(detview); 57 59 return false; 58 60 } … … 66 68 67 69 if (options->doDark && dark) { 68 if (!pmDarkApply(input, dark, options-> maskValue)) {70 if (!pmDarkApply(input, dark, options->darkMask)) { 69 71 psError(PS_ERR_UNKNOWN, false, "Unable to subtract dark."); 70 psFree(detview);72 psFree(detview); 71 73 return false; 72 74 } … … 74 76 75 77 if (options->doRemnance) { 76 if (!pmRemnance(input, options->maskValue, options-> badMask,78 if (!pmRemnance(input, options->maskValue, options->lowMask, 77 79 options->remnanceSize, options->remnanceThresh)) { 78 80 psError(PS_ERR_UNKNOWN, false, "Unable to mask remnance."); 79 psFree(detview);81 psFree(detview); 80 82 return false; 81 83 } … … 86 88 pmReadout *shutter = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.SHUTTER"); 87 89 if (!pmShutterCorrectionApply(input, shutter, pmConfigMaskGet("FLAT", config))) { 88 psFree(detview);90 psFree(detview); 89 91 return false; 90 92 } … … 95 97 pmReadout *flat = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.FLAT"); 96 98 if (!pmFlatField(input, flat, options->flatMask)) { 97 psFree(detview);99 psFree(detview); 98 100 return false; 99 101 } … … 117 119 psMetadata *normlist = psMetadataLookupMetadata(&mdok, config->arguments, "NORMALIZATION.TABLE"); 118 120 if (normlist) { 119 pmFPAfile *inputFile = psMetadataLookupPtr(&mdok, config->files, "PPIMAGE.INPUT");121 pmFPAfile *inputFile = psMetadataLookupPtr(&mdok, config->files, "PPIMAGE.INPUT"); 120 122 121 // get the menu of class IDs122 psMetadata *menu = psMetadataLookupMetadata(&mdok, inputFile->camera, "CLASSID"); 123 // get the menu of class IDs 124 psMetadata *menu = psMetadataLookupMetadata(&mdok, inputFile->camera, "CLASSID"); 123 125 if (!menu) { 124 126 psError(PS_ERR_IO, false, "Unable to find CLASSID metadata in camera configuration"); 125 psFree(detview);127 psFree(detview); 126 128 return false; 127 129 } 128 // get the rule for class_id for the desired class129 const char *rule = psMetadataLookupStr(&mdok, menu, options->normClass); 130 // get the rule for class_id for the desired class 131 const char *rule = psMetadataLookupStr(&mdok, menu, options->normClass); 130 132 if (!rule) { 131 133 psError(PS_ERR_IO, false, "Unable to find NORM.CLASS value %s in CLASSID in camera configuration", options->normClass); 132 psFree(detview);134 psFree(detview); 133 135 return false; 134 136 } 135 // get the class_id from the rule137 // get the class_id from the rule 136 138 char *classID = pmFPAfileNameFromRule(rule, inputFile, view); 137 139 if (!classID) { 138 140 psError(PS_ERR_IO, false, "error converting CLASSID rule %s to name\n", rule); 139 psFree(detview);141 psFree(detview); 140 142 return false; 141 143 } 142 144 143 // get normalization from the class_id 144 float norm = psMetadataLookupF32 (&mdok, normlist, classID); 145 // get normalization from the class_id 146 float norm = psMetadataLookupF32 (&mdok, normlist, classID); 147 if (!mdok) { 148 psError(PS_ERR_IO, false, "failed to find class ID %s in normalization table\n", classID); 149 psFree(detview); 150 return false; 151 } 145 152 146 153 pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest … … 150 157 psFree(comment); 151 158 152 // apply the normalization159 // apply the normalization 153 160 psBinaryOp(input->image, input->image, "*", psScalarAlloc(norm, PS_TYPE_F32)); 154 161 155 psFree (classID);162 psFree (classID); 156 163 } 157 164 # endif … … 160 167 pmCell *fringe = pmFPAfileThisCell(config->files, detview, "PPIMAGE.FRINGE"); 161 168 if (!ppImageDetrendFringeMeasure(input, fringe, false, options)) { 162 psFree(detview);169 psFree(detview); 163 170 return false; 164 171 }
Note:
See TracChangeset
for help on using the changeset viewer.
