IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 26, 2006, 2:12:20 PM (20 years ago)
Author:
jhoblitt
Message:

implement -search -use_begin & -use_end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/detselectConfig.c

    r9403 r9752  
    5656    psMetadataAddF32(searchArgs, PS_LIST_TAIL, "-airmass", 0,
    5757            "define airmass", NAN);
     58    psMetadataAddStr(searchArgs, PS_LIST_TAIL, "-use_begin", 0,
     59            "define start (>=) of detrend validity peroid", NULL);
     60    psMetadataAddStr(searchArgs, PS_LIST_TAIL, "-use_end", 0,
     61            "define end (< of detrend validity peroid", NULL);
    5862    psMetadataAddBool(searchArgs, PS_LIST_TAIL, "-simple",  0,
    5963            "use the simple output format", false);
     
    136140    } \
    137141}
     142
    138143#define addWhereS32(name) \
    139144{ \
     
    173178            } \
    174179        } \
     180    } \
     181}
     182
     183#define addWhereTimeStr(name) \
     184{ \
     185    psString str = NULL; \
     186    bool status = false; \
     187    if ((str = psMetadataLookupStr(&status, config->args, "-" #name))) { \
     188        psTime *time = psTimeFromISO(str, PS_TIME_UTC); \
     189        if (!time) { \
     190            psError(PS_ERR_UNKNOWN, false, "failed to convert " #name " into a psTime object"); \
     191            goto FAIL; \
     192        } \
     193        psMetadataItem *item = psMetadataLookup(config->args, "-" #name); \
     194        if (item) { \
     195            str = item->comment; \
     196        } else { \
     197            str = NULL; \
     198        } \
     199        if (!psMetadataAddTime(config->where, PS_LIST_TAIL, #name, 0, str, time)) {\
     200            psError(PS_ERR_UNKNOWN, false, "failed to add item " #name); \
     201            goto FAIL; \
     202        } \
     203        psFree(time); \
    175204    } \
    176205}
     
    202231    addWhereF64(ccd_temp);
    203232    addWhereF32(airmass);
     233    addWhereTimeStr(use_begin);
     234    addWhereTimeStr(use_end);
    204235
    205236    if (config->where->list->n < 1) {
     
    220251    config->argc = argc;
    221252
    222 
    223253    return config;
    224254
Note: See TracChangeset for help on using the changeset viewer.