IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13413


Ignore:
Timestamp:
May 17, 2007, 12:43:04 PM (19 years ago)
Author:
Paul Price
Message:

Need to set 'status' to false before pmFPAfileDefineFromArgs so that it doesn't immediately return. Gene promises to fix this API soon!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotDefineFiles.c

    r13225 r13413  
    1717    // the output sources are carried on the input->fpa structures
    1818    if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT")) {
    19         psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");
    20         return false;
     19        psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");
     20        return false;
    2121    }
    2222
    23     // if we are choosing not to save the output detections, mark this file inactive so it will 
     23    // if we are choosing not to save the output detections, mark this file inactive so it will
    2424    // not be written, but will keep the detections in memory for other functions (eg, astrometry)
    2525    if (!psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) {
    26         pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT");
     26        pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT");
    2727    }
    2828
    29     // optionally save the residual image 
     29    // optionally save the residual image
    3030    if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) {
    31         if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {
    32             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID");
    33             return false;
    34         }
     31        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {
     32            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID");
     33            return false;
     34        }
    3535    }
    3636    // optionally save the background model (small FITS image)
    3737    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL")) {
    38         int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    39         int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    40         if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {
    41             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
    42             return false;
    43         }
     38        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
     39        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
     40        if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {
     41            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
     42            return false;
     43        }
    4444    }
    4545    // optionally save the background model's standard deviation (small FITS image)
    4646    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKMDL.STDEV")) {
    47         int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
    48         int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
    49         if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) {
    50             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");
    51             return false;
    52         }
     47        int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
     48        int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
     49        if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) {
     50            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");
     51            return false;
     52        }
    5353    }
    5454    // optionally save the full background image
    5555    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {
    56         if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND")) {
    57             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
    58             return false;
    59         }
     56        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND")) {
     57            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
     58            return false;
     59        }
    6060    }
    6161    // optionally save the background-subtracted image
    6262    if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {
    63         if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB")) {
    64             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
    65             return false;
    66         }
     63        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB")) {
     64            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
     65            return false;
     66        }
    6767    }
    6868    // optionally save the PSF Model
    6969    if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) {
    70         if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {
    71             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");
    72             return false;
    73         }
     70        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {
     71            psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");
     72            return false;
     73        }
    7474    }
    7575
    7676    // optionally save output plots
    7777    if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) {
    78         if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {
    79             psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS");
    80         }
    81         if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {
    82             psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");
    83         }
    84         if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) {
    85             psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.APRESID");
    86         }
     78        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {
     79            psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.MOMENTS");
     80        }
     81        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {
     82            psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");
     83        }
     84        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) {
     85            psTrace ("psphot", 3, "Cannot find a rule for SOURCE.PLOT.APRESID");
     86        }
    8787    }
    8888
    89     if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) {
    90         pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC");
    91         if (!status) {
    92             psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.INPUT.CMF");
    93             return status;
    94         }
     89    if (psMetadataLookupPtr(NULL, config->arguments, "SRC")) {
     90        status = false;
     91        pmFPAfileDefineFromArgs (&status, config, "PSPHOT.INPUT.CMF", "SRC");
     92        if (!status) {
     93            psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.INPUT.CMF");
     94            return status;
     95        }
    9596    }
    9697
    97     if (psMetadataLookupPtr(NULL, config->arguments, "PSF")) {
    98         pmFPAfileDefineFromArgs (&status, config, "PSPHOT.PSF.LOAD", "PSF");
    99         if (!status) {
    100             psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC");
    101             return status;
    102         }
     98    if (psMetadataLookupPtr(NULL, config->arguments, "PSPHOT.PSF")) {
     99        status = false;
     100        pmFPAfileDefineFromArgs (&status, config, "PSPHOT.PSF.LOAD", "PSPHOT.PSF");
     101        if (!status) {
     102            psError(PSPHOT_ERR_CONFIG, false, "Failed to find/build PSPHOT.SRC");
     103            return status;
     104        }
    103105    }
    104106
     
    109111}
    110112
    111     // if we have requested PSPHOT.SRC, attempt to resolve it 
     113    // if we have requested PSPHOT.SRC, attempt to resolve it
    112114    // this is a list of input sources, stored in a psphot output format file
    113115    // XXX this was disabled after the switch to CHIP-mosaicked images.  It needs to be tested
    114116    // before it is added back into the code.
    115 # if (0)   
     117# if (0)
    116118    // optionally load the PSF Model and/or fixed stars
    117119    // XXX add this back in later
Note: See TracChangeset for help on using the changeset viewer.