IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2013, 3:42:02 PM (13 years ago)
Author:
eugene
Message:

merged from trunk

Location:
branches/eam_branches/ipp-20130307
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307

  • branches/eam_branches/ipp-20130307/pswarp/src/pswarpParseCamera.c

    r35382 r35413  
    5555}
    5656
    57 
    58 
    59 
    6057bool pswarpParseCamera(pmConfig *config)
    6158{
     
    7067    }
    7168
    72     pmFPAfile *astrom = defineInputFile(config, NULL, "PSWARP.ASTROM", "ASTROM", PM_FPA_FILE_CMF);
     69    // XXX I should allow the astrometry input to be either WCS or CMF
     70    // Define the input astrometry file(s)
     71    bool status = false;
     72    pmFPAfile *astrom = pmFPAfileDefineFromArgs(&status, config, "PSWARP.ASTROM", "ASTROM");
     73    if (!astrom) {
     74        // look for the file on the RUN metadata
     75        astrom = pmFPAfileDefineFromRun(&status, NULL, config, "PSWARP.ASTROM"); // File to return
     76        if (!status) {
     77            psLogMsg("pswarp", PS_LOG_INFO, "Failed to load file definition for %s", "PSWARP.ASTROM");
     78        }
     79    }
     80    if ((astrom->type != PM_FPA_FILE_CMF) && (astrom->type != PM_FPA_FILE_WCS)) {
     81        psLogMsg("pswarp", PS_LOG_INFO, "%s is neither CMF nor WCS", "PSWARP.ASTROM");
     82    }
    7383    psLogMsg("pswarp", PS_LOG_INFO, "Astrometry source: %s", astrom ? "supplied" : "header");
    7484
     85    // Define the input mask file(s)
    7586    pmFPAfile *inMask = defineInputFile(config, input, "PSWARP.MASK", "MASK", PM_FPA_FILE_MASK);
    7687    if (!inMask) {
     
    7889    }
    7990
     91    // Define the input variance file(s)
    8092    pmFPAfile *inVariance = defineInputFile(config, input, "PSWARP.VARIANCE", "VARIANCE",
    8193                                            PM_FPA_FILE_VARIANCE);
     
    91103   
    92104    // The input skycell is a required argument: it defines the output image
    93     bool status = false;
    94105    pmConfig *skyConfig = NULL;
    95     pmFPAfile *skycell = pmFPAfileDefineNewConfig(&status, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL");
     106    pmFPAfile *skycell = NULL;
     107
     108# define USE_PSWARP_DEFINE_SKYCELL 0
     109# if (USE_PSWARP_DEFINE_SKYCELL)
     110    // XXX this function is no longer needed; drop
     111    status = pswarpDefineSkycell(&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL");
     112# else
     113    skycell = pmFPAfileDefineNewConfig(&status, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL");
     114# endif
     115
    96116    if (!status || !skycell) {
    97117      psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.SKYCELL");
Note: See TracChangeset for help on using the changeset viewer.