IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

add -dateobs params to -update[imfile|exp]

File:
1 edited

Legend:

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

    r9392 r9682  
    762762    }
    763763    psF32 exp_time = psMetadataLookupF32(&status, config->args, "-exp_time");
    764     if (isnan(exp_time)) {
     764    if (!status) {
    765765        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_time");
    766766        return false;
     
    839839        return false;
    840840    }
    841 
    842     return rawDetrendExpRowAlloc(
     841    psTime *dateobs = NULL;
     842    {
     843        psString dateobsStr = psMetadataLookupStr(&status, config->args, "-dateobs");
     844        if (!status) {
     845            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dateobs");
     846            return false;
     847        }
     848        // pass through NULL as this is an optional field
     849        if (dateobsStr) {
     850            dateobs = psTimeFromISO(dateobsStr, PS_TIME_UTC);
     851        } else {
     852            dateobs = NULL;
     853        }
     854    }
     855
     856    rawDetrendExpRow *raw = rawDetrendExpRowAlloc(
    843857        exp->exp_tag,
    844858        exp->camera,
     
    858872        ccd_temp,
    859873        posang,
    860         object
     874        object,
     875        dateobs
    861876    );
     877
     878    if (dateobs) {
     879        psFree(dateobs);
     880    }
     881
     882    return raw;
    862883}
    863884
     
    9921013    }
    9931014
    994     return rawImfileRowAlloc(
     1015    psTime *dateobs = NULL;
     1016    {
     1017        psString dateobsStr = psMetadataLookupStr(&status, config->args, "-dateobs");
     1018        if (!status) {
     1019            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -dateobs");
     1020            return false;
     1021        }
     1022        dateobs = psTimeFromISO(dateobsStr, PS_TIME_UTC);
     1023    }
     1024
     1025    rawImfileRow *raw = rawImfileRowAlloc(
    9951026        imfile->exp_tag,
    9961027        imfile->class,
     
    10101041        ccd_temp,
    10111042        posang,
    1012         object
     1043        object,
     1044        dateobs
    10131045    );
    1014 }
    1015 
     1046
     1047    psFree(dateobs);
     1048
     1049    return raw;
     1050}
     1051
Note: See TracChangeset for help on using the changeset viewer.