IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29904


Ignore:
Timestamp:
Dec 3, 2010, 2:28:34 AM (15 years ago)
Author:
eugene
Message:

modify psphotReadout and equivalent to accept a filerule argument (allow filerules other than PSPHOT.INPUT)

Location:
branches/eam_branches/ipp-20101103/psphot/src
Files:
6 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/psphot/src/Makefile.am

    r29004 r29904  
    102102        psphotStackPSF.c              \
    103103        psphotCleanup.c
    104 
    105 
    106 
    107 # # psphot analysis of the detectability of specified positions
    108 # psphotDetect_SOURCES =            \
    109 #         psphotDetect.c            \
    110 #       psphotDetectArguments.c   \
    111 #       psphotDetectParseCamera.c \
    112 #       psphotDetectImageLoop.c   \
    113 #       psphotDetectReadout.c     \
    114 #       psphotMosaicChip.c        \
    115 #       psphotCleanup.c
    116104
    117105# psphotTest_SOURCES = \
  • branches/eam_branches/ipp-20101103/psphot/src/psphot.h

    r29608 r29904  
    2424bool            psphotModelTest (pmConfig *config, const pmFPAview *view, psMetadata *recipe);
    2525bool            psphotInit (void);
    26 bool            psphotReadout (pmConfig *config, const pmFPAview *view);
    27 bool            psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources);
    28 bool            psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, psArray *inSources);
    29 bool            psphotReadoutMinimal(pmConfig *config, const pmFPAview *view);
     26bool            psphotReadout (pmConfig *config, const pmFPAview *view, const char *filerule);
     27bool            psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources);
     28bool            psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources);
     29bool            psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule);
    3030
    3131bool            psphotReadoutCleanup (pmConfig *config, const pmFPAview *view, const char *filerule);
     
    219219bool            psphotFitSummary (void);
    220220
    221 bool            psphotLoadPSF (pmConfig *config, const pmFPAview *view);
     221bool            psphotLoadPSF (pmConfig *config, const pmFPAview *view, const char *filerule);
    222222bool            psphotLoadPSFReadout (pmConfig *config, const pmFPAview *view, const char *outFilename, const char *inFilename, int index);
    223223
     
    304304pmConfig *psphotForcedArguments(int argc, char **argv);
    305305bool psphotForcedImageLoop (pmConfig *config);
    306 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view);
     306bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule);
    307307
    308308pmConfig *psphotMakePSFArguments(int argc, char **argv);
    309309bool psphotMakePSFImageLoop (pmConfig *config);
    310 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view);
     310bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule);
     311
     312int psphotFileruleCount(const pmConfig *config, const char *filerule);
    311313
    312314/**** psphotStack prototypes ****/
  • branches/eam_branches/ipp-20101103/psphot/src/psphotAddNoise.c

    r29004 r29904  
    1818    psAssert (recipe, "missing recipe?");
    1919
    20     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    21     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     20    int num = psphotFileruleCount(config, filerule);
    2221
    2322    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotApResid.c

    r29548 r29904  
    1313    psAssert (recipe, "missing recipe?");
    1414
    15     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    16     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     15    int num = psphotFileruleCount(config, filerule);
    1716
    1817    // skip the chisq image (optionally?)
     
    7271    if (!measureAptrend) {
    7372        // save nan values since these were not calculated
    74         psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   NAN);
    75         psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", NAN);
    76         psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", 0);
    77         psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", NAN);
     73        psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual",   NAN);
     74        psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", NAN);
     75        psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", 0);
     76        psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS",  PS_META_REPLACE, "aperture loss (mag)", NAN);
    7877        return true;
    7978    }
     
    325324
    326325    // save results for later output
    327     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   psf->ApResid);
    328     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->dApResid);
    329     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", psf->nApResid);
    330     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN);
     326    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual",   psf->ApResid);
     327    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", psf->dApResid);
     328    psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", psf->nApResid);
     329    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS",  PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN);
    331330
    332331    psLogMsg ("psphot.apresid", PS_LOG_DETAIL, "aperture residual: %f +/- %f\n", psf->ApResid, psf->dApResid);
     
    345344escape:
    346345    // save nan values since these were not calculated
    347     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APMIFIT",  PS_DATA_F32 | PS_META_REPLACE, "aperture residual",   NAN);
    348     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", NAN);
    349     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", 0);
    350     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS",   PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", NAN);
     346    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APMIFIT", PS_META_REPLACE, "aperture residual",   NAN);
     347    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_META_REPLACE, "ap residual scatter", NAN);
     348    psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_META_REPLACE, "number of apresid stars", 0);
     349    psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "APLOSS",  PS_META_REPLACE, "aperture loss (mag)", NAN);
    351350
    352351    psFree (xPos);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotBasicDeblend.c

    r28013 r29904  
    44bool psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filerule)
    55{
    6     bool status = true;
    7 
    8     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    9     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     6    int num = psphotFileruleCount(config, filerule);
    107
    118    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotBlendFit.c

    r29017 r29904  
    1010    psAssert (recipe, "missing recipe?");
    1111
    12     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    13     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     12    int num = psphotFileruleCount(config, filerule);
    1413
    1514    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotChoosePSF.c

    r29004 r29904  
    1010    psAssert (recipe, "missing recipe?");
    1111
    12     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    13     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     12    int num = psphotFileruleCount(config, filerule);
    1413
    1514    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotDeblendSatstars.c

    r29606 r29904  
    44bool psphotDeblendSatstars (pmConfig *config, const pmFPAview *view, const char *filerule)
    55{
    6     bool status = true;
    7 
    8     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    9     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     6    int num = psphotFileruleCount(config, filerule);
    107
    118    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotEfficiency.c

    r28013 r29904  
    164164    psAssert (recipe, "missing recipe?");
    165165
    166     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    167     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     166    int num = psphotFileruleCount(config, filerule);
    168167
    169168    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceAnalysis.c

    r29027 r29904  
    2222    }
    2323
    24     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    25     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     24    int num = psphotFileruleCount(config, filerule);
    2625
    2726    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceAnalysisByObject.c

    r29548 r29904  
    4141
    4242    // number of images used to define sources
    43     int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    44     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     43    int nImages = psphotFileruleCount(config, filerule);
    4544
    4645    // generate look-up arrays for readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotExtendedSourceFits.c

    r29548 r29904  
    1616    }
    1717
    18     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    19     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     18    int num = psphotFileruleCount(config, filerule);
    2019
    2120    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotFindDetections.c

    r29548 r29904  
    1212    psAssert (recipe, "missing recipe?");
    1313
    14     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    15     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     14    int num = psphotFileruleCount(config, filerule);
    1615
    1716    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotFitSourcesLinear.c

    r29548 r29904  
    2121    assert (recipe);
    2222
    23     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    24     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     23    int num = psphotFileruleCount(config, filerule);
    2524
    2625    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotForcedImageLoop.c

    r25981 r29904  
    8484
    8585                // run the actual photometry analysis on this chip/cell/readout
    86                 if (!psphotForcedReadout (config, view)) {
     86                if (!psphotForcedReadout (config, view, "PSPHOT.INPUT")) {
    8787                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    8888                    psFree (view);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotForcedReadout.c

    r28013 r29904  
    11# include "psphotInternal.h"
    22
    3 bool psphotForcedReadout(pmConfig *config, const pmFPAview *view) {
     3bool psphotForcedReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
    44
    55    // measure the total elapsed time in psphotReadout.  XXX the current threading plan
     
    2020
    2121    // set the photcode for this image
    22     if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {
     22    if (!psphotAddPhotcode (config, view, filerule)) {
    2323        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    2424        return false;
     
    3030
    3131    // Generate the mask and weight images, including the user-defined analysis region of interest
    32     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     32    psphotSetMaskAndVariance (config, view, filerule);
    3333    if (!strcasecmp (breakPt, "NOTHING")) {
    34         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     34        return psphotReadoutCleanup (config, view, filerule);
    3535    }
    3636
    3737    // generate a background model (median, smoothed image)
    38     if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {
    39         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     38    if (!psphotModelBackground (config, view, filerule)) {
     39        return psphotReadoutCleanup (config, view, filerule);
    4040    }
    41     if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {
    42         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     41    if (!psphotSubtractBackground (config, view, filerule)) {
     42        return psphotReadoutCleanup (config, view, filerule);
    4343    }
    4444    if (!strcasecmp (breakPt, "BACKMDL")) {
    45         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     45        return psphotReadoutCleanup (config, view, filerule);
    4646    }
    4747
    48     if (!psphotLoadPSF (config, view)) {
     48    if (!psphotLoadPSF (config, view, filerule)) {
    4949        // this only happens if we had a programming error in psphotLoadPSF
    5050        psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model");
    51         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     51        return psphotReadoutCleanup (config, view, filerule);
    5252    }
    5353
    5454    // include externally-supplied sources
    55     psphotLoadExtSources (config, view, "PSPHOT.INPUT");
     55    psphotLoadExtSources (config, view, filerule);
    5656
    5757    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
    58     psphotGuessModels (config, view, "PSPHOT.INPUT");
     58    psphotGuessModels (config, view, filerule);
    5959
    6060    // merge the newly selected sources into the existing list
    6161    // NOTE: merge OLD and NEW
    62     psphotMergeSources (config, view, "PSPHOT.INPUT");
     62    psphotMergeSources (config, view, filerule);
    6363
    6464    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
    65     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
     65    psphotFitSourcesLinear (config, view, filerule, false);
    6666
    6767    // identify CRs and extended sources
     
    7171
    7272    // calculate source magnitudes
    73     psphotMagnitudes(config, view, "PSPHOT.INPUT");
     73    psphotMagnitudes(config, view, filerule);
    7474
    7575    // XXX do I want to do this?
     
    8080
    8181    // replace background in residual image
    82     psphotSkyReplace (config, view, "PSPHOT.INPUT");
     82    psphotSkyReplace (config, view, filerule);
    8383
    8484    // drop the references to the image pixels held by each source
    85     psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
     85    psphotSourceFreePixels (config, view, filerule);
    8686
    8787    // create the exported-metadata and free local data
    88     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     88    return psphotReadoutCleanup (config, view, filerule);
    8989}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotGuessModels.c

    r29605 r29904  
    1212    bool status = true;
    1313
    14     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    15     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     14    int num = psphotFileruleCount(config, filerule);
    1615
    1716    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotImageLoop.c

    r29548 r29904  
    109109
    110110                // run the actual photometry analysis on this chip/cell/readout
    111                 if (!psphotReadout (config, view)) {
     111                if (!psphotReadout (config, view, "PSPHOT.INPUT")) {
    112112                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    113113                    psFree (view);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotImageQuality.c

    r29660 r29904  
    1313    psAssert (recipe, "missing recipe?");
    1414
    15     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    16     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     15    int num = psphotFileruleCount(config, filerule);
    1716
    1817    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotLoadPSF.c

    r26894 r29904  
    66
    77// XXX for now (2010.01.27), the supporting programs do not define multiple PSPHOT.PSF.LOAD
    8 // files to go with multiple PSPHOT.INPUT files.  as a result, the implementation below is
     8// files to go with multiple input files.  as a result, the implementation below is
    99// currently going to work for the case of a single input file, but will fail if we try with a
    1010// stack of images.
     
    5959}
    6060
    61 bool psphotLoadPSF (pmConfig *config, const pmFPAview *view) {
     61// PSPHOT.PSF.LOAD vs input file -- see note at top
     62bool psphotLoadPSF (pmConfig *config, const pmFPAview *view, const char *filerule) {
    6263
    63     bool status = false;
    64 
    65     // XXX PSPHOT.PSF.LOAD vs PSPHOT.INPUT -- see note at top
    66     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    67     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     64    int num = psphotFileruleCount(config, filerule);
    6865
    6966    // loop over the available readouts
     
    7168
    7269        // Generate the mask and weight images, including the user-defined analysis region of interest
    73         if (!psphotLoadPSFReadout (config, view, "PSPHOT.INPUT", "PSPHOT.PSF.LOAD", i)) {
     70        if (!psphotLoadPSFReadout (config, view, filerule, "PSPHOT.PSF.LOAD", i)) {
    7471            psError (PSPHOT_ERR_CONFIG, false, "failed to load PSF model for PSPHOT.PSF.LOAD entry %d", i);
    7572            return false;
  • branches/eam_branches/ipp-20101103/psphot/src/psphotMagnitudes.c

    r29004 r29904  
    99    psAssert (recipe, "missing recipe?");
    1010
    11     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    12     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     11    int num = psphotFileruleCount(config, filerule);
    1312
    1413    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotMakePSFImageLoop.c

    r25982 r29904  
    8484
    8585                // run the actual photometry analysis on this chip/cell/readout
    86                 if (!psphotMakePSFReadout (config, view)) {
     86                if (!psphotMakePSFReadout (config, view, "PSPHOT.INPUT")) {
    8787                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    8888                    psFree (view);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotMakePSFReadout.c

    r28013 r29904  
    11# include "psphotInternal.h"
    22
    3 bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view) {
     3bool psphotMakePSFReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
    44
    55    // measure the total elapsed time in psphotReadout.  XXX the current threading plan
     
    1919
    2020    // set the photcode for this image
    21     if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {
     21    if (!psphotAddPhotcode (config, view, filerule)) {
    2222        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    2323        return false;
     
    2929
    3030    // Generate the mask and weight images, including the user-defined analysis region of interest
    31     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     31    psphotSetMaskAndVariance (config, view, filerule);
    3232    if (!strcasecmp (breakPt, "NOTHING")) {
    33         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     33        return psphotReadoutCleanup (config, view, filerule);
    3434    }
    3535
    3636    // generate a background model (median, smoothed image)
    37     if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {
    38         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     37    if (!psphotModelBackground (config, view, filerule)) {
     38        return psphotReadoutCleanup (config, view, filerule);
    3939    }
    40     if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {
    41         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     40    if (!psphotSubtractBackground (config, view, filerule)) {
     41        return psphotReadoutCleanup (config, view, filerule);
    4242    }
    4343    if (!strcasecmp (breakPt, "BACKMDL")) {
    44         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     44        return psphotReadoutCleanup (config, view, filerule);
    4545    }
    4646
    47     psphotLoadExtSources (config, view, "PSPHOT.INPUT");
     47    psphotLoadExtSources (config, view, filerule);
    4848
    4949    // If sources have been supplied, then these should be used to measure the PSF include
     
    5353    // a text file have no valid SN values, but psphotChoosePSF needs to select the top
    5454    // PSF_MAX_NSTARS to generate the PSF.
    55     if (!psphotCheckExtSources (config, view, "PSPHOT.INPUT")) {
     55    if (!psphotCheckExtSources (config, view, filerule)) {
    5656        psLogMsg ("psphot", 3, "failure to select possible PSF sources (external or internal)");
    57         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     57        return psphotReadoutCleanup (config, view, filerule);
    5858    }
    5959
    6060    // Use bright stellar objects to measure PSF. If we do not have enough stars to generate
    6161    // the PSF, build one from the SEEING guess and model class
    62     if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {
     62    if (!psphotChoosePSF (config, view, filerule)) {
    6363        psLogMsg ("psphot", 3, "failure to construct a psf model");
    64         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     64        return psphotReadoutCleanup (config, view, filerule);
    6565    }
    6666
    6767    // measure aperture photometry corrections
    6868# if 0
    69     if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
     69    if (!psphotApResid (config, view, filerule)) {
    7070        psLogMsg ("psphot", 3, "failed on psphotApResid");
    71         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     71        return psphotReadoutCleanup (config, view, filerule);
    7272    }
    7373# endif
    7474
    75     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     75    return psphotReadoutCleanup (config, view, filerule);
    7676}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotMaskReadout.c

    r28013 r29904  
    99    psAssert (recipe, "missing recipe?");
    1010
    11     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    12     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     11    int num = psphotFileruleCount(config, filerule);
    1312
    1413    // loop over the available readouts
     
    1716        // Generate the mask and weight images, including the user-defined analysis region of interest
    1817        if (!psphotSetMaskAndVarianceReadout (config, view, filerule, i, recipe)) {
    19             psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for PSPHOT.INPUT entry %d", i);
     18            psError (PSPHOT_ERR_CONFIG, false, "failed to generate mask for %s entry %d", filerule, i);
    2019            return false;
    2120        }
  • branches/eam_branches/ipp-20101103/psphot/src/psphotMergeSources.c

    r28013 r29904  
    88bool psphotMergeSources (pmConfig *config, const pmFPAview *view, const char *filerule)
    99{
    10     bool status = true;
    11 
    12     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    13     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     10    int num = psphotFileruleCount(config, filerule);
    1411
    1512    // loop over the available readouts
     
    7067// XXX This function needs to be updated to loop over set of input files.  At the moment, we
    7168// only expect a single entry for PSPHOT.INPUT.CMF and PSPHOT.SOURCES.TEXT, so we can only
    72 // associate input sources with a single entry for PSPHOT.INPUT
     69// associate input sources with a single entry for the filerule
    7370bool psphotLoadExtSources (pmConfig *config, const pmFPAview *view, const char *filerule) {
    7471
     
    405402    bool status = true;
    406403
    407     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    408     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     404    int num = psphotFileruleCount(config, ruleSrc);
    409405
    410406    // skip the chisq image because it is a duplicate of the detection version
  • branches/eam_branches/ipp-20101103/psphot/src/psphotModelBackground.c

    r28013 r29904  
    383383}
    384384
    385 // XXX supply filename or keep PSPHOT.INPUT fixed?
    386385bool psphotModelBackground (pmConfig *config, const pmFPAview *view, const char *filerule)
    387386{
    388     bool status = false;
    389 
    390     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    391     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     387    int num = psphotFileruleCount(config, filerule);
    392388
    393389    // loop over the available readouts
    394390    for (int i = 0; i < num; i++) {
    395391        if (!psphotModelBackgroundReadoutFileIndex(config, view, filerule, i)) {
    396             psError (PSPHOT_ERR_CONFIG, false, "failed to model background for PSPHOT.INPUT entry %d", i);
     392            psError (PSPHOT_ERR_CONFIG, false, "failed to model background for %s entry %d", filerule, i);
    397393            return false;
    398394        }
  • branches/eam_branches/ipp-20101103/psphot/src/psphotOutput.c

    r29824 r29904  
    11# include "psphotInternal.h"
     2
     3// convert filerule to filerule.NUM and look up in the config->arguments metadata
     4int psphotFileruleCount(const pmConfig *config, const char *filerule) {
     5
     6    bool status = false;
     7
     8    psString name = NULL;
     9    psStringAppend(&name, "%s.NUM", filerule);
     10    int num = psMetadataLookupS32 (&status, config->arguments, name);
     11    psAssert (status, "programming error: must define %s", name);
     12    psFree (name);
     13    return num;
     14}
    215
    316pmReadout *psphotSelectBackground (pmConfig *config,
     
    117130bool psphotAddPhotcode (pmConfig *config, const pmFPAview *view, const char *filerule) {
    118131
    119     bool status = false;
    120 
    121     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    122     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     132    int num = psphotFileruleCount(config, filerule);
    123133
    124134    // loop over the available readouts
    125135    for (int i = 0; i < num; i++) {
    126136        if (!psphotAddPhotcodeReadout (config, view, filerule, i)) {
    127             psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to PSPHOT.INPUT entry %d", i);
     137          psError (PSPHOT_ERR_CONFIG, false, "failed to add photcode to %s entry %d", filerule, i);
    128138            return false;
    129139        }
  • branches/eam_branches/ipp-20101103/psphot/src/psphotRadialApertures.c

    r28013 r29904  
    1818    }
    1919
    20     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    21     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     20    int num = psphotFileruleCount(config, filerule);
    2221
    2322    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotRadialAperturesByObject.c

    r28013 r29904  
    2121
    2222    // number of images used to define sources
    23     int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    24     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     23    int nImages = psphotFileruleCount(config, filerule);
    2524
    2625    // radMax stores the upper bounds of the annuli
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReadout.c

    r29004 r29904  
    99}
    1010
    11 bool psphotReadout(pmConfig *config, const pmFPAview *view) {
     11bool psphotReadout(pmConfig *config, const pmFPAview *view, const char *filerule) {
    1212
    1313    // measure the total elapsed time in psphotReadout.  dtime is the elapsed time used jointly
     
    2828
    2929    // set the photcode for this image
    30     if (!psphotAddPhotcode (config, view, "PSPHOT.INPUT")) {
     30    if (!psphotAddPhotcode (config, view, filerule)) {
    3131        psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    3232        return false;
     
    3434
    3535    // Generate the mask and weight images, including the user-defined analysis region of interest
    36     if (!psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT")) {
    37         return psphotReadoutCleanup(config, view, "PSPHOT.INPUT");
     36    if (!psphotSetMaskAndVariance (config, view, filerule)) {
     37        return psphotReadoutCleanup(config, view, filerule);
    3838    }
    3939    if (!strcasecmp (breakPt, "NOTHING")) {
    40         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     40        return psphotReadoutCleanup (config, view, filerule);
    4141    }
    4242
    4343    // generate a background model (median, smoothed image)
    44     if (!psphotModelBackground (config, view, "PSPHOT.INPUT")) {
    45         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
    46     }
    47 
    48     if (!psphotSubtractBackground (config, view, "PSPHOT.INPUT")) {
    49         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     44    if (!psphotModelBackground (config, view, filerule)) {
     45        return psphotReadoutCleanup (config, view, filerule);
     46    }
     47
     48    if (!psphotSubtractBackground (config, view, filerule)) {
     49        return psphotReadoutCleanup (config, view, filerule);
    5050    }
    5151    if (!strcasecmp (breakPt, "BACKMDL")) {
    52         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     52        return psphotReadoutCleanup (config, view, filerule);
    5353    }
    5454
    5555    // load the psf model, if suppled.  FWHM_MAJ,FWHM_MIN,etc are determined and saved on
    56     // readout->analysis. XXX Note: this function currently only works with a single
    57     // PSPHOT.INPUT
    58     if (!psphotLoadPSF (config, view)) { // ??? need to supply 2 ?
     56    // readout->analysis. NOTE: this function currently only loads from PSPHOT.PSF.LOAD
     57    if (!psphotLoadPSF (config, view, filerule)) { // ??? need to supply 2 ?
    5958        psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model");
    60         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     59        return psphotReadoutCleanup (config, view, filerule);
    6160    }
    6261
    6362    // find the detections (by peak and/or footprint) in the image.
    64     if (!psphotFindDetections (config, view, "PSPHOT.INPUT", true)) { // pass 1
     63    if (!psphotFindDetections (config, view, filerule, true)) { // pass 1
    6564        // this only happens if we had an error in psphotFindDetections
    6665        psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
    67         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     66        return psphotReadoutCleanup (config, view, filerule);
    6867    }
    6968
    7069    // construct sources and measure basic stats (saved on detections->newSources)
    71     if (!psphotSourceStats (config, view, "PSPHOT.INPUT", true)) { // pass 1
     70    if (!psphotSourceStats (config, view, filerule, true)) { // pass 1
    7271        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    73         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     72        return psphotReadoutCleanup (config, view, filerule);
    7473    }
    7574    if (!strcasecmp (breakPt, "PEAKS")) {
    76         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     75        return psphotReadoutCleanup (config, view, filerule);
    7776    }
    7877
    7978    // find blended neighbors of very saturated stars (detections->newSources)
    80     if (!psphotDeblendSatstars (config, view, "PSPHOT.INPUT")) {
     79    if (!psphotDeblendSatstars (config, view, filerule)) {
    8180        psError (PSPHOT_ERR_UNKNOWN, false, "failed on satstar deblend analysis");
    82         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     81        return psphotReadoutCleanup (config, view, filerule);
    8382    }
    8483
    8584    // mark blended peaks PS_SOURCE_BLEND (detections->newSources)
    86     if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {
     85    if (!psphotBasicDeblend (config, view, filerule)) {
    8786        psError (PSPHOT_ERR_UNKNOWN, false, "failed on deblend analysis");
    88         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     87        return psphotReadoutCleanup (config, view, filerule);
    8988    }
    9089
    9190    // classify sources based on moments, brightness.  if a PSF model has been loaded, the PSF
    9291    // clump defined for it is used not measured (detections->newSources)
    93     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) { // pass 1
     92    if (!psphotRoughClass (config, view, filerule)) { // pass 1
    9493        psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough classifications");
    95         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     94        return psphotReadoutCleanup (config, view, filerule);
    9695    }
    9796
    9897    // if we were not supplied a PSF model, determine the IQ stats here (detections->newSources)
    99     if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) { // pass 1
     98    if (!psphotImageQuality (config, view, filerule)) { // pass 1
    10099        psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality");
    101         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     100        return psphotReadoutCleanup (config, view, filerule);
    102101    }
    103102    if (!strcasecmp (breakPt, "MOMENTS")) {
    104         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     103        return psphotReadoutCleanup (config, view, filerule);
    105104    }
    106105
    107106    // use bright stellar objects to measure PSF if we were supplied a PSF for any input file,
    108107    // this step is skipped
    109     if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) { // pass 1
     108    if (!psphotChoosePSF (config, view, filerule)) { // pass 1
    110109        psLogMsg ("psphot", 3, "failure to construct a psf model");
    111         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     110        return psphotReadoutCleanup (config, view, filerule);
    112111    }
    113112    if (!strcasecmp (breakPt, "PSFMODEL")) {
    114         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     113        return psphotReadoutCleanup (config, view, filerule);
    115114    }
    116115
    117116    // include externally-supplied sources
    118117    // XXX fix this in the new multi-input context
    119     // psphotLoadExtSources (config, view, "PSPHOT.INPUT"); // pass 1
     118    // psphotLoadExtSources (config, view, filerule); // pass 1
    120119
    121120    // construct an initial model for each object, set the radius to fitRadius, set circular
    122121    // fit mask (detections->newSources)
    123     psphotGuessModels (config, view, "PSPHOT.INPUT"); // pass 1
     122    psphotGuessModels (config, view, filerule); // pass 1
    124123
    125124    // merge the newly selected sources into the existing list
    126125    // NOTE: merge OLD and NEW
    127     psphotMergeSources (config, view, "PSPHOT.INPUT");
     126    psphotMergeSources (config, view, filerule);
    128127
    129128    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
    130     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false); // pass 1 (detections->allSources)
     129    psphotFitSourcesLinear (config, view, filerule, false); // pass 1 (detections->allSources)
    131130
    132131    // identify CRs and extended sources (only unmeasured sources are measured)
    133     psphotSourceSize (config, view, "PSPHOT.INPUT", true); // pass 1 (detections->allSources)
     132    psphotSourceSize (config, view, filerule, true); // pass 1 (detections->allSources)
    134133    if (!strcasecmp (breakPt, "ENSEMBLE")) {
    135134        goto finish;
     
    138137    // non-linear PSF and EXT fit to brighter sources
    139138    // replace model flux, adjust mask as needed, fit, subtract the models (full stamp)
    140     psphotBlendFit (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
     139    psphotBlendFit (config, view, filerule); // pass 1 (detections->allSources)
    141140
    142141    // replace all sources
    143     psphotReplaceAllSources (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
     142    psphotReplaceAllSources (config, view, filerule); // pass 1 (detections->allSources)
    144143
    145144    // linear fit to include all sources (subtract again)
    146145    // NOTE : apply to ALL sources (extended + psf)
    147     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", true); // pass 2 (detections->allSources)
     146    psphotFitSourcesLinear (config, view, filerule, true); // pass 2 (detections->allSources)
    148147
    149148    // if we only do one pass, skip to extended source analysis
     
    153152
    154153    // add noise for subtracted objects
    155     psphotAddNoise (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
     154    psphotAddNoise (config, view, filerule); // pass 1 (detections->allSources)
    156155
    157156    // find fainter sources
    158157    // NOTE: finds new peaks and new footprints, OLD and FULL set are saved on detections
    159     psphotFindDetections (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->peaks, detections->footprints)
     158    psphotFindDetections (config, view, filerule, false); // pass 2 (detections->peaks, detections->footprints)
    160159
    161160    // remove noise for subtracted objects (ie, return to normal noise level)
    162161    // NOTE: this needs to operate only on the OLD sources
    163     psphotSubNoise (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
     162    psphotSubNoise (config, view, filerule); // pass 1 (detections->allSources)
    164163
    165164    // define new sources based on only the new peaks
    166165    // NOTE: new sources are saved on detections->newSources
    167     psphotSourceStats (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->newSources)
     166    psphotSourceStats (config, view, filerule, false); // pass 2 (detections->newSources)
    168167
    169168    // set source type
    170169    // NOTE: apply only to detections->newSources
    171     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) { // pass 2 (detections->newSources)
     170    if (!psphotRoughClass (config, view, filerule)) { // pass 2 (detections->newSources)
    172171        psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
    173         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     172        return psphotReadoutCleanup (config, view, filerule);
    174173    }
    175174
    176175    // create full input models, set the radius to fitRadius, set circular fit mask
    177176    // NOTE: apply only to detections->newSources
    178     psphotGuessModels (config, view, "PSPHOT.INPUT"); // pass 2 (detections->newSources)
     177    psphotGuessModels (config, view, filerule); // pass 2 (detections->newSources)
    179178
    180179    // replace all sources so fit below applies to all at once
    181180    // NOTE: apply only to OLD sources (which have been subtracted)
    182     psphotReplaceAllSources (config, view, "PSPHOT.INPUT"); // pass 2
     181    psphotReplaceAllSources (config, view, filerule); // pass 2
    183182
    184183    // merge the newly selected sources into the existing list
    185184    // NOTE: merge OLD and NEW
    186185    // XXX check on free of sources...
    187     psphotMergeSources (config, view, "PSPHOT.INPUT"); // (detections->newSources + detections->allSources -> detections->allSources)
     186    psphotMergeSources (config, view, filerule); // (detections->newSources + detections->allSources -> detections->allSources)
    188187
    189188    // NOTE: apply to ALL sources
    190     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", true); // pass 3 (detections->allSources)
     189    psphotFitSourcesLinear (config, view, filerule, true); // pass 3 (detections->allSources)
    191190
    192191pass1finish:
     
    194193    // measure source size for the remaining sources
    195194    // NOTE: applies only to NEW (unmeasured) sources
    196     psphotSourceSize (config, view, "PSPHOT.INPUT", false); // pass 2 (detections->allSources)
    197 
    198     psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
    199     psphotExtendedSourceFits (config, view, "PSPHOT.INPUT"); // pass 1 (detections->allSources)
     195    psphotSourceSize (config, view, filerule, false); // pass 2 (detections->allSources)
     196
     197    psphotExtendedSourceAnalysis (config, view, filerule); // pass 1 (detections->allSources)
     198    psphotExtendedSourceFits (config, view, filerule); // pass 1 (detections->allSources)
    200199
    201200finish:
     
    205204
    206205    // measure aperture photometry corrections
    207     if (!psphotApResid (config, view, "PSPHOT.INPUT")) { // pass 1 (detections->allSources)
     206    if (!psphotApResid (config, view, filerule)) { // pass 1 (detections->allSources)
    208207        psLogMsg ("psphot", 3, "failed on psphotApResid");
    209         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     208        return psphotReadoutCleanup (config, view, filerule);
    210209    }
    211210
    212211    // calculate source magnitudes
    213     if (!psphotMagnitudes(config, view, "PSPHOT.INPUT")) { // pass 1 (detections->allSources)
     212    if (!psphotMagnitudes(config, view, filerule)) { // pass 1 (detections->allSources)
    214213      psErrorStackPrint(stderr, "Unable to do magnitudes.");
    215214        psErrorClear();
    216215    }
    217     if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) { // pass 1
     216    if (!psphotEfficiency(config, view, filerule)) { // pass 1
    218217        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
    219218        psErrorClear();
     
    224223
    225224    // replace background in residual image
    226     if (!psphotSkyReplace (config, view, "PSPHOT.INPUT")) { // pass 1
     225    if (!psphotSkyReplace (config, view, filerule)) { // pass 1
    227226      psErrorStackPrint(stderr, "Unable to replace sky");
    228227      psErrorClear();
    229228
    230229/*       psLogMsg("psphot", 3, "failed on psphotSkyReplace"); */
    231 /*       return(psphotReadoutCleanup(config, view, "PSPHOT.INPUT")); */
     230/*       return(psphotReadoutCleanup(config, view, filerule)); */
    232231    }
    233232    // drop the references to the image pixels held by each source
    234     if (!psphotSourceFreePixels (config, view, "PSPHOT.INPUT")) { // pass 1
     233    if (!psphotSourceFreePixels (config, view, filerule)) { // pass 1
    235234      psErrorStackPrint(stderr, "Unable to free source pixels");
    236235      psErrorClear();
    237236
    238237/*       psLogMsg ("psphot", 3, "failed on psphotSourceFreePixels"); */
    239 /*       return(psphotReadoutCleanup(config, view, "PSPHOT.INPUT")); */
     238/*       return(psphotReadoutCleanup(config, view, filerule)); */
    240239    }
    241240    // create the exported-metadata and free local data
    242     return psphotReadoutCleanup(config, view, "PSPHOT.INPUT");
     241    return psphotReadoutCleanup(config, view, filerule);
    243242}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutCleanup.c

    r28013 r29904  
    1919    psAssert (recipe, "missing recipe?");
    2020
    21     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    22     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     21    int num = psphotFileruleCount(config, filerule);
    2322
    2423    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutFindPSF.c

    r28013 r29904  
    33// in this psphotReadout-variant, we are only trying to determine the PSF given an existing set
    44// of input source positions to use as initial PSF stars.
    5 bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, psArray *inSources) {
     5bool psphotReadoutFindPSF(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) {
    66
    77    psTimerStart ("psphotReadout");
    88
    9     // set the photcode for the PSPHOT.INPUT
    10     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     9    // set the photcode for the input
     10    if (!psphotAddPhotcode(config, view, filerule)) {
    1111        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    1212        return false;
     
    1414
    1515    // Generate the mask and variance images, including the user-defined analysis region of interest
    16     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     16    psphotSetMaskAndVariance (config, view, filerule);
    1717
    1818    // Note that in this implementation, we do NOT model the background and we do not
    1919    // attempt to detect the sources in the image
    2020
    21     // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
    22     // XXX we assume a single set of input sources is supplied
    23     if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {
     21    // include the externally-supplied sources (inSources)
     22    // (we assume a single set of input sources is supplied)
     23    if (!psphotDetectionsFromSources (config, view, filerule, inSources)) {
    2424        psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
    25         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     25        return psphotReadoutCleanup (config, view, filerule);
    2626    }
    2727
    2828    // construct detections->newSources and measure basic stats (moments, local sky)
    29     if (!psphotSourceStats(config, view, "PSPHOT.INPUT", true)) {
     29    if (!psphotSourceStats(config, view, filerule, true)) {
    3030        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    3131        return false;
     
    3333
    3434    // peak flux is wrong : use the peak measured in the moments analysis:
    35     if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {
     35    if (!psphotRepairLoadedSources(config, view, filerule)) {
    3636        psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources");
    3737        return false;
     
    3939
    4040    // classify sources based on moments, brightness (psf is not known)
    41     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     41    if (!psphotRoughClass (config, view, filerule)) {
    4242        psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class");
    43         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     43        return psphotReadoutCleanup (config, view, filerule);
    4444    }
    4545
    46     if (!psphotImageQuality (config, view, "PSPHOT.INPUT")) {
     46    if (!psphotImageQuality (config, view, filerule)) {
    4747        psError (PSPHOT_ERR_UNKNOWN, false, "failed to measure image quality");
    48         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     48        return psphotReadoutCleanup (config, view, filerule);
    4949    }
    5050
    51     if (!psphotChoosePSF(config, view, "PSPHOT.INPUT")) {
     51    if (!psphotChoosePSF(config, view, filerule)) {
    5252        psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
    53         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     53        return psphotReadoutCleanup (config, view, filerule);
    5454    }
    5555
     
    5959    // fits from that analysis, or run the linear PSF fit for all objects currently in hand
    6060    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
    61     psphotGuessModels (config, view, "PSPHOT.INPUT");
     61    psphotGuessModels (config, view, filerule);
    6262# endif
    6363
    6464    // merge the newly selected sources into the existing list
    6565    // NOTE: merge OLD and NEW
    66     psphotMergeSources (config, view, "PSPHOT.INPUT");
     66    psphotMergeSources (config, view, filerule);
    6767
    6868# if 0
    6969    // measure aperture photometry corrections
    70     if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
     70    if (!psphotApResid (config, view, filerule)) {
    7171        psLogMsg ("psphot", 3, "failed on psphotApResid");
    72         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     72        return psphotReadoutCleanup (config, view, filerule);
    7373    }
    7474# endif
    7575
    7676    // drop the references to the image pixels held by each source
    77     psphotSourceFreePixels(config, view, "PSPHOT.INPUT");
     77    psphotSourceFreePixels(config, view, filerule);
    7878
    7979    // create the exported-metadata and free local data
    80     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     80    return psphotReadoutCleanup (config, view, filerule);
    8181}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutKnownSources.c

    r28013 r29904  
    33// in this psphotReadout-variant, we are only measuring the photometry for known sources, using
    44// a PSF generated for this observation from those sources
    5 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, psArray *inSources) {
     5bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) {
    66
    77    psTimerStart ("psphotReadout");
    88
    99    // set the photcode for this image
    10     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     10    if (!psphotAddPhotcode(config, view, filerule)) {
    1111        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    1212        return false;
     
    1414
    1515    // Generate the mask and weight images, including the user-defined analysis region of interest
    16     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     16    psphotSetMaskAndVariance (config, view, filerule);
    1717
    1818    // Note that in this implementation, we do NOT model the background and we do not
     
    2020
    2121    // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
    22     if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {
     22    if (!psphotDetectionsFromSources (config, view, filerule, inSources)) {
    2323        psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
    24         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     24        return psphotReadoutCleanup (config, view, filerule);
    2525    }
    2626
    2727    // construct sources and measure basic stats
    28     if (!psphotSourceStats (config, view, "PSPHOT.INPUT", true)) {
     28    if (!psphotSourceStats (config, view, filerule, true)) {
    2929        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    3030        return false;
     
    3232
    3333    // peak flux is wrong : use the peak measured in the moments analysis:
    34     if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {
     34    if (!psphotRepairLoadedSources(config, view, filerule)) {
    3535        psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources");
    3636        return false;
     
    3838
    3939    // classify sources based on moments, brightness (psf is not known)
    40     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     40    if (!psphotRoughClass (config, view, filerule)) {
    4141        psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class");
    42         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     42        return psphotReadoutCleanup (config, view, filerule);
    4343    }
    4444
    45     if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {
     45    if (!psphotChoosePSF (config, view, filerule)) {
    4646        psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
    47         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     47        return psphotReadoutCleanup (config, view, filerule);
    4848    }
    4949
    5050    // construct an initial model for each object
    51     psphotGuessModels (config, view, "PSPHOT.INPUT");
     51    psphotGuessModels (config, view, filerule);
    5252
    5353    // merge the newly selected sources into the existing list
    5454    // NOTE: merge OLD and NEW
    55     psphotMergeSources (config, view, "PSPHOT.INPUT");
     55    psphotMergeSources (config, view, filerule);
    5656
    5757    // linear PSF fit to source peaks
    58     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
     58    psphotFitSourcesLinear (config, view, filerule, false);
    5959
    6060    // measure aperture photometry corrections
    61     if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
     61    if (!psphotApResid (config, view, filerule)) {
    6262        psLogMsg ("psphot", 3, "failed on psphotApResid");
    63         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     63        return psphotReadoutCleanup (config, view, filerule);
    6464    }
    6565
    6666    // calculate source magnitudes
    67     psphotMagnitudes(config, view, "PSPHOT.INPUT");
     67    psphotMagnitudes(config, view, filerule);
    6868
    6969    // drop the references to the image pixels held by each source
    70     psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
     70    psphotSourceFreePixels (config, view, filerule);
    7171
    7272    // create the exported-metadata and free local data
    73     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     73    return psphotReadoutCleanup (config, view, filerule);
    7474}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReadoutMinimal.c

    r28013 r29904  
    77// NOTE: ppSub needs to perform extended source analysis for comets and trails.
    88
    9 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view) {
     9bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule) {
    1010
    1111    // measure the total elapsed time in psphotReadout.  XXX the current threading plan
     
    1818
    1919    // set the photcode for this image
    20     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     20    if (!psphotAddPhotcode(config, view, filerule)) {
    2121        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    2222        return false;
     
    2424
    2525    // Generate the mask and weight images, including the user-defined analysis region of interest
    26     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     26    psphotSetMaskAndVariance (config, view, filerule);
    2727
    2828    // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved on readout->analysis
    29     if (!psphotLoadPSF (config, view)) {
     29    if (!psphotLoadPSF (config, view, filerule)) {
    3030      psError (PSPHOT_ERR_CONFIG, false, "missing psf model");
    31       return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     31      return psphotReadoutCleanup (config, view, filerule);
    3232    }
    3333
    3434    // find the detections (by peak and/or footprint) in the image. (final pass)
    35     if (!psphotFindDetections(config, view, "PSPHOT.INPUT", false)) {
     35    if (!psphotFindDetections(config, view, filerule, false)) {
    3636        psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
    37         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     37        return psphotReadoutCleanup (config, view, filerule);
    3838    }
    3939
    4040    // construct sources and measure basic stats (saved on detections->newSources)
    41     if (!psphotSourceStats (config, view, "PSPHOT.INPUT", false)) { // pass 1
     41    if (!psphotSourceStats (config, view, filerule, false)) { // pass 1
    4242        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    43         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     43        return psphotReadoutCleanup (config, view, filerule);
    4444    }
    4545
    4646    // find blended neighbors of very saturated stars
    47     psphotDeblendSatstars (config, view, "PSPHOT.INPUT");
     47    psphotDeblendSatstars (config, view, filerule);
    4848
    4949    // mark blended peaks PS_SOURCE_BLEND
    50     if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {
     50    if (!psphotBasicDeblend (config, view, filerule)) {
    5151        psLogMsg ("psphot", 3, "failed on deblend analysis");
    52         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     52        return psphotReadoutCleanup (config, view, filerule);
    5353    }
    5454
    5555    // classify sources based on moments, brightness (use supplied psf shape parameters)
    56     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     56    if (!psphotRoughClass (config, view, filerule)) {
    5757        psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
    58         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     58        return psphotReadoutCleanup (config, view, filerule);
    5959    }
    6060
    6161    // construct an initial model for each object
    62     psphotGuessModels (config, view, "PSPHOT.INPUT");
     62    psphotGuessModels (config, view, filerule);
    6363
    6464    // merge the newly selected sources into the existing list
    65     psphotMergeSources (config, view, "PSPHOT.INPUT");
     65    psphotMergeSources (config, view, filerule);
    6666
    6767    // linear PSF fit to source peaks
    68     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
     68    psphotFitSourcesLinear (config, view, filerule, false);
    6969
    7070// XXX eventually, add the extended source fits here
    7171# if (0)
    7272    // measure source size for the remaining sources
    73     psphotSourceSize (config, view, "PSPHOT.INPUT");
     73    psphotSourceSize (config, view, filerule);
    7474
    75     psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT");
     75    psphotExtendedSourceAnalysis (config, view, filerule);
    7676
    77     psphotExtendedSourceFits (config, view, "PSPHOT.INPUT");
     77    psphotExtendedSourceFits (config, view, filerule);
    7878# endif
    7979
    8080    // calculate source magnitudes
    81     psphotMagnitudes(config, view, "PSPHOT.INPUT");
     81    psphotMagnitudes(config, view, filerule);
    8282
    8383    // XXX ensure this is measured if the analysis succeeds (even if quality is low)
    84     if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) {
     84    if (!psphotEfficiency(config, view, filerule)) {
    8585        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
    8686        psErrorClear();
     
    8888
    8989    // drop the references to the image pixels held by each source
    90     psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
     90    psphotSourceFreePixels (config, view, filerule);
    9191
    9292    // create the exported-metadata and free local data
    93     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     93    return psphotReadoutCleanup (config, view, filerule);
    9494}
  • branches/eam_branches/ipp-20101103/psphot/src/psphotReplaceUnfit.c

    r28013 r29904  
    3131    psAssert (recipe, "missing recipe?");
    3232
    33     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    34     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     33    int num = psphotFileruleCount(config, filerule);
    3534
    3635    // loop over the available readouts
    3736    for (int i = 0; i < num; i++) {
    3837        if (!psphotReplaceAllSourcesReadout (config, view, filerule, i, recipe)) {
    39             psError (PSPHOT_ERR_CONFIG, false, "failed to replace all sources for PSPHOT.INPUT entry %d", i);
     38            psError (PSPHOT_ERR_CONFIG, false, "failed to replace all sources for %s entry %d", filerule, i);
    4039            return false;
    4140        }
  • branches/eam_branches/ipp-20101103/psphot/src/psphotRoughClass.c

    r28425 r29904  
    1616    psAssert (recipe, "missing recipe?");
    1717
    18     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    19     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     18    int num = psphotFileruleCount(config, filerule);
    2019
    2120    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSkyReplace.c

    r28013 r29904  
    55    bool status = true;
    66
    7     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    8     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     7    int num = psphotFileruleCount(config, filerule);
    98
    109    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSourceFreePixels.c

    r28013 r29904  
    33bool psphotSourceFreePixels (pmConfig *config, const pmFPAview *view, const char *filerule)
    44{
    5     bool status = true;
    6 
    7     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    8     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     5    int num = psphotFileruleCount(config, filerule);
    96
    107    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSourceMatch.c

    r29548 r29904  
    66psArray *psphotMatchSources (pmConfig *config, const pmFPAview *view, const char *filerule)
    77{
    8     bool status = true;
    9 
    108    psArray *objects = psArrayAllocEmpty(100);
    119
    12     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    13     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     10    int num = psphotFileruleCount(config, filerule);
    1411
    1512    // loop over the available readouts
    1613    for (int i = 0; i < num; i++) {
    1714        if (!psphotMatchSourcesReadout (objects, config, view, filerule, i)) {
    18             psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for PSPHOT.INPUT entry %d", i);
     15            psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for %s entry %d", filerule, i);
    1916            psFree (objects);
    2017            return NULL;
     
    162159    psAssert (status, "missing SKY_OUTER_RADIUS in recipe?");
    163160
    164     int nImages = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    165     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     161    int nImages = psphotFileruleCount(config, filerule);
    166162
    167163    // generate look-up arrays for detections and readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSourceSize.c

    r29610 r29904  
    4949    psAssert (recipe, "missing recipe?");
    5050
    51     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    52     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     51    int num = psphotFileruleCount(config, filerule);
    5352
    5453    // skip the chisq image (optionally?)
     
    6059        if (i == chisqNum) continue; // skip chisq image
    6160        if (!psphotSourceSizeReadout (config, view, filerule, i, recipe, getPSFsize)) {
    62             psError (PSPHOT_ERR_CONFIG, false, "failed on source size analysis for PSPHOT.INPUT entry %d", i);
     61            psError (PSPHOT_ERR_CONFIG, false, "failed on source size analysis for %s entry %d", filerule, i);
    6362            return false;
    6463        }
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSourceStats.c

    r29604 r29904  
    1414    psAssert (recipe, "missing recipe?");
    1515
    16     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    17     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     16    int num = psphotFileruleCount(config, filerule);
    1817
    1918    // skip the chisq image (optionally?)
  • branches/eam_branches/ipp-20101103/psphot/src/psphotStackChisqImage.c

    r28013 r29904  
    88bool psphotStackChisqImage (pmConfig *config, const pmFPAview *view, const char *ruleDet, const char *ruleCnv)
    99{
    10     bool status = false;
    11 
    1210    psTimerStart ("psphot.chisq.image");
    1311
     
    1715    pmReadout *chiReadout = NULL;
    1816
    19     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    20     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     17    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    2118
    2219    // loop over the available readouts
     
    2825        }
    2926    }
    30 
    31     num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    32     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
    3327
    3428    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "PSPHOT.CHISQ.NUM", PS_META_REPLACE, "", num);
     
    125119    psAssert (status, "programming error: must define PSPHOT.CHISQ.NUM");
    126120
    127     int inputNum = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    128     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     121    int inputNum = psphotFileruleCount(config, "PSPHOT.INPUT");
    129122
    130123    pmFPAfileRemoveSingle (config->files, filerule, chisqNum);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotStackImageLoop.c

    r28013 r29904  
    105105bool GetAstrometryFPA (pmConfig *config, pmFPAview *view) {
    106106
    107     bool status = false;
    108 
    109107    bool foundAstrometry = false;
    110108    bool bilevelAstrometry = false;
    111109
    112     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    113     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     110    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    114111
    115112    // loop over the available readouts
     
    158155bool GetAstrometryChip (pmConfig *config, pmFPAview *view, bool bilevelAstrometry) {
    159156
    160     bool status = false;
    161 
    162     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    163     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     157    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    164158
    165159    // loop over the available readouts
     
    220214bool SetAstrometryFPA (pmConfig *config, pmFPAview *view, bool bilevelAstrometry) {
    221215
    222     bool status = false;
    223 
    224216    if (!bilevelAstrometry) return true;
    225217
    226     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    227     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     218    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    228219
    229220    // loop over the available readouts
  • branches/eam_branches/ipp-20101103/psphot/src/psphotStackMatchPSFs.c

    r29548 r29904  
    88    psAssert(recipe, "We've thrown an error on this before.");
    99
    10     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    11     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     10    int num = psphotFileruleCount(config, "PSPHOT.INPUT");
    1211
    1312    // 'options' carries info needed to perform the stack matching
  • branches/eam_branches/ipp-20101103/psphot/src/psphotStackReadout.c

    r29548 r29904  
    5252    // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are determined and saved on
    5353    // readout->analysis XXX this function currently only works with a single PSPHOT.INPUT
    54     if (!psphotLoadPSF (config, view)) {
     54    if (!psphotLoadPSF (config, view, STACK_RAW)) {
    5555        psError (PSPHOT_ERR_UNKNOWN, false, "error loading psf model");
    5656        return psphotReadoutCleanup (config, view, STACK_OUT);
  • branches/eam_branches/ipp-20101103/psphot/src/psphotSubtractBackground.c

    r28013 r29904  
    132132    psAssert (recipe, "missing recipe?");
    133133
    134     int num = psMetadataLookupS32 (&status, config->arguments, "PSPHOT.INPUT.NUM");
    135     psAssert (status, "programming error: must define PSPHOT.INPUT.NUM");
     134    int num = psphotFileruleCount(config, filerule);
    136135
    137136    // loop over the available readouts
    138137    for (int i = 0; i < num; i++) {
    139138        if (!psphotSubtractBackgroundReadout (config, view, filerule, i, recipe)) {
    140             psError (PSPHOT_ERR_CONFIG, false, "failed to subtract background for PSPHOT.INPUT entry %d", i);
     139            psError (PSPHOT_ERR_CONFIG, false, "failed to subtract background for %s entry %d", filerule, i);
    141140            return false;
    142141        }
Note: See TracChangeset for help on using the changeset viewer.