IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2007, 5:02:24 PM (19 years ago)
Author:
eugene
Message:

update psphot and psastro in ppImage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImagePhotom.c

    r11351 r11352  
    77// the top portion of this function is equivalent to psphotParseCamera,
    88// but different in a few important ways. 
     9// XXX move this section to ppImageParseCamera?
    910bool ppImagePhotom (pmConfig *config, pmFPAview *view) {
    1011
     
    2728        // we set the freeLevel to be FPA so this pmFPAfile may be used as input to psastro
    2829        // XXX make this the resonsibility of a ppImageAstrom call?
    29         pmFPAfile *outfile = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
    30         outfile->freeLevel = PM_FPA_LEVEL_FPA;
     30        // XXX test for psastro requests?
     31        // XXX need to make this an INTERNAL file if output is not requested.
     32        bool saveOutput = psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT");
     33        if (saveOutput) {
     34          pmFPAfile *outfile = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
     35          outfile->freeLevel = PM_FPA_LEVEL_FPA;
     36        }
    3137    }
    3238
    3339    // if we have requested PSPHOT.SRC (externally supplied sources), attempt to resolve it
    3440    if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.SRC")) {
    35         pmFPAfileDefineFromArgs (&status, config, "PSPHOT.SRC", "SRC");
     41        pmFPAfileDefineFromArgs (&status, config, "PSPHOT.SRC", "PSPHOT.SRC");
    3642        if (!status) {
    3743            psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC");
     
    4248    // select recipe options supplied on command line
    4349    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     50
     51    // NOTE the difference here from psphotParseCamera: the mask and weight
     52    // images are supplied by ppImage and need not / should not be loaded here.
     53
     54    // optionally load the PSF Model and/or fixed stars
     55    pmFPAfileBindFromArgs (NULL, input, config, "PSPHOT.PSF", "PSPHOT.PSF");
    4456
    4557    // set default recipe values here
     
    6072    // optionally save the residual image
    6173    if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) {
    62         pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID");
     74        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {
     75            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
     76            return false;
     77        }
    6378    }
    6479
     
    7085    // optionally save the background model (small FITS image)
    7186    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL")) {
    72         pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL");
     87        if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {
     88            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
     89            return false;
     90        }
    7391    }
    7492    // optionally save the full background image
    7593    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {
    76         pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND");
     94        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND")) {
     95            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
     96            return false;
     97        }
    7798    }
    7899    // optionally save the background-subtracted image
    79100    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {
    80         pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB");
     101        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB")) {
     102            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
     103            return false;
     104        }
    81105    }
    82106    // optionally save the PSF Model
    83107    if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) {
    84         pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE");
     108        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {
     109            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");
     110            return false;
     111        }
    85112    }
    86     // optionally load the PSF Model
    87     if (psMetadataLookupBool(NULL, recipe, "LOAD.PSF")) {
    88         pmFPAfileDefineInput (config, input->fpa, "PSPHOT.PSF.LOAD");
     113
     114    // optionally save output plots
     115    if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) {
     116        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {
     117            psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS");
     118        }
     119        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {
     120            psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");
     121        }
    89122    }
    90123
     
    92125    // pmFPAfileConstruct (config->files, format, config->camera, "PSPHOT.PSF_SAMPLE");
    93126
     127    // XXX probably need to deactivate all files and activate the psphot ones explicitly
     128
     129    // In this section, we iterate over the cells and readout for this chip
     130    // and run the psphot analysis routine here
    94131    // XXX worry about this not having unique PHOTCODES...
    95132    // view->cell = -1;
Note: See TracChangeset for help on using the changeset viewer.