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/pswarpParseCamera.c

    r12526 r12771  
    1111    pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "PSWARP.INPUT", "INPUT");
    1212    if (!input) {
    13         psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT");
    14         return false;
     13        psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.INPUT");
     14        return false;
    1515    }
    1616
     
    1919    pmFPAfileDefineFromArgs (&status, config, "PSWARP.ASTROM", "ASTROM");
    2020    if (status) {
    21         psLogMsg ("pswarp", 3, "using supplied astrometry\n");
     21        psLogMsg ("pswarp", 3, "using supplied astrometry\n");
    2222    } else {
    23         psLogMsg ("pswarp", 3, "using header astrometry\n");
     23        psLogMsg ("pswarp", 3, "using header astrometry\n");
    2424    }
    2525
    2626    // the mask is not required - but must conform to input camera
    27     if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.MASK", "MASK")) {
    28         psLogMsg ("pswarp", 3, "no mask supplied\n");
    29     }
     27    pmFPAfile *inMask = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.MASK", "MASK");
     28    if (!inMask) {
     29        psLogMsg ("pswarp", 3, "no mask supplied\n");
     30    }
    3031
    31     if (!pmFPAfileBindFromArgs (NULL, input, config, "PSWARP.WEIGHT", "WEIGHT")) {
    32         psLogMsg ("pswarp", 3, "no weight supplied\n");
    33     }
     32    pmFPAfile *inWeight = pmFPAfileBindFromArgs(NULL, input, config, "PSWARP.WEIGHT", "WEIGHT");
     33    if (!inWeight) {
     34        psLogMsg ("pswarp", 3, "no weight supplied\n");
     35    }
    3436
    3537    // the input skycell is a required argument: it defines the output image
     
    3739    status = pswarpDefineSkycell (&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL");
    3840    if (!status) {
    39         psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL");
    40         return false;
     41        psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.SKYCELL");
     42        return false;
    4143    }
    4244
     
    4547    // if (!pmFPAfileDefineFromFPA (skyConfig, skycell->fpa, 1, 1, "PSWARP.OUTPUT")) {
    4648    if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT")) {
    47         psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT");
    48         return false;
     49        psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT");
     50        return false;
     51    }
     52    if (inMask) {
     53        if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT.MASK")) {
     54            psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.MASK");
     55            return false;
     56        }
     57    }
     58    if (inWeight) {
     59        if (!pmFPAfileDefineOutput (skyConfig, skycell->fpa, "PSWARP.OUTPUT.WEIGHT")) {
     60            psError(PSWARP_ERR_CONFIG, false, "Failed to build FPA from PSWARP.OUTPUT.WEIGHT");
     61            return false;
     62        }
    4963    }
    5064
    5165    // Chip selection: turn on only the chips specified
    52     char *chipLine = psMetadataLookupStr(NULL, config->arguments, "CHIP_SELECTIONS"); 
     66    char *chipLine = psMetadataLookupStr(NULL, config->arguments, "CHIP_SELECTIONS");
    5367    psArray *chips = psStringSplitArray (chipLine, ",", false);
    5468    if (chips->n > 0) {
    55         pmFPASelectChip (input->fpa, -1, true); // deselect all chips
    56         for (int i = 0; i < chips->n; i++) {
    57             int chipNum = atoi(chips->data[i]);
    58             if (! pmFPASelectChip(input->fpa, chipNum, false)) {
    59                 psError(PSWARP_ERR_CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum);
    60                 return false;
    61             }
     69        pmFPASelectChip (input->fpa, -1, true); // deselect all chips
     70        for (int i = 0; i < chips->n; i++) {
     71            int chipNum = atoi(chips->data[i]);
     72            if (! pmFPASelectChip(input->fpa, chipNum, false)) {
     73                psError(PSWARP_ERR_CONFIG, true, "Chip number %d doesn't exist in camera.\n", chipNum);
     74                return false;
     75            }
    6276        }
    6377    }
Note: See TracChangeset for help on using the changeset viewer.