IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 19, 2007, 3:58:02 PM (19 years ago)
Author:
eugene
Message:

updates to fix mosaic astrometry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpDataLoad.c

    r10958 r12505  
    99bool pswarpDataLoad (pmConfig *config) {
    1010
     11    bool status;
    1112    pmChip *chip;
    1213    pmCell *cell;
    1314    pmReadout *readout;
    1415    pmFPAview *view;
     16
     17    // select the current recipe
     18    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, PSASTRO_RECIPE);
     19    if (!recipe) {
     20        psError(PSWARP_ERR_CONFIG, false, "Can't find PSASTRO recipe needed for pixel scale!\n");
     21        return false;
     22    }
     23
     24    // physical pixel scale in microns per pixel
     25    double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE");
     26    if (!status) {
     27        psError(PS_ERR_IO, false, "Failed to lookup pixel scale");
     28        return false;
     29    }
    1530
    1631    // select the input data sources
     
    2136    }
    2237
     38    // use the external astrometry source if supplied
     39    pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM");
     40    if (!astrom) {
     41        fprintf (stderr, "*** using header astrometry\n");
     42        astrom = input;
     43    }
     44 
    2345    // select the output readout
    2446    view = pmFPAviewAlloc (0);
     
    4466    // XXX need to optionally load the astrometry datafile
    4567    bool bilevelAstrometry = false;
    46     pmHDU *phu = pmFPAviewThisPHU (view, input->fpa);
     68    pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa);
    4769    if (phu) {
    4870      char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
     
    5274    }
    5375    if (bilevelAstrometry) {
    54       pmAstromReadBilevelMosaic (input->fpa, phu->header);
     76      pmAstromReadBilevelMosaic (input->fpa, phu->header, pixelScale);
    5577    }
    5678
     
    6486
    6587        // read WCS data from the corresponding header
    66         pmHDU *hdu = pmFPAviewThisHDU (view, input->fpa);
     88        pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
    6789        if (bilevelAstrometry) {
    6890          pmAstromReadBilevelChip (chip, hdu->header);
    6991        } else {
    70           // XXX get pixelScale from recipes.  does it matter?
    71           float pixelScale = 13.5;
    7292          pmAstromReadWCS (input->fpa, chip, hdu->header, pixelScale);
    7393        }
Note: See TracChangeset for help on using the changeset viewer.