IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35539


Ignore:
Timestamp:
May 9, 2013, 10:00:41 AM (13 years ago)
Author:
eugene
Message:

add source for output, output.bkgmodel, and psphotInput in psphotParseCamera; do not activate PSPHOT.INPUT; if a background model is not supplied do not attempt to generate one; generate the metadata for the output bkgmodel

Location:
branches/eam_branches/ipp-20130419/pswarp/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpCleanup.c

    r35536 r35539  
    1919  "PSWARP.OUTPUT.BKGMODEL",
    2020  "PSWARP.OUTPUT.SOURCES",
    21   "PSPHOT.INPUT",
    2221  "PSPHOT.OUTPUT",
    2322  "PSPHOT.RESID",
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpDefineLayout.c

    r35535 r35539  
    9595    bool bilevelAstrometry = psMetadataLookupBool (NULL, skycell->fpa->analysis, "ASTROMETRY.BILEVEL");
    9696   
    97     // generate the output hdu and contents bits
    98     pmFPAAddSourceFromFormat(output->fpa, output->format);
    99 
    10097    // XXX this is a bit muddled : we are setting up the astrometry elements for the output
    10198    // background model here instead of in pswarpLoadAstrometry, where it would be more natural
     
    106103
    107104    // if we have an output background model, generate hdu, etc and supply astrometry
    108     if (bkgModel) {
    109         pmFPAAddSourceFromFormat(bkgModel->fpa, bkgModel->format);
    110 
    111         if (bilevelAstrometry) {
    112             // top-level elements of the bkgModel astrometry
    113             bkgModel->fpa->toTPA   = psMemIncrRefCounter (skycell->fpa->toTPA);
    114             bkgModel->fpa->fromTPA = psMemIncrRefCounter (skycell->fpa->fromTPA);
    115             bkgModel->fpa->toSky   = psMemIncrRefCounter (skycell->fpa->toSky);
    116         }
     105    if (bkgModel && bilevelAstrometry) {
     106        // top-level elements of the bkgModel astrometry
     107        bkgModel->fpa->toTPA   = psMemIncrRefCounter (skycell->fpa->toTPA);
     108        bkgModel->fpa->fromTPA = psMemIncrRefCounter (skycell->fpa->fromTPA);
     109        bkgModel->fpa->toSky   = psMemIncrRefCounter (skycell->fpa->toSky);
    117110    }
    118111
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpLoopBackground.c

    r35537 r35539  
    167167        }
    168168
    169         if (false && !pswarpUpdateMetadata (output->fpa, skycell->fpa, input->fpa, astrom->fpa, config, false)) {
     169        if (!pswarpUpdateMetadata (output->fpa, skycell->fpa, input->fpa, astrom->fpa, config, false)) {
    170170            psError(psErrorCodeLast(), false, "problem generating statistics.");
    171171            goto FAIL;
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpOptions.c

    r35535 r35539  
    7070    }
    7171
    72     bool doBKG = psMetadataLookupBool(&status,recipe, "BACKGROUND.MODEL"); ///< Generate the warped background model?
     72    // BACKGROUND.MODEL gets set in config->arguments (to false) if no input model is found
     73    bool doBKG = psMetadataLookupBool(&status,config->arguments, "BACKGROUND.MODEL"); ///< Generate the warped background model?
    7374    if (!status) {
    74       doBKG = false;
     75      // if it is not in config->arguments, look in recipe
     76      doBKG = psMetadataLookupBool(&status,recipe, "BACKGROUND.MODEL"); ///< Generate the warped background model?
     77      if (!status) {
     78        doBKG = false;
    7579      psWarning("BACKGROUND.MODEL is not set in the %s recipe -- defaulting to FALSE.", PSWARP_RECIPE);
     80      }
    7681    }
     82
    7783    int bkgXgrid = psMetadataLookupS32(&status,recipe, "BKG.XGRID"); ///< Xsize of background model
    7884    if (!status) {
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpParseCamera.c

    r35538 r35539  
    7676    }
    7777    output->save = true;
     78    pmFPAAddSourceFromFormat(output->fpa, output->format); // ** builds the HDUs, is this OK?
    7879
    7980    pmFPAfile *outMask = useInputCamera ?
     
    116117            pmFPAfileDefineSkycell(config, NULL, "PSWARP.OUTPUT.BKGMODEL"):
    117118            pmFPAfileDefineOutputForFormat(config, NULL, "PSWARP.OUTPUT.BKGMODEL", skycell->cameraName, skycell->formatName);
     119        if (!outBackground) {
     120            psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.BKGMODEL");
     121            return false;
     122        }
    118123        outBackground->xBin = psMetadataLookupS32(&status, recipe, "BKG.XGRID");
    119124        outBackground->yBin = psMetadataLookupS32(&status, recipe, "BKG.YGRID");
    120        
    121         if (!outBackground) {
    122             psError(psErrorCodeLast(), false, "Failed to build FPA from PSWARP.OUTPUT.BKGMODEL");
    123             return false;
    124         }
    125125        outBackground->save = true;
     126        pmFPAAddSourceFromFormat(outBackground->fpa, outBackground->format); // ** builds the HDUs, is this OK?
    126127    }
    127128
     
    136137        }
    137138        psphotInput->src = psMemIncrRefCounter(output->fpa);
     139        pmFPAAddSourceFromFormat(psphotInput->fpa, psphotInput->format); // ** builds the HDUs, is this OK?
    138140
    139141        // specify the number of psphot input images (psphotReadout loops over all input images)
     
    232234        foundBackground = true;
    233235    } else {
     236      // cannot do the background model if an input is not supplied.
     237      psMetadataAddBool (config->arguments, PS_LIST_TAIL, "BACKGROUND.MODEL", PS_META_REPLACE, "no input background supplied", false);
    234238      psLogMsg("pswarp", PS_LOG_INFO, "No background models supplied");
    235239    }
     
    329333            psLogMsg("pswarp", PS_LOG_INFO, "No variance supplied");
    330334        }
     335
     336        // XXX for now we do not have an option to supply a background model set in multi input mode
     337        psMetadataAddBool (config->arguments, PS_LIST_TAIL, "BACKGROUND.MODEL", PS_META_REPLACE, "no input background supplied", false);
    331338    }
    332339
Note: See TracChangeset for help on using the changeset viewer.