IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20148


Ignore:
Timestamp:
Oct 14, 2008, 12:15:10 PM (18 years ago)
Author:
bills
Message:

make stamps of weight and mask images if requested

Location:
trunk/pstamp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/src/ppstampMakeStamp.c

    r18981 r20148  
    282282    pmFPAview *srcView = pmFPAviewAlloc(0);
    283283    if (psArrayLength(inChip->cells) > 1) {
    284         // we extract our postage stamp from a mosaic so that
    285         // we don't have to manage extracting from multiple cells
     284        // we extract our postage stamp from a mosaic
    286285        pmFPAfile *mosaic = ppstampBuildMosaic(config, input, view);
    287286        if (mosaic == NULL) {
     
    327326            status = false;
    328327            break;
     328        }
     329        if (readout->mask) {
     330            outReadout->mask = extractStamp(readout->mask, extractRegion,  0);
     331            if (!outReadout->mask) {
     332                psError(PS_ERR_UNKNOWN, false, "failed to create postage stamp mask image\n");
     333                status = false;
     334                break;
     335            }
     336        }
     337        if (readout->weight) {
     338            outReadout->weight = extractStamp(readout->weight, extractRegion,  0);
     339            if (!outReadout->weight) {
     340                psError(PS_ERR_UNKNOWN, false, "failed to create postage stamp weight image\n");
     341                status = false;
     342                break;
     343            }
    329344        }
    330345
  • trunk/pstamp/src/ppstampParseCamera.c

    r17270 r20148  
    88
    99// Set up the ppstamp output Image file
    10 bool setupOutput(pmConfig *config, pmFPAfile *input)
     10bool setupOutput(pmConfig *config, pmFPAfile *input, bool doMask, bool doWeight)
    1111{
    1212    pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT");
    1313    output->save = true;
     14
     15    if (doMask) {
     16        pmFPAfile *outMask = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.MASK");
     17        outMask->save = true;
     18    }
     19    if (doWeight) {
     20        pmFPAfile *outWeight = pmFPAfileDefineSkycell(config, output->fpa, "PPSTAMP.OUTPUT.WEIGHT");
     21        outWeight->save = true;
     22    }
     23
    1424    return true;
    1525}
     
    3444    }
    3545
     46    bool doMask = false;
     47    pmFPAfile *mask = pmFPAfileBindFromArgs (&status, input, config, "PPSTAMP.INPUT.MASK", "MASK");
     48    if (!status) {
     49        psError(PS_ERR_IO, false, "Failed to build FPA from PPSTAMP.INPUT.MASK");
     50        return false;
     51    }
     52    if (mask) {
     53        doMask = true;
     54    }
     55    bool doWeight = false;
     56    pmFPAfile *weight = pmFPAfileBindFromArgs (&status, input, config, "PPSTAMP.INPUT.WEIGHT", "WEIGHT");
     57    if (!status) {
     58        psError(PS_ERR_IO, false, "Failed to build FPA from PPSTAMP.INPUT.WEIGHT");
     59        return false;
     60    }
     61    if (weight) {
     62        doWeight = true;
     63    }
     64       
     65
     66
    3667    // XXX: create a filerule for PPSTAMP.ASTROM
    3768    pmFPAfile *astrom = pmFPAfileDefineFromArgs(&status, config, "PSWARP.ASTROM", "ASTROM");
     
    5283
    5384    // Set up the output target
    54     if (!setupOutput(config, input)) {
     85    if (!setupOutput(config, input, doMask, doWeight)) {
    5586        psError(PS_ERR_UNKNOWN, false, "Unable to setup output.");
    5687        return false;
Note: See TracChangeset for help on using the changeset viewer.