IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13662


Ignore:
Timestamp:
Jun 5, 2007, 3:49:47 PM (19 years ago)
Author:
Paul Price
Message:

If we rejected on the last iteration, we need to get a new solution.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubReadout.c

    r13593 r13662  
    4242    psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.
    4343
    44     psMaskType maskSat = pmConfigMask("SAT", config); // Mask for saturated pixels
    45     psMaskType maskLow = pmConfigMask("BAD", config); // Mask for bad (low) pixels
    46 
    47     if (!inRO->mask && !pmReadoutGenerateMask(inRO, maskSat, maskLow)) {
    48         psError(PS_ERR_UNKNOWN, false, "Unable to generate mask for input image");
    49         return false;
     44    int numCols = input->numCols, numRows = input->numRows; // Image dimensions
     45    if (!inRO->mask) {
     46        inRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     47        psImageInit(inRO->mask, 0);
    5048    }
    51     if (!inRO->weight && !pmReadoutGenerateWeight(inRO, true)) {
    52         psError(PS_ERR_UNKNOWN, false, "Unable to generate weight map for input image");
    53         return false;
    54     }
    55     if (!refRO->mask && !pmReadoutGenerateMask(refRO, maskSat, maskLow)) {
    56         psError(PS_ERR_UNKNOWN, false, "Unable to generate mask for reference image");
    57         return false;
    58     }
    59     if (!refRO->weight && !pmReadoutGenerateWeight(refRO, true)) {
    60         psError(PS_ERR_UNKNOWN, false, "Unable to generate weight map for reference image");
    61         return false;
     49    if (!refRO->mask) {
     50        refRO->mask = psImageAlloc(numCols, numRows, PS_TYPE_MASK);
     51        psImageInit(inRO->mask, 0);
    6252    }
    6353
    6454    // Worried about the masks for bad pixels and bad stamps colliding, so make our own mask
    65     int numCols = input->numCols, numRows = input->numRows; // Image dimensions
    6655    psImage *stampMask = psImageAlloc(numCols, numRows, PS_TYPE_MASK); // Mask to use for stamps
    6756    for (int y = 0; y < numRows; y++) {
     
    123112    }
    124113    psFree(stampMask);
     114
     115    if (numRejected > 0) {
     116        solution = pmSubtractionSolveEquation(solution, stamps);
     117        if (!solution) {
     118            psError(PS_ERR_UNKNOWN, false, "Unable to calculate least-squares equation.");
     119            goto ERROR;
     120        }
     121    }
    125122
    126123    psImage *convImage = NULL, *convWeight = NULL, *convMask = NULL; // Convolved images
Note: See TracChangeset for help on using the changeset viewer.