IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 13, 2012, 2:13:03 PM (14 years ago)
Author:
bills
Message:

add option to to ppstamp to return an entire file instead of a region of interest.
This is useful for two purposes.

  1. To undo the asinh storage for stacks
  2. To replace the astrometry from chip stage with the camera stage fit

Also fixed a bug in jpeg creation for chip stage. Dropped the flipping for chip
stage as well. That is incorrect. We want the jpeg to match the chip image.
Also made the default to no_censor_masked since that isn't the usual case now
that magic is no longer a requirement

File:
1 edited

Legend:

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

    r30050 r33504  
    233233    int status = false;
    234234
    235     pmFPAfile *output;
    236     if (!options->stage || (strcmp(options->stage, "diff") != 0)) {
    237         output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT");
    238     } else {
    239         output = psMetadataLookupPtr(NULL, config->files, "PPSTAMP.OUTPUT.DIFF");
    240     }
     235    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, options->outputFileRule);
    241236    if (!output) {
    242237        psError(PS_ERR_UNKNOWN, false, "Can't find output data\n");
     
    529524        // If no chip name was specified, select this one (the first one that had data)
    530525        if ((options->chipName == NULL) || !strcasecmp(chipName, options->chipName)) {
    531             psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName);
    532             center->chip->x = options->roip.centerX;
    533             center->chip->y = options->roip.centerY;
     526            if (options->chipName) {
     527                psLogMsg("ppstampMakeStamp", 2, "Center on chip: %s\n", chipName);
     528            }
     529            if (options->wholeFile) {
     530                center->chip->x = (chipBounds->x1 + chipBounds->x0 + 1) / 2;
     531                center->chip->y = (chipBounds->y1 + chipBounds->y0 + 1) / 2;
     532            } else {
     533                center->chip->x = options->roip.centerX;
     534                center->chip->y = options->roip.centerY;
     535            }
    534536            center->chip->xErr = 0;
    535537            center->chip->yErr = 0;
     
    543545            findBoundingBox(options, input->fpa, chip, center);
    544546        } else {
    545             int width  = options->roip.dX;
    546             int height = options->roip.dY;
    547             if (width > 5000) {
    548                 fprintf(stderr, "requested width %d too large reducing to 5000\n", width);
    549                 width = 5000;
     547            if (options->wholeFile) {
     548                options->roi = *chipBounds;
     549            } else {
     550                int width  = options->roip.dX;
     551                int height = options->roip.dY;
     552                if (width > 7000) {
     553                    fprintf(stderr, "requested width %d too large reducing to 7000\n", width);
     554                    width = 7000;
     555                }
     556                if (height > 7000) {
     557                    fprintf(stderr, "requested height %d too large reducing to 7000\n", height);
     558                    height = 7000;
     559                }
     560
     561                // calculate the ROI in chip coordinates
     562                options->roi.x0 = center->chip->x - width / 2;
     563                options->roi.x1 = options->roi.x0 + width;
     564                options->roi.y0 = center->chip->y - height / 2;
     565                options->roi.y1 = options->roi.y0 + height;
    550566            }
    551             if (height > 5000) {
    552                 fprintf(stderr, "requested height %d too large reducing to 5000\n", height);
    553                 height = 5000;
    554             }
    555 
    556             // calculate the ROI in chip coordinates
    557             options->roi.x0 = center->chip->x - width / 2;
    558             options->roi.x1 = options->roi.x0 + width;
    559             options->roi.y0 = center->chip->y - height / 2;
    560             options->roi.y1 = options->roi.y0 + height;
    561         }
    562 
    563 
    564         if (regionContainsRegion(chipBounds, &options->roi)) {
    565             // returnval = findCell(view, options, input, center, ppCell);
     567        }
     568
     569
     570        if (options->wholeFile || regionContainsRegion(chipBounds, &options->roi)) {
    566571            psLogMsg("ppstampMakeStamp", 2, "ROI contained on: %s\n", chipName);
    567572            returnval = PPSTAMP_ON;
Note: See TracChangeset for help on using the changeset viewer.