IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21225


Ignore:
Timestamp:
Jan 29, 2009, 3:01:24 PM (17 years ago)
Author:
Paul Price
Message:

Convering 'weight' to 'variance' where appropriate. Mostly just propagating changes from psModules. Fixed some mask types as well.

Location:
branches/pap_branch_20090128/pswarp/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/pswarp/src/pswarpArguments.c

    r20347 r21225  
    8080    }
    8181
    82     // the mask and weight entries are optional (build from gain?)
     82    // the mask and variance entries are optional (build from gain?)
    8383    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");
    8585
    8686    if (argc != 3) {
  • branches/pap_branch_20090128/pswarp/src/pswarpDefineSkycell.c

    r20643 r21225  
    6363    // determine camera if not specified already
    6464    // XXX EAM : this operation should be defined as a pmConfig function (pmConfigCopy?)
    65     skyConfig = pmConfigAlloc(0, NULL);
     65    skyConfig = pmConfigAlloc();
    6666    skyConfig->user = psMemIncrRefCounter(config->user);
    6767    skyConfig->system = psMemIncrRefCounter(config->system);
  • branches/pap_branch_20090128/pswarp/src/pswarpParseCamera.c

    r20331 r21225  
    4545    }
    4646
    47     pmFPAfile *inWeight = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.WEIGHT", "WEIGHT");
     47    pmFPAfile *inVariance = pmFPAfileBindFromArgs(&status, input, config, "PSWARP.VARIANCE", "VARIANCE");
    4848    if (!status) {
    4949        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
    5050        return NULL;
    5151    }
    52     if (!inWeight) {
    53         psLogMsg ("pswarp", 3, "no weight supplied\n");
     52    if (!inVariance) {
     53        psLogMsg ("pswarp", 3, "no variance supplied\n");
    5454    }
    5555
     
    7878    outMask->save = true;
    7979
    80     if (inWeight) {
    81         pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, "PSWARP.OUTPUT.WEIGHT");
    82         if (!outWeight) {
    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");
    8484            return false;
    8585        }
    86         outWeight->save = true;
     86        outVariance->save = true;
    8787    }
    8888
  • branches/pap_branch_20090128/pswarp/src/pswarpSetMaskBits.c

    r18558 r21225  
    88// updated in the config metadata.
    99
    10 bool pswarpSetMaskBits (pmConfig *config) {
    11 
    12     psMaskType maskIn = 0x00;                   // mask for the input image
    13     psMaskType markIn = 0x00;                   // mark for the input image
    14     psMaskType maskOut = 0x00;                  // mask for the output image
    15     psMaskType markOut = 0x00;                  // mark for the output image
     10bool 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
    1616
    1717    // this function sets the required single-image mask bits
    1818    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;
    2121    }
    2222
    2323    // 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);
    2525    if (!badMask) {
    26         badMask = 0x01;
    27         pmConfigMaskSet (config, "BAD.WARP", badMask);
     26        badMask = 0x01;
     27        pmConfigMaskSet (config, "BAD.WARP", badMask);
    2828    }
    2929    maskOut |= badMask;
    3030
    3131    // 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);
    3333    if (!poorMask) {
    34         poorMask = 0x02;
    35         pmConfigMaskSet (config, "POOR.WARP", poorMask);
     34        poorMask = 0x02;
     35        pmConfigMaskSet (config, "POOR.WARP", poorMask);
    3636    }
    3737    maskOut |= poorMask;
     
    4242    int nBits = sizeof(psMaskType) * 8;
    4343    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        }
    4949    }
    5050
    5151    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;
    5454    }
    5555
  • branches/pap_branch_20090128/pswarp/src/pswarpTransformReadout.c

    r20334 r21225  
    7171    // Interpolation options : move these from the arguments to explicit assignments
    7272    psImageInterpolation *interp = psImageInterpolationAlloc(interpolationMode, input->image,
    73                                                              input->weight, input->mask, maskIn,
     73                                                             input->variance, input->mask, maskIn,
    7474                                                             NAN, NAN, maskBad, maskPoor, poorFrac,
    7575                                                             numKernels);
    7676
    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);
    8080    }
    8181    if ((input->mask || maskPoor || maskBad) && !output->mask) {
  • branches/pap_branch_20090128/pswarp/src/pswarpTransformTile.c

    r19395 r21225  
    4848    // Dereference images for convenience
    4949    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;
    5151    psMaskType **outMaskData = (args->output->mask)   ? args->output->mask->data.PS_TYPE_MASK_DATA : NULL;
    5252    psMaskType **inMaskData  = (args->input->mask)    ? args->input->mask->data.PS_TYPE_MASK_DATA : NULL;
     
    8282            // psImagePixelInterpolate determines the value at pixel coordinate (x,y) in child coordinates
    8383            double imageValue, varValue; // Value of image and variance map
    84             psMaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask
     84            psImageMaskType maskValue = inMaskData ? inMaskData[(int)yIn][(int)xIn] : 0; // Value of mask
    8585            if (!psImageInterpolate(&imageValue, &varValue, &maskValue, xIn, yIn, args->interp)) {
    8686                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
Note: See TracChangeset for help on using the changeset viewer.