IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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        }
Note: See TracChangeset for help on using the changeset viewer.