IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 5, 2009, 11:13:29 AM (17 years ago)
Author:
beaumont
Message:

Finished ppStack visualization. Unified the way in which visualizations are invoked, plotting windows are closed, etc

Location:
branches/cnb_branches/cnb_branch_20090215
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090215

  • branches/cnb_branches/cnb_branch_20090215/psModules/src/concepts/pmConceptsStandard.c

    r21183 r23197  
    116116                        if (!isfinite(gain)) {
    117117                            psWarning("CELL.READNOISE is supposed to be in ADU, but CELL.GAIN isn't set -- forcing to 1.0");
    118                             gain = 1.0;
     118                            gain = 1.0;
    119119                        }
    120120                        rn /= gain;
     
    639639}
    640640
     641// Determine the corresponding TIMESYS for one of the TIME concepts
     642static psTimeType conceptGetTimesysForTime(const char *name, // Concept name ("CELL.TIME" or "FPA.TIME")
     643                                           const pmFPA *fpa, // FPA of interest
     644                                           const pmChip *chip, // Chip of interest, or NULL
     645                                           const pmCell *cell // Cell of interest, or NULL
     646                                           )
     647{
     648    assert(name);
     649
     650    psString timesysName = psStringCopy(name); // e.g., "CELL.TIME" --> "CELL.TIMESYS"
     651    psStringSubstitute(&timesysName, "TIMESYS", "TIME");
     652    bool mdok = false;                  // Result of MD lookup
     653    psTimeType timeSys = 0xFFFFFFFF;    // The time system
     654    if (cell) {
     655        timeSys = psMetadataLookupS32(&mdok, cell->concepts, timesysName);
     656    }
     657    if (!mdok && chip) {
     658        timeSys = psMetadataLookupS32(&mdok, chip->concepts, timesysName);
     659    }
     660    if (!mdok && fpa) {
     661        timeSys = psMetadataLookupS32(&mdok, fpa->concepts, timesysName);
     662    }
     663    if (!mdok || (timeSys == 0xFFFFFFFF)) {
     664        psWarning("Unable to find %s in concepts when parsing %s --- assuming UTC.\n",
     665                  timesysName, name);
     666        timeSys = PS_TIME_UTC;
     667    }
     668    psFree(timesysName);
     669
     670    return timeSys;
     671}
     672
    641673psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept,
    642674                                      const psMetadataItem *pattern,
     
    650682    assert(cameraFormat);
    651683
    652     // Need TIMESYS first
    653     psString timesysName = psStringCopy(pattern->name); // e.g., "CELL.TIME" --> "CELL.TIMESYS"
    654     psStringSubstitute(&timesysName, "TIMESYS", "TIME");
    655     bool mdok = false;                  // Result of MD lookup
    656     psTimeType timeSys = PS_TIME_UTC; // The time system
    657     if (cell) {
    658         timeSys = psMetadataLookupS32(&mdok, cell->concepts, timesysName);
    659     }
    660     if (!mdok && chip) {
    661         timeSys = psMetadataLookupS32(&mdok, chip->concepts, timesysName);
    662     }
    663     if (!mdok && fpa) {
    664         timeSys = psMetadataLookupS32(&mdok, fpa->concepts, timesysName);
    665     }
    666     if (!mdok || (timeSys == 0xffffffff)) {
    667         psWarning("Unable to find %s in concepts when parsing %s --- assuming UTC.\n",
    668                   timesysName, pattern->name);
    669         timeSys = PS_TIME_UTC;
    670     }
    671     psFree(timesysName);
     684    psTimeType timeSys = conceptGetTimesysForTime(pattern->name, fpa, chip, cell); // Time system
    672685
    673686    // Work out how the time is represented
     
    681694
    682695    // Get format
     696    bool mdok;                          // Status of MD lookup
    683697    psMetadata *formats = psMetadataLookupMetadata(&mdok, cameraFormat, "FORMATS");
    684698    if (!mdok || !formats) {
     
    877891    }
    878892
     893    time->type = timeSys;
     894
    879895    psMetadataItem *item = psMetadataItemAllocPtr(pattern->name, PS_DATA_TIME, pattern->comment, time);
    880896    psFree(time);                       // Drop reference
     
    11321148{
    11331149    psTime *time = concept->data.V;     // The time
     1150
     1151    psTimeType timeSys = conceptGetTimesysForTime(concept->name, fpa, chip, cell); // Time system
     1152    psTimeConvert(time, timeSys);
    11341153
    11351154    // Work out the format
     
    13311350
    13321351
     1352psMetadataItem *p_pmConceptCopy_TIMESYS(const psMetadataItem *target,
     1353                                        const psMetadataItem *source,
     1354                                        const psMetadata *cameraFormat,
     1355                                        const pmFPA *fpa,
     1356                                        const pmChip *chip,
     1357                                        const pmCell *cell)
     1358{
     1359    if (!target || target->data.S32 == -1) {
     1360        // Replace
     1361        return psMetadataItemCopy(source);
     1362    }
     1363    // Keep what we've got --- it's been mandated by use of the DEFAULTS
     1364    return psMemIncrRefCounter((psMetadataItem*)target);
     1365}
Note: See TracChangeset for help on using the changeset viewer.