IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:12:39 PM (15 years ago)
Author:
eugene
Message:

use the smoothed image for footprint culling; use a more stringent culling for saturated stars; more tweaks to get sat stars to be fitted; various updates to psphotStack; unify psphotImageLoop varients; be a bit careful about number of stars in a PSF clump

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotForcedImageLoop.c

    r29936 r31154  
    11# include "psphotStandAlone.h"
    22
    3 # define ESCAPE(MESSAGE) { \
    4   psError(PSPHOT_ERR_DATA, false, MESSAGE); \
    5   psFree (view); \
    6   return false; \
    7 }
     3# define ESCAPE(MESSAGE) {                              \
     4        psError(PSPHOT_ERR_DATA, false, MESSAGE);       \
     5        psFree (view);                                  \
     6        return false;                                   \
     7    }
    88
    99bool psphotForcedImageLoop (pmConfig *config) {
     
    3131    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot.");
    3232
     33    // select the appropriate recipe information
     34    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     35    psAssert (recipe, "missing recipe?");
     36
     37    psImageMaskType maskTest = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT");
     38
    3339    // for psphot, we force data to be read at the chip level
    3440    while ((chip = pmFPAviewNextChip (view, load->fpa, 1)) != NULL) {
     
    4551        // mosaic the cells of a chip into a single contiguous (trimmed) chip
    4652        if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip.");
     53
     54        // Read WCS if easy.
     55        // XXX Since we're mosaicking cells, we ignore the case where the WCS is defined for a cell.
     56        {
     57            pmChip *inChip = pmFPAviewThisChip(view, input->fpa); // Mosaicked chip
     58            pmHDU *hduLow = pmHDUGetLowest(input->fpa, inChip, NULL);
     59            if (hduLow && !pmAstromReadWCS(input->fpa, inChip, hduLow->header, 1.0)) {
     60                psWarning("Unable to read WCS astrometry from header.");
     61                psErrorClear();
     62                pmHDU *hduHigh = pmHDUGetHighest(input->fpa, inChip, NULL);
     63                if (hduHigh && hduHigh != hduLow &&
     64                    !pmAstromReadWCS(input->fpa, chip, hduHigh->header, 1.0)) {
     65                    psWarning("Unable to read WCS astrometry from primary header.");
     66                    psErrorClear();
     67                }
     68            }
     69        }
    4770
    4871        // try to load other supporting data (PSF, SRC, etc).
     
    7699                if (readout->mask) {
    77100                    psImageMaskType maskSat = pmConfigMaskGet("SAT", config); // Mask value for saturated pixels
    78                     if (!pmReadoutMaskNonfinite(readout, maskSat)) {
     101                    if (!pmReadoutMaskInvalid(readout, maskTest, maskSat)) {
    79102                        psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels.");
    80103                        psFree(view);
     
    91114            }
    92115
     116            // drop all versions of the internal files
    93117            status = true;
    94118            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
Note: See TracChangeset for help on using the changeset viewer.