IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2013, 4:45:57 PM (13 years ago)
Author:
eugene
Message:

carry over changes from eam_branch/20130307

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419

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

    r34800 r35421  
    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     // XXX we may need a different skycell structure here
     105    pmConfig *skyConfig = NULL;
    94106    pmFPAfile *skycell = NULL;
    95     pmConfig *skyConfig = NULL;
    96     bool status = pswarpDefineSkycell(&skycell, &skyConfig, config, "PSWARP.SKYCELL", "SKYCELL");
    97     if (!status) {
    98         psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.SKYCELL");
    99         return false;
    100     }
     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
     116    if (!status || !skycell) {
     117      psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.SKYCELL");
     118      return false;
     119      }
     120    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "SKYCELL.CAMERA", 0, "Name of camera for skycell", skyConfig->cameraName);
    101121    psFree(skyConfig);
    102122
     
    142162    if (inBackground && psMetadataLookupBool(&mdok, recipe, "BACKGROUND.MODEL")) {
    143163      pmFPAfile *outBackground = pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL");
    144 /*       pmFPAfile *outBackground = pmFPAfileDefineFromFPA(config,output->fpa, */
    145 /*                                                      psMetadataLookupS32(&mdok,recipe,"BKG.XGRID"), */
    146 /*                                                      psMetadataLookupS32(&mdok,recipe,"BKG.YGRID"), */
    147 /*                                                      "PSWARP.OUTPUT.BKGMODEL"); */
    148164      outBackground->xBin = psMetadataLookupS32(&mdok, recipe, "BKG.XGRID");
    149165      outBackground->yBin = psMetadataLookupS32(&mdok, recipe, "BKG.YGRID");
Note: See TracChangeset for help on using the changeset viewer.