Changeset 24244 for branches/cnb_branches/cnb_branch_20090301/ppImage/src
- Timestamp:
- May 26, 2009, 1:59:32 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 17 edited
- 4 copied
-
. (modified) (1 prop)
-
ppImage (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppImage/src/Makefile.am (modified) (2 diffs)
-
ppImage/src/ppImage.h (modified) (8 diffs)
-
ppImage/src/ppImageAstrom.c (modified) (2 diffs)
-
ppImage/src/ppImageCheckCTE.c (modified) (2 diffs)
-
ppImage/src/ppImageCorrectCrosstalk.c (copied) (copied from trunk/ppImage/src/ppImageCorrectCrosstalk.c )
-
ppImage/src/ppImageDetrendReadout.c (modified) (9 diffs)
-
ppImage/src/ppImageErrorCodes.dat (modified) (1 diff)
-
ppImage/src/ppImageErrorCodes.h.in (modified) (1 diff)
-
ppImage/src/ppImageLoop.c (modified) (6 diffs)
-
ppImage/src/ppImageMeasureCrosstalk.c (copied) (copied from trunk/ppImage/src/ppImageMeasureCrosstalk.c )
-
ppImage/src/ppImageOptions.c (modified) (5 diffs)
-
ppImage/src/ppImageParityFlip.c (copied) (copied from trunk/ppImage/src/ppImageParityFlip.c )
-
ppImage/src/ppImagePhotom.c (modified) (3 diffs)
-
ppImage/src/ppImageReplaceBackground.c (modified) (2 diffs)
-
ppImage/src/ppImageSetMaskBits.c (modified) (2 diffs)
-
ppImage/src/ppImageStatsOutput.c (modified) (1 diff)
-
ppImage/src/ppImageVersion.c (modified) (3 diffs)
-
ppImage/src/ppImageVersionDefinitions.h.in (copied) (copied from trunk/ppImage/src/ppImageVersionDefinitions.h.in )
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/Makefile.am
r23352 r24244 4 4 ppImage.h 5 5 6 #PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 7 #PPIMAGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 8 #PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 if HAVE_SVNVERSION 7 PPIMAGE_VERSION=`$(SVNVERSION) ..` 8 else 9 PPIMAGE_VERSION="UNKNOWN" 10 endif 11 12 if HAVE_SVN 13 PPIMAGE_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'` 14 PPIMAGE_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'` 15 else 16 PPIMAGE_BRANCH="UNKNOWN" 17 PPIMAGE_SOURCE="UNKNOWN" 18 endif 9 19 10 20 # Force recompilation of ppImageVersion.c, since it gets the version information 11 # ppImageVersion.c: FORCE 12 # touch ppImageVersion.c 13 # FORCE: ; 21 ppImageVersion.c: ppImageVersionDefinitions.h 22 ppImageVersionDefinitions.h: ppImageVersionDefinitions.h.in FORCE 23 -$(RM) ppImageVersionDefinitions.h 24 $(SED) -e "s|@PPIMAGE_VERSION@|\"$(PPIMAGE_VERSION)\"|" -e "s|@PPIMAGE_BRANCH@|\"$(PPIMAGE_BRANCH)\"|" -e "s|@PPIMAGE_SOURCE@|\"$(PPIMAGE_SOURCE)\"|" ppImageVersionDefinitions.h.in > ppImageVersionDefinitions.h 25 FORCE: ; 14 26 15 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION=$(SVN_VERSION) -DPPIMAGE_BRANCH=$(SVN_BRANCH) -DPPIMAGE_SOURCE=$(SVN_SOURCE) 27 BUILT_SOURCES = ppImageVersionDefinitions.h 28 29 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 16 30 ppImage_LDFLAGS = $(PPIMAGE_LIBS) $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 17 31 ppImage_SOURCES = \ … … 36 50 ppImageMetadataStats.c \ 37 51 ppImageReplaceBackground.c \ 52 ppImageMeasureCrosstalk.c \ 53 ppImageCorrectCrosstalk.c \ 38 54 ppImageDefineFile.c \ 39 55 ppImageSetMaskBits.c \ 56 ppImageParityFlip.c \ 57 ppImageCheckCTE.c \ 40 58 ppImageFileCheck.c \ 41 59 ppImageVersion.c \ -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImage.h
r23352 r24244 26 26 bool doMaskBuild; // Build internal mask 27 27 bool doVarianceBuild; // Build internal variance map 28 bool doMaskSat; // mask saturated pixels 29 bool doMaskLow; // mask low pixels 28 30 bool doMask; // Mask bad pixels 29 31 bool doNonLin; // Non-linearity correction … … 40 42 bool doAstromMosaic; // full-mosaic Astrometry 41 43 bool doStats; // call ppStats on the image 44 bool checkCTE; // measure pixel-based variance 45 bool applyParity; // Apply Cell parities 46 47 bool doCrosstalkMeasure; // measure crosstalk signal 48 bool doCrosstalkCorrect; // apply crosstalk correction 42 49 43 50 // output files requested … … 61 68 psImageMaskType markValue; // apply this bit-mask to choose masked bits 62 69 psImageMaskType satMask; // Mask value to give saturated pixels 63 psImageMaskType badMask; // Mask value to give bad pixels70 psImageMaskType lowMask; // Mask value to give bad pixels 64 71 psImageMaskType flatMask; // Mask value to give bad flat pixels 72 psImageMaskType darkMask; // Mask value to give bad dark pixels 65 73 psImageMaskType blankMask; // Mask value to give blank pixels 66 74 … … 87 95 float remnanceThresh; // Threshold for remnance detection 88 96 89 char *normClass; // class to use for per-class normalization97 char *normClass; // class to use for per-class normalization 90 98 } ppImageOptions; 91 99 … … 111 119 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options); 112 120 121 // apply the cell flips to the input data before analysis 122 bool ppImageParityFlip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view); 123 113 124 // Loop over the input 114 125 bool ppImageLoop(pmConfig *config, ppImageOptions *options); … … 132 143 bool ppImageDetrendFree(pmConfig *config, pmFPAview *view); 133 144 bool ppImageFringeFree(pmConfig *config, pmFPAview *view); 145 146 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view); 134 147 135 148 // Record which detrend file was used for the detrending … … 143 156 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName); 144 157 145 bool ppImagePhotom (pmConfig *config, pmFPAview *view);146 bool ppImageAstrom (pmConfig *config);147 bool ppImageAddstar (pmConfig *config);158 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view); 159 bool ppImageAstrom(pmConfig *config, psMetadata *stats); 160 bool ppImageAddstar(pmConfig *config); 148 161 149 162 // Subtract background from the chip-mosaicked image … … 180 193 181 194 195 // measure the crosstalk signal 196 bool ppImageMeasureCrosstalk(pmConfig *config, ppImageOptions *options, pmFPAview *view); 197 198 // correct the crosstalk signal 199 bool ppImageCorrectCrosstalk(pmConfig *config, ppImageOptions *options, pmFPAview *view); 200 182 201 // Measure fringes 183 202 bool ppImageDetrendFringeMeasure(pmReadout *readout, // Readout to measure -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageAstrom.c
r16084 r24244 7 7 // this function is mostly equivalent to the top-level of psastro, with some 8 8 // modifications since the data has already been loaded. 9 bool ppImageAstrom (pmConfig *config ) {9 bool ppImageAstrom (pmConfig *config, psMetadata *stats) { 10 10 11 11 bool status; … … 27 27 } 28 28 29 if (!psastroAnalysis (config)) {29 if (!psastroAnalysis(config, stats)) { 30 30 psError (PSASTRO_ERR_UNKNOWN, false, "failure in psastro analysis\n"); 31 31 return false; -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageCheckCTE.c
r23594 r24244 60 60 fineRegion = psImageBinningSetFineRegion (binning, ruffRegion); 61 61 fineRegion = psRegionForImage (image, fineRegion); 62 if (fineRegion.x0 >= image->numCols || fineRegion.x1 >= image->numCols || 63 fineRegion.y0 >= image->numRows || fineRegion.y1 >= image->numRows) { 64 continue; 65 } 62 if (fineRegion.x0 >= image->numCols) continue; 63 if (fineRegion.y0 >= image->numRows) continue; 66 64 67 65 psImage *subset = psImageSubset (image, fineRegion); … … 85 83 float normVariance = PS_SQR(stats->robustStdev) / cellMedian; 86 84 // float normVariance = PS_SQR(stats->sampleStdev) / cellMedian; 85 // if (!isfinite(normVariance)) fprintf (stderr, "** normVariance is nan **\n"); 87 86 88 87 // apply resulting value to the input pixels 89 88 for (int jy = fineRegion.y0; jy < fineRegion.y1; jy++) { 89 if (jy < 0) continue; 90 if (jy >= image->numRows) continue; 90 91 for (int jx = fineRegion.x0; jx < fineRegion.x1; jx++) { 92 if (jx < 0) continue; 93 if (jx >= image->numCols) continue; 91 94 image->data.F32[jy][jx] = normVariance; 92 95 } -
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 } -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageErrorCodes.dat
r11259 r24244 1 1 # 2 2 # This file is used to generate ppImageErrorClasses.h 3 # 4 BASE = 500 First value we use; lower values belong to psLib3 4 BASE = 5000 First value we use; lower values belong to psLib 5 5 # these errors correspond to standard exit conditions 6 6 ARGUMENTS Incorrect arguments -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageErrorCodes.h.in
r11259 r24244 9 9 */ 10 10 typedef enum { 11 PPIMAGE_ERR_BASE = 5 12,11 PPIMAGE_ERR_BASE = 5000, 12 12 PPIMAGE_ERR_${ErrorCode}, 13 13 PPIMAGE_ERR_NERROR -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageLoop.c
r23352 r24244 13 13 bool ppImageLoop(pmConfig *config, ppImageOptions *options) 14 14 { 15 psMetadata *stats = options->doStats ? psMetadataAlloc() : NULL;// Statistics to output15 psMetadata *stats = NULL; // Statistics to output 16 16 float timeDetrend = 0; // Amount of time spent in detrend 17 17 float timePhot = 0; // Amount of time spent in photometry 18 19 if (options->doStats) { 20 stats = psMetadataAlloc(); 21 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0); 22 } 18 23 19 24 bool status; // Status of MD lookup … … 46 51 } 47 52 53 // crosstalk measurement needs to be done on the entire chip at once, and before 54 // signal levels are modified by the detrending. If crosstalk measurement is 55 // requested, the read-level for the images is set to CHIP. 56 if (!ppImageMeasureCrosstalk(config, options, view)) { 57 ESCAPE("Unable to perform crosstalk correction"); 58 } 59 60 // crosstalk correction needs to be done on the entire chip at once, and before 61 // signal levels are modified by the detrending. If crosstalk correction is 62 // requested, the read-level for the images is set to CHIP. 63 if (!ppImageCorrectCrosstalk(config, options, view)) { 64 ESCAPE("Unable to perform crosstalk correction"); 65 } 66 48 67 psTimerStart(TIMER_DETREND); 49 68 pmCell *cell; // Cell from chip … … 80 99 } 81 100 101 // perform the detrend analysis 102 if (!ppImageParityFlip(config, options, view)) { 103 ESCAPE("Unable to detrend readout"); 104 } 105 106 // XXX TEST: 107 // psphotSaveImage (NULL, readout->image, "test.image.fits"); 108 82 109 // XXX set the options->*Mask values here (after the mask images have been loaded 83 110 // and before any of the value are used) … … 134 161 psTimerStart(TIMER_PHOT); 135 162 if (options->doPhotom) { 136 if (!ppImagePhotom( config, view)) {163 if (!ppImagePhotom(stats, config, view)) { 137 164 ESCAPE("error running photometry."); 138 165 } … … 195 222 // this also performs the psastro file IO 196 223 if (options->doAstromChip || options->doAstromMosaic) { 197 if (!ppImageAstrom(config )) {224 if (!ppImageAstrom(config, stats)) { 198 225 ESCAPE("error running astrometry."); 199 226 } … … 218 245 psString dump_file = psMetadataLookupStr(&status, config->arguments, "DUMP_CONFIG"); 219 246 if (dump_file) { 220 pmConfigDump(config, input->fpa,dump_file);247 pmConfigDump(config, dump_file); 221 248 } 222 249 -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageOptions.c
r23352 r24244 19 19 // actions which ppImage should perform 20 20 options->doMaskBuild = false; // Build internal mask 21 options->doVarianceBuild = false; // Build internal variance 21 options->doMaskSat = false; // mask saturated pixels 22 options->doMaskLow = false; // mask low pixels 23 options->doVarianceBuild = false; // Build internal variance 22 24 options->doMask = false; // Mask bad pixels 23 25 options->doNonLin = false; // Non-linearity correction … … 33 35 options->doAstromMosaic = false; // Astrometry (full-mosaic) 34 36 options->doStats = false; // Measure and save image statistics 37 options->applyParity = false; // Apply Cell parities 35 38 36 39 // output files requested … … 53 56 options->maskValue = 0x00; // Default mask value (used to skip / ignore pixels) 54 57 options->satMask = 0x00; // Saturated pixels (supplied to pmReadoutGenerateMask) 55 options-> badMask = 0x00; // Bad(low) pixels (supplied to pmReadoutGenerateMask)58 options->lowMask = 0x00; // out-of-bounds (low) pixels (supplied to pmReadoutGenerateMask) 56 59 options->flatMask = 0x00; // Bad flat pixels (supplied to pmFlatField) 60 options->darkMask = 0x00; // Bad dark pixels (supplied to pmDarkApply) 57 61 options->blankMask = 0x00; // Blank (no data, cell gap) pixels (supplied to pmChipMosaic, pmFPAMosaic) 58 62 options->markValue = 0x00; // A safe bit for internal marking 63 64 // crosstalk options 65 options->doCrosstalkMeasure = false; // measure crosstalk 66 options->doCrosstalkCorrect = false; // correct crosstalk 59 67 60 68 // Non-linearity default options … … 197 205 // for these images, even if not required otherwise 198 206 options->doMaskBuild = psMetadataLookupBool(NULL, recipe, "MASK.BUILD"); 207 options->doMaskSat = psMetadataLookupBool(NULL, recipe, "MASK.SATURATED"); 208 options->doMaskLow = psMetadataLookupBool(NULL, recipe, "MASK.LOW"); 199 209 options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD"); 200 210 201 211 // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c) 202 212 options->doMask = psMetadataLookupBool(NULL, recipe, "MASK"); 213 214 // Mask recipe options (note that mask bit values are set in ppImageSetMaskBits.c) 215 options->doCrosstalkMeasure = psMetadataLookupBool(NULL, recipe, "CROSSTALK.MEASURE"); 216 options->doCrosstalkCorrect = psMetadataLookupBool(NULL, recipe, "CROSSTALK.CORRECT"); 203 217 204 218 options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS"); … … 214 228 options->doStats = true; 215 229 } 230 231 options->applyParity = psMetadataLookupBool(NULL, recipe, "APPLY.CELL.PARITY"); 216 232 217 233 // binned image options -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImagePhotom.c
r20410 r24244 6 6 7 7 // In this function, we perform the psphot analysis routine for the chip-mosaicked images 8 bool ppImagePhotom (pmConfig *config, pmFPAview *view) {8 bool ppImagePhotom(psMetadata *stats, pmConfig *config, pmFPAview *view) { 9 9 10 10 bool status; … … 12 12 pmReadout *readout; 13 13 14 psphotInit ();14 psphotInit(); 15 15 16 16 // find or define a pmFPAfile PSPHOT.INPUT … … 37 37 // run the actual photometry analysis 38 38 if (!psphotReadout (config, view)) { 39 psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout); 40 return false; 39 // This is likely a data quality issue 40 // XXX Split into multiple cases using error codes? 41 psErrorStackPrint(stderr, "Unable to perform photometry on image"); 42 psWarning("Unable to perform photometry on image --- suspect bad data quality."); 43 if (stats && psMetadataLookupS32(NULL, stats, "QUALITY") == 0) { 44 psMetadataAddS32(stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE, 45 "Unable to perform photometry on image", psErrorCodeLast()); 46 } 47 psErrorClear(); 48 psphotFilesActivate(config, false); 41 49 } 42 50 43 // we want to save the MASK as modified by psphot, but not the data or weight44 // free the old mask and replace with a memory copy of the new mask45 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src);46 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa);47 psFree (oldReadout->mask);48 oldReadout->mask = psMemIncrRefCounter(newReadout->mask);51 // we want to save the MASK as modified by psphot, but not the data or weight 52 // free the old mask and replace with a memory copy of the new mask 53 pmReadout *oldReadout = pmFPAviewThisReadout(view, input->src); 54 pmReadout *newReadout = pmFPAviewThisReadout(view, input->fpa); 55 psFree (oldReadout->mask); 56 oldReadout->mask = psMemIncrRefCounter(newReadout->mask); 49 57 } 50 58 } -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageReplaceBackground.c
r23352 r24244 147 147 if (!isfinite(value)) { 148 148 image->data.F32[y][x] = NAN; 149 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options-> badMask;149 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 150 150 } else { 151 151 image->data.F32[y][x] -= value; … … 164 164 if (!isfinite(value)) { 165 165 image->data.F32[y][x] = NAN; 166 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options-> badMask;166 mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] |= options->lowMask; 167 167 } else { 168 168 image->data.F32[y][x] -= value; -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageSetMaskBits.c
r21364 r24244 14 14 // at this point we know we have valid values for required entries SAT, BAD, FLAT, BLANK: 15 15 16 // mask for non-linearflat corrections16 // mask for bad flat corrections 17 17 options->flatMask = pmConfigMaskGet("FLAT", config); 18 18 psAssert (options->flatMask, "flat mask not set"); 19 20 // mask for bad dark corrections 21 options->darkMask = pmConfigMaskGet("DARK", config); 22 psAssert (options->darkMask, "dark mask not set"); 19 23 20 24 // mask for non-existent data (default to DETECTOR if not defined) … … 27 31 28 32 // mask for below-range data (default to RANGE if not defined) 29 options->badMask = pmConfigMaskGet("BAD", config); 30 psAssert (options->badMask, "bad mask not set"); 33 options->lowMask = pmConfigMaskGet("LOW", config); 34 if (!options->lowMask) { 35 // look up old name for backward compatability 36 options->lowMask = pmConfigMaskGet("BAD", config); 37 } 38 psAssert (options->lowMask, "low mask not set"); 31 39 32 40 // save MASK and MARK on the PSPHOT recipe -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageStatsOutput.c
r19928 r24244 31 31 psFree(resolved); 32 32 33 pmConfigRunFilenameAddWrite(config, "STATS", statsName); 34 33 35 return true; 34 36 } -
branches/cnb_branches/cnb_branch_20090301/ppImage/src/ppImageVersion.c
r23352 r24244 4 4 5 5 #include "ppImage.h" 6 #include "ppImageVersionDefinitions.h" 6 7 7 8 #ifndef PPIMAGE_VERSION … … 15 16 #endif 16 17 17 #define xstr(s) str(s)18 #define str(s) #s19 20 18 psString ppImageVersion(void) 21 19 { 22 20 char *value = NULL; 23 psStringAppend(&value, "%s@%s", xstr(PPIMAGE_BRANCH), xstr(PPIMAGE_VERSION));21 psStringAppend(&value, "%s@%s", PPIMAGE_BRANCH, PPIMAGE_VERSION); 24 22 return value; 25 23 } … … 27 25 psString ppImageSource(void) 28 26 { 29 return psStringCopy (xstr(PPIMAGE_SOURCE));27 return psStringCopy(PPIMAGE_SOURCE); 30 28 } 31 29
Note:
See TracChangeset
for help on using the changeset viewer.
