IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34135


Ignore:
Timestamp:
Jul 10, 2012, 3:42:50 PM (14 years ago)
Author:
bills
Message:

add function to load read the WCS from the input header and save the
transforms in the fpa and chip structures. This allows psphotStack RA and DEC
output values to be set.
Call function to set flag on inputs to be skipped for radial aperture measurments
due to deconvolution over limit error. See next revision for more info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotStackReadout.c

    r33958 r34135  
    11# include "psphotInternal.h"
     2
     3static bool psphotStackLoadWCS(pmConfig *config, const pmFPAview *view, const char *filerule);
    24
    35// we have 3 possible real filesets:
     
    6769    char *STACK_SRC = useRaw ? STACK_RAW : STACK_CNV;
    6870    char *STACK_DET = STACK_RAW;
     71
     72    // load WCS
     73    if (!psphotStackLoadWCS(config, view, STACK_SRC)) {
     74        psError (PSPHOT_ERR_CONFIG, false, "trouble loading WCS for %s", STACK_SRC);
     75        return false;
     76    }
    6977
    7078    // set the photcode for each image
     
    344352            }
    345353        }
    346         psphotRadialApertures (config, view, STACK_CNV, 0); // XXX entry 0 == unmatched?
     354        psphotRadialApertures (config, view, STACK_CNV, 0); // entry 0 == unmatched
    347355        psMemDump("extmeas");
    348356
     357        // mark any inputs that we want to skip the matched apertures for
     358        psphotStackSetInputsToSkip(config, view, STACK_OUT, true);
     359
    349360        int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT);
    350 
    351361        for (int entry = 1; entry < nRadialEntries; entry++) {
    352362            // NOTE: entry 0 is the unmatched image set
     
    362372
    363373            // measure circular, radial apertures (objects sorted by S/N)
    364             // entry 0 == unmatched? pass entry + 1?
    365374            psphotRadialApertures (config, view, STACK_OUT, entry);
    366375
     
    373382        }
    374383    }
     384    psphotStackSetInputsToSkip(config, view, STACK_OUT, false);
    375385
    376386    // measure aperture photometry corrections
     
    413423    // create the exported-metadata and free local data
    414424    return psphotReadoutCleanup (config, view, STACK_SRC);
     425}
     426
     427static bool psphotStackLoadWCS(pmConfig *config, const pmFPAview *view, const char *filerule) {
     428
     429    int num = psphotFileruleCount(config, filerule);
     430
     431    for (int i=0; i<num; i++) {
     432        pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
     433        psAssert (file, "missing file?");
     434   
     435        pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     436        psAssert (readout, "missing readout?");
     437
     438        pmHDU *hdu = pmHDUFromReadout(readout);
     439        psAssert (hdu, "input missing hdu?");
     440
     441        if (!pmAstromReadWCS(file->fpa, readout->parent->parent, hdu->header, 1.0)) {
     442            psError (PSPHOT_ERR_UNKNOWN, false, "failed to read WCS from header for input %d", i);
     443            return false;
     444        }
     445    }
     446    return true;
    415447}
    416448
Note: See TracChangeset for help on using the changeset viewer.