Changeset 21225
- Timestamp:
- Jan 29, 2009, 3:01:24 PM (17 years ago)
- Location:
- branches/pap_branch_20090128/pswarp/src
- Files:
-
- 6 edited
-
pswarpArguments.c (modified) (1 diff)
-
pswarpDefineSkycell.c (modified) (1 diff)
-
pswarpParseCamera.c (modified) (2 diffs)
-
pswarpSetMaskBits.c (modified) (2 diffs)
-
pswarpTransformReadout.c (modified) (1 diff)
-
pswarpTransformTile.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/pswarp/src/pswarpArguments.c
r20347 r21225 80 80 } 81 81 82 // the mask and weightentries are optional (build from gain?)82 // the mask and variance entries are optional (build from gain?) 83 83 pmConfigFileSetsMD (config->arguments, &argc, argv, "MASK", "-mask", "-masklist"); 84 pmConfigFileSetsMD (config->arguments, &argc, argv, " WEIGHT", "-weight", "-weightlist");84 pmConfigFileSetsMD (config->arguments, &argc, argv, "VARIANCE", "-variance", "-variancelist"); 85 85 86 86 if (argc != 3) { -
branches/pap_branch_20090128/pswarp/src/pswarpDefineSkycell.c
r20643 r21225 63 63 // determine camera if not specified already 64 64 // XXX EAM : this operation should be defined as a pmConfig function (pmConfigCopy?) 65 skyConfig = pmConfigAlloc( 0, NULL);65 skyConfig = pmConfigAlloc(); 66 66 skyConfig->user = psMemIncrRefCounter(config->user); 67 67 skyConfig->system = psMemIncrRefCounter(config->system); -
branches/pap_branch_20090128/pswarp/src/pswarpParseCamera.c
r20331 r21225 45 45 } 46 46 47 pmFPAfile *in Weight = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.WEIGHT", "WEIGHT");47 pmFPAfile *inVariance = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.VARIANCE", "VARIANCE"); 48 48 if (!status) { 49 49 psError (PS_ERR_UNKNOWN, false, "failed to load find definition"); 50 50 return NULL; 51 51 } 52 if (!in Weight) {53 psLogMsg ("pswarp", 3, "no weightsupplied\n");52 if (!inVariance) { 53 psLogMsg ("pswarp", 3, "no variance supplied\n"); 54 54 } 55 55 … … 78 78 outMask->save = true; 79 79 80 if (in Weight) {81 pmFPAfile *out Weight = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.WEIGHT");82 if (!out Weight) {83 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT. WEIGHT");80 if (inVariance) { 81 pmFPAfile *outVariance = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.VARIANCE"); 82 if (!outVariance) { 83 psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.VARIANCE"); 84 84 return false; 85 85 } 86 out Weight->save = true;86 outVariance->save = true; 87 87 } 88 88 -
branches/pap_branch_20090128/pswarp/src/pswarpSetMaskBits.c
r18558 r21225 8 8 // updated in the config metadata. 9 9 10 bool pswarpSetMaskBits (pmConfig *config) {11 12 ps MaskType maskIn = 0x00;// mask for the input image13 ps MaskType markIn = 0x00;// mark for the input image14 ps MaskType maskOut = 0x00;// mask for the output image15 ps MaskType markOut = 0x00;// mark for the output image10 bool pswarpSetMaskBits (pmConfig *config) 11 { 12 psImageMaskType maskIn = 0x00; // mask for the input image 13 psImageMaskType markIn = 0x00; // mark for the input image 14 psImageMaskType maskOut = 0x00; // mask for the output image 15 psImageMaskType markOut = 0x00; // mark for the output image 16 16 17 17 // this function sets the required single-image mask bits 18 18 if (!pmConfigMaskSetBits (&maskIn, &markIn, config)) { 19 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values");20 return false;19 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); 20 return false; 21 21 } 22 22 23 23 // mask for non-linear flat regions (default to DETECTOR if not defined) 24 psMaskType badMask = pmConfigMaskGet("BAD.WARP", config); 24 psMaskType badMask = pmConfigMaskGet("BAD.WARP", config); 25 25 if (!badMask) { 26 badMask = 0x01;27 pmConfigMaskSet (config, "BAD.WARP", badMask);26 badMask = 0x01; 27 pmConfigMaskSet (config, "BAD.WARP", badMask); 28 28 } 29 29 maskOut |= badMask; 30 30 31 31 // mask for non-linear flat regions (default to DETECTOR if not defined) 32 psMaskType poorMask = pmConfigMaskGet("POOR.WARP", config); 32 psMaskType poorMask = pmConfigMaskGet("POOR.WARP", config); 33 33 if (!poorMask) { 34 poorMask = 0x02;35 pmConfigMaskSet (config, "POOR.WARP", poorMask);34 poorMask = 0x02; 35 pmConfigMaskSet (config, "POOR.WARP", poorMask); 36 36 } 37 37 maskOut |= poorMask; … … 42 42 int nBits = sizeof(psMaskType) * 8; 43 43 for (int i = 0; !markOut && (i < nBits); i++) { 44 if (maskOut & markOut) {45 markOut >>= 1;46 } else {47 markOut = markOut;48 }44 if (maskOut & markOut) { 45 markOut >>= 1; 46 } else { 47 markOut = markOut; 48 } 49 49 } 50 50 51 51 if (!markOut) { 52 psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!");53 return false;52 psError (PS_ERR_UNKNOWN, true, "Unable to define the MARK bit mask: all bits taken!"); 53 return false; 54 54 } 55 55 -
branches/pap_branch_20090128/pswarp/src/pswarpTransformReadout.c
r20334 r21225 71 71 // Interpolation options : move these from the arguments to explicit assignments 72 72 psImageInterpolation *interp = psImageInterpolationAlloc(interpolationMode, input->image, 73 input-> weight, input->mask, maskIn,73 input->variance, input->mask, maskIn, 74 74 NAN, NAN, maskBad, maskPoor, poorFrac, 75 75 numKernels); 76 76 77 if (input-> weight && !output->weight) {78 output-> weight= psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_F32);79 psImageInit(output-> weight, NAN);77 if (input->variance && !output->variance) { 78 output->variance = psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_F32); 79 psImageInit(output->variance, NAN); 80 80 } 81 81 if ((input->mask || maskPoor || maskBad) && !output->mask) { -
branches/pap_branch_20090128/pswarp/src/pswarpTransformTile.c
r19395 r21225 48 48 // Dereference images for convenience 49 49 psF32 **outImageData = args->output->image->data.F32; 50 psF32 **outVarData = (args->output-> weight) ? args->output->weight->data.F32 : NULL;50 psF32 **outVarData = (args->output->variance) ? args->output->variance->data.F32 : NULL; 51 51 psMaskType **outMaskData = (args->output->mask) ? args->output->mask->data.PS_TYPE_MASK_DATA : NULL; 52 52 psMaskType **inMaskData = (args->input->mask) ? args->input->mask->data.PS_TYPE_MASK_DATA : NULL; … … 82 82 // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates 83 83 double imageValue, varValue; // Value of image and variance map 84 ps MaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask84 psImageMaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask 85 85 if (!psImageInterpolate(&imageValue, &varValue, &maskValue, xIn, yIn, args->interp)) { 86 86 psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
Note:
See TracChangeset
for help on using the changeset viewer.
