Changeset 23594 for branches/cnb_branches/cnb_branch_20090301/ppSub
- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
ppSub (modified) (1 prop)
-
ppSub/src/ppSubArguments.c (modified) (2 diffs)
-
ppSub/src/ppSubCamera.c (modified) (11 diffs)
-
ppSub/src/ppSubDefineOutput.c (modified) (1 diff)
-
ppSub/src/ppSubMatchPSFs.c (modified) (2 diffs)
-
ppSub/src/ppSubSetMasks.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/ppSub
- Property svn:mergeinfo changed
/trunk/ppSub merged: 23356,23369,23399,23402-23403,23448-23449,23505,23535
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubArguments.c
r23352 r23594 260 260 } 261 261 262 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[ 3]);262 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]); 263 263 264 264 … … 282 282 const char *refImage = psMetadataLookupStr(NULL, arguments, "-refimage"); // Name of reference image 283 283 if (refImage && strlen(refImage) > 0) { 284 fileList(" INPUT", refImage, "Name of the reference image", config);284 fileList("REF", refImage, "Name of the reference image", config); 285 285 } 286 286 const char *refMask = psMetadataLookupStr(NULL, arguments, "-refmask"); // Name of reference mask -
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubCamera.c
r23352 r23594 33 33 34 34 // look for the file on the RUN metadata 35 pmFPAfile *file = pmFPAfileDefineFromRun(&status, config, filerule); // File to return35 pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 36 36 if (!status) { 37 37 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule); … … 66 66 static pmFPAfile *defineOutputFile(pmConfig *config, // Configuration 67 67 pmFPAfile *template, // File to use as basis for definition 68 bool source, // Is template a source (T), or for binding (F)? 68 69 char *filerule, // Name of file rule 69 70 pmFPAfileType fileType // Type of file … … 71 72 { 72 73 73 pmFPAfile *file = pmFPAfileDefineFromFile(config, template, 1, 1, filerule); 74 pmFPAfile *file = source ? pmFPAfileDefineFromFile(config, template, 1, 1, filerule) : 75 pmFPAfileDefineOutput(config, template->fpa, filerule); 74 76 if (!file) { 75 77 psError(PS_ERR_IO, false, _("Unable to generate output file from %s"), filerule); … … 96 98 97 99 // look for the file on the RUN metadata 98 pmFPAfile *file = pmFPAfileDefineFromRun(&status, config, filerule); // File to return100 pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 99 101 if (!status) { 100 102 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule); … … 108 110 // define new version of file 109 111 if (!file) { 110 pmFPAfileDefineOutput(config, bind ? bind->fpa : NULL, filerule);112 file = pmFPAfileDefineOutput(config, bind ? bind->fpa : NULL, filerule); 111 113 if (!status) { 112 114 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition for %s", filerule); … … 160 162 161 163 // Output image 162 pmFPAfile *output = defineOutputFile(config, input, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE);163 pmFPAfile *outMask = defineOutputFile(config, output, "PPSUB.OUTPUT.MASK", PM_FPA_FILE_MASK);164 pmFPAfile *output = defineOutputFile(config, input, true, "PPSUB.OUTPUT", PM_FPA_FILE_IMAGE); 165 pmFPAfile *outMask = defineOutputFile(config, output, false, "PPSUB.OUTPUT.MASK", PM_FPA_FILE_MASK); 164 166 if (!output || !outMask) { 165 167 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); … … 170 172 pmFPAfile *outVar = NULL; 171 173 if (inVar && refVar) { 172 outVar = defineOutputFile(config, output, "PPSUB.OUTPUT.VARIANCE", PM_FPA_FILE_VARIANCE);174 outVar = defineOutputFile(config, output, false, "PPSUB.OUTPUT.VARIANCE", PM_FPA_FILE_VARIANCE); 173 175 if (!outVar) { 174 176 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); … … 180 182 181 183 // Convolved input image 182 pmFPAfile *inConvImage = defineOutputFile(config, input, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE); 183 pmFPAfile *inConvMask = defineOutputFile(config, input, "PPSUB.INPUT.CONV.MASK", PM_FPA_FILE_MASK); 184 pmFPAfile *inConvImage = defineOutputFile(config, input, true, "PPSUB.INPUT.CONV", PM_FPA_FILE_IMAGE); 185 pmFPAfile *inConvMask = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.MASK", 186 PM_FPA_FILE_MASK); 184 187 if (!inConvImage || !inConvMask) { 185 188 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); … … 187 190 } 188 191 if (inVar) { 189 pmFPAfile *inConvVar = defineOutputFile(config, in put, "PPSUB.INPUT.CONV.VARIANCE",192 pmFPAfile *inConvVar = defineOutputFile(config, inConvImage, false, "PPSUB.INPUT.CONV.VARIANCE", 190 193 PM_FPA_FILE_VARIANCE); 191 194 if (!inConvVar) { … … 196 199 197 200 // Convolved ref image 198 pmFPAfile *refConvImage = defineOutputFile(config, input, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE); 199 pmFPAfile *refConvMask = defineOutputFile(config, input, "PPSUB.REF.CONV.MASK", PM_FPA_FILE_MASK); 201 pmFPAfile *refConvImage = defineOutputFile(config, input, true, "PPSUB.REF.CONV", PM_FPA_FILE_IMAGE); 202 pmFPAfile *refConvMask = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.MASK", 203 PM_FPA_FILE_MASK); 200 204 if (!refConvImage || !refConvMask) { 201 205 psError(PS_ERR_UNKNOWN, false, "Unable to define output files"); … … 203 207 } 204 208 if (refVar) { 205 pmFPAfile *refConvVar = defineOutputFile(config, input, "PPSUB.REF.CONV.VARIANCE",209 pmFPAfile *refConvVar = defineOutputFile(config, refConvImage, false, "PPSUB.REF.CONV.VARIANCE", 206 210 PM_FPA_FILE_VARIANCE); 207 211 if (!refConvVar) { -
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubDefineOutput.c
r21524 r23594 26 26 psAssert(view, "Require view"); 27 27 28 // generate an output readout29 28 pmCell *outCell = pmFPAfileThisCell(config->files, view, "PPSUB.OUTPUT"); // Output cell 30 pmReadout *outRO = pmReadoutAlloc(outCell); // Output readout: subtraction31 29 pmFPA *outFPA = outCell->parent->parent; // Output FPA 32 30 pmHDU *outHDU = outFPA->hdu; // Output HDU 33 31 if (!outHDU->header) { 34 32 outHDU->header = psMetadataAlloc(); 33 } 34 35 // generate an output readout (first check if it's already there by virtue of kernels) 36 pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel 37 if (!outRO) { 38 outRO = pmReadoutAlloc(outCell); // Output readout: subtraction 35 39 } 36 40 -
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubMatchPSFs.c
r23352 r23594 50 50 51 51 // Load pre-calculated kernel, if available 52 pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNEL "); // RO with kernel52 pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel 53 53 54 54 // Sources in image, used for stamps: these must be loaded from previous analysis stages … … 123 123 float optThresh = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.TOL"); // Tolerance for search 124 124 125 // XXX Do we need/want to define different values for BAD and POOR subtraction vs BAD and POOR warp?126 125 psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask in inputs 127 psImageMaskType maskPoor = pmConfigMaskGet(" POOR.WARP", config); // Bits to mask for poor pixels126 psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); // Bits to mask for poor pixels 128 127 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels 129 128 -
branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSubSetMasks.c
r21524 r23594 43 43 psAssert(satValue, "SAT must be non-zero"); 44 44 45 psImageMaskType badValue = pmConfigMaskGet("BAD", config); 46 psAssert(badValue, "BAD must be non-zero"); 45 psImageMaskType lowValue = pmConfigMaskGet("LOW", config); 46 if (!lowValue) { 47 // Look up old name for backward compatability 48 lowValue = pmConfigMaskGet("BAD", config); 49 } 50 psAssert(lowValue, "LOW or BAD must be non-zero"); 47 51 48 52 // input images … … 58 62 if (!inRO->mask) { 59 63 if (psMetadataLookupBool(NULL, recipe, "MASK.GENERATE")) { 60 pmReadoutSetMask(inRO, satValue, badValue);64 pmReadoutSetMask(inRO, satValue, lowValue); 61 65 } else { 62 66 inRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); … … 66 70 if (!refRO->mask) { 67 71 if (psMetadataLookupBool(NULL, recipe, "MASK.GENERATE")) { 68 pmReadoutSetMask(refRO, satValue, badValue);72 pmReadoutSetMask(refRO, satValue, lowValue); 69 73 } else { 70 74 refRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_IMAGE_MASK); … … 95 99 float poorFrac = psMetadataLookupF32(&mdok, recipe, "POOR.FRACTION"); // Fraction for "poor" 96 100 97 psImageMaskType maskPoor = pmConfigMaskGet(" POOR.WARP", config); // Bits to mask for poor pixels101 psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); // Bits to mask for poor pixels 98 102 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask for bad pixels 99 103
Note:
See TracChangeset
for help on using the changeset viewer.
