IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11876


Ignore:
Timestamp:
Feb 18, 2007, 11:03:20 AM (19 years ago)
Author:
magnier
Message:

adding version, exptime, twilight, dettemp to detrend options; adding bools to track selections

Location:
trunk/psModules/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r11801 r11876  
    784784    // added if specified for the particular detrend type by the DETREND.CONSTRAINTS
    785785    // note that the filter-dependent choices are set for ppImage in ppImageParseCamera
     786    // XXX make all of the detrend constraints explicit in DETREND.CONSTRAINTS?
    786787
    787788    // Get the time from FPA.TIME
     
    793794
    794795    // add additional constraints based on the type defined in the PPIMAGE recipe
    795     // use PPIMAGE or DETREND or ???
     796    // XXX use PPIMAGE or DETREND for the recipe name?
    796797    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PPIMAGE");
    797798    if (!status)
     
    819820        char *concept = item->data.V;
    820821
     822        // these items refer to the corresponding values for the input image
     823        // (ie, -filter input:filter or -exptime input:exptime)
    821824        if (!strcasecmp (option, "filter")) {
    822825            options->filter = psMetadataLookupPtr (&status, input->concepts, concept);
     826            psMemIncrRefCounter (options->filter);
    823827            if (!status)
    824828                psAbort("failed to find filter (concept %s)", concept);
     
    827831        if (!strcasecmp (option, "exptime")) {
    828832            options->exptime = psMetadataLookupF32 (&status, input->concepts, concept);
     833            options->exptimeSet = true;
    829834            if (!status)
    830835                psAbort("exptime not found (concept %s)", concept);
     
    832837        if (!strcasecmp (option, "airmass")) {
    833838            options->airmass = psMetadataLookupF32 (&status, input->concepts, concept);
     839            options->airmassSet = true;
    834840            if (!status)
    835841                psAbort("airmass not found (concept %s)", concept);
    836842        }
    837         # if (0)
    838             if (!strcasecmp (option, "dettemp")) {
    839                 options->dettemp = psMetadataLookupF32 (&status, input->concepts, concept);
    840                 if (!status)
    841                     psAbort("dettemp not found (concept %s)", concept);
    842             }
    843         if (!strcasecmp (option, "version")) {
    844             // version is applied as a literal string
    845             options->version = psMetadataLookupF32 (&status, input->concepts, concept);
    846             if (!status)
    847                 psAbort("version not found (concept %s)", concept);
    848         }
     843        if (!strcasecmp (option, "dettemp")) {
     844            options->dettemp = psMetadataLookupF32 (&status, input->concepts, concept);
     845            options->dettempSet = true;
     846            if (!status)
     847                psAbort("dettemp not found (concept %s)", concept);
     848        }
    849849        if (!strcasecmp (option, "twilight")) {
    850             // XXX determine the twilight time based on concept defining the time-of-day
    851             // XXX need to include twilight time somehow (uses lookup based on a time value)
    852850            options->twilight = psMetadataLookupF32 (&status, input->concepts, concept);
     851            options->twilightSet = true;
    853852            if (!status)
    854853                psAbort("twilight not found (concept %s)", concept);
    855854        }
    856         # endif
    857 
     855
     856        // the version is applied literally
     857        if (!strcasecmp (option, "version")) {
     858            options->version = psMemIncrRefCounter (concept);
     859        }
     860        // we can override the detrend database dettype if desired
     861        // ie, use DOMEFLAT for type FLAT
     862        // the dettype string is applied literally
     863        if (!strcasecmp (option, "dettype")) {
     864            options->dettype = psMemIncrRefCounter (concept);
     865        }
    858866    }
    859867    psFree(iter);
  • trunk/psModules/src/detrend/pmDetrendDB.c

    r11508 r11876  
    2424
    2525    psFree (options->camera);
     26    psFree (options->filter);
     27    psFree (options->dettype);
     28    psFree (options->version);
    2629
    2730    return;
     
    4144
    4245    // these other options depend on the type of detrend data
    43     options->filter = NULL;  //
    44     options->exptime = -1.0; // the undefined value (safe since exptime >= 0)
    45     options->airmass = -1.0; // the undefined value (safe since airmass >= 1)
     46    options->filter   = NULL;
     47    options->version  = NULL;
     48    options->dettype  = NULL;
     49    options->exptime  = 0.0;
     50    options->airmass  = 0.0;
     51    options->dettemp  = 0.0;
     52    options->twilight = 0.0;
     53
     54    options->exptimeSet  = false; // not selected
     55    options->airmassSet  = false; // not selected
     56    options->dettempSet  = false; // not selected
     57    options->twilightSet = false; // not selected
    4658
    4759    return options;
     
    105117    psString line = NULL;
    106118    char *time = psTimeToISO (&options->time);
    107     char *type = pmDetrendTypeToString (options->type);
     119
     120    char *type = NULL;
     121    if (options->dettype) {
     122        type = psMemIncrRefCounter (options->dettype);
     123    } else {
     124        type = pmDetrendTypeToString (options->type);
     125    }
    108126    unsigned int nFail;
    109127
     
    114132        psStringAppend(&line, " -filter %s", options->filter);
    115133    }
    116     if (options->exptime > -1.0) {
     134    if (options->version) {
     135        psStringAppend(&line, " -version %s", options->version);
     136    }
     137    if (options->exptimeSet) {
    117138        psStringAppend(&line, " -exp_time %f", options->exptime);
    118139    }
    119     if (options->airmass > -1.0) {
     140    if (options->airmassSet) {
    120141        psStringAppend(&line, " -airmass %f", options->airmass);
     142    }
     143    if (options->dettempSet) {
     144        psStringAppend(&line, " -airmass %f", options->dettemp);
     145    }
     146    if (options->twilightSet) {
     147        psStringAppend(&line, " -airmass %f", options->twilight);
    121148    }
    122149
  • trunk/psModules/src/detrend/pmDetrendDB.h

    r11450 r11876  
    99 * @author EAM, IfA
    1010 *
    11  * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    12  * @date $Date: 2007-01-31 00:35:24 $
     11 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     12 * @date $Date: 2007-02-18 21:03:20 $
    1313 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii
    1414 */
     
    3737typedef struct
    3838{
    39     char *camera;   // name of camera
    40     psTime time;   // time of input data
    41     pmDetrendType type;   // type of detrend data
    42     char *filter;   // name of filter
    43     float exptime;   // exposure time (for dark, maybe flat & fringe)
    44     float airmass;   // for fringe
     39    char *camera;                       // name of camera
     40    char *version;                      // optional version string
     41    char *filter;                       // name of filter
     42    char *dettype;                      // actual detrend type name
     43    float exptime;                      // exposure time (for dark, maybe flat & fringe)
     44    float airmass;                      // for fringe
     45    float dettemp;                      // for fringe
     46    float twilight;                     // hours (or seconds?) since/before nearest twilight
     47    psTime time;                        // time of input data
     48    pmDetrendType type;                 // type of detrend data
     49
     50    bool  exptimeSet;
     51    bool  airmassSet;
     52    bool  dettempSet;
     53    bool  twilightSet;
    4554}
    4655pmDetrendSelectOptions;
Note: See TracChangeset for help on using the changeset viewer.