IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23404


Ignore:
Timestamp:
Mar 18, 2009, 3:12:15 PM (17 years ago)
Author:
Paul Price
Message:

If the time is parsed from JD or MJD, then set the time system to be TAI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsStandard.c

    r23296 r23404  
    670670    return timeSys;
    671671}
     672
     673// Set the corresponding TIMESYS for one of the TIME concepts
     674static bool conceptSetTimesysForTime(const char *name, // Concept name ("CELL.TIME" or "FPA.TIME")
     675                                     const pmFPA *fpa, // FPA of interest
     676                                     const pmChip *chip, // Chip of interest, or NULL
     677                                     const pmCell *cell, // Cell of interest, or NULL
     678                                     psTimeType timeSys // The time system value
     679                                     )
     680{
     681    assert(name);
     682
     683    psString timesysName = psStringCopy(name); // e.g., "CELL.TIME" --> "CELL.TIMESYS"
     684    psStringSubstitute(&timesysName, "TIMESYS", "TIME");
     685    psMetadataItem *item = NULL;        // Item with time system
     686    if (cell) {
     687        item = psMetadataLookup(cell->concepts, timesysName);
     688    }
     689    if (!item && chip) {
     690        item = psMetadataLookup(chip->concepts, timesysName);
     691    }
     692    if (!item && fpa) {
     693        item = psMetadataLookup(fpa->concepts, timesysName);
     694    }
     695    if (!item) {
     696        psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find %s in concepts when setting %s\n",
     697                timesysName, name);
     698        return false;
     699    }
     700
     701    item->data.S32 = timeSys;
     702
     703    return true;
     704}
     705
    672706
    673707psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept,
     
    896930    }
    897931
    898     time->type = timeSys;
     932    if (jdTime || mjdTime) {
     933        conceptSetTimesysForTime(pattern->name, fpa, chip, cell, PS_TIME_TAI);
     934    } else {
     935        time->type = timeSys;
     936    }
    899937
    900938    psMetadataItem *item = psMetadataItemAllocPtr(pattern->name, PS_DATA_TIME, pattern->comment, time);
Note: See TracChangeset for help on using the changeset viewer.