IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 5, 2007, 5:38:16 PM (19 years ago)
Author:
Paul Price
Message:

Adding variance and mask output.

File:
1 edited

Legend:

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

    r12526 r12771  
    1717    pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSWARP.INPUT");
    1818    if (!input) {
    19         psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");
    20         return false;
     19        psError(PSWARP_ERR_CONFIG, true, "Can't find input data!\n");
     20        return false;
    2121    }
    2222
     
    2424    pmFPAfile *astrom = psMetadataLookupPtr (NULL, config->files, "PSWARP.ASTROM");
    2525    if (!astrom) {
    26         astrom = input;
     26        astrom = input;
    2727    }
    28  
     28
    2929    // select the output readout
    3030    view = pmFPAviewAlloc (0);
     
    3434    pmReadout  *output = pmFPAfileThisReadout (config->files, view, "PSWARP.OUTPUT");
    3535    if (!output) {
    36         psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");
    37         return false;
     36        psError(PSWARP_ERR_CONFIG, true, "Can't find output data!\n");
     37        return false;
    3838    }
    3939    psFree (view);
     
    4242    pmFPAfileActivate (config->files, false, "PSWARP.SKYCELL");
    4343    pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT");
     44    pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.MASK");
     45    pmFPAfileActivate (config->files, false, "PSWARP.OUTPUT.WEIGHT");
    4446
    4547    view = pmFPAviewAlloc (0);
     
    5254    pmHDU *phu = pmFPAviewThisPHU (view, astrom->fpa);
    5355    if (phu) {
    54         char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
    55         if (ctype) {
    56             bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
    57         }
     56        char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
     57        if (ctype) {
     58            bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
     59        }
    5860    }
    5961    if (bilevelAstrometry) {
    60         pmAstromReadBilevelMosaic (input->fpa, phu->header);
    61     } 
     62        pmAstromReadBilevelMosaic (input->fpa, phu->header);
     63    }
    6264
    6365    // files associated with the science image
     
    6769        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    6870        if (!chip->process || !chip->file_exists) { continue; }
    69         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     71        pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    7072
    7173        // read WCS data from the corresponding header
    72         pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
    73         if (bilevelAstrometry) {
    74             pmAstromReadBilevelChip (chip, hdu->header);
    75         } else {
    76             // we use a default FPA pixel scale of 1.0
    77             pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0);
    78         }
     74        pmHDU *hdu = pmFPAviewThisHDU (view, astrom->fpa);
     75        if (bilevelAstrometry) {
     76            pmAstromReadBilevelChip (chip, hdu->header);
     77        } else {
     78            // we use a default FPA pixel scale of 1.0
     79            pmAstromReadWCS (input->fpa, chip, hdu->header, 1.0);
     80        }
    7981
    80         while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
     82        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    8183            psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    8284            if (!cell->process || !cell->file_exists) { continue; }
    83             pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     85            pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    8486
    85             // process each of the readouts
    86             while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    87                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    88                 if (! readout->data_exists) { continue; }
     87            // process each of the readouts
     88            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     89                pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     90                if (! readout->data_exists) { continue; }
    8991
    90                 // XXX _Opt version uses locally-linear map
    91                 // pswarpTransformReadout (output, readout, config);
    92                 pswarpTransformReadout_Opt (output, readout, config);
     92                // XXX _Opt version uses locally-linear map
     93                // pswarpTransformReadout (output, readout, config);
     94                pswarpTransformReadout_Opt (output, readout, config);
    9395
    94                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    95             }
    96             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    97         }
    98         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     96                pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     97            }
     98            pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     99        }
     100        pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    99101    }
    100102    pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
Note: See TracChangeset for help on using the changeset viewer.