Changeset 23197 for branches/cnb_branches/cnb_branch_20090215/psModules/src/concepts/pmConceptsStandard.c
- Timestamp:
- Mar 5, 2009, 11:13:29 AM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psModules/src/concepts/pmConceptsStandard.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
-
branches/cnb_branches/cnb_branch_20090215/psModules/src/concepts/pmConceptsStandard.c
r21183 r23197 116 116 if (!isfinite(gain)) { 117 117 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; 119 119 } 120 120 rn /= gain; … … 639 639 } 640 640 641 // Determine the corresponding TIMESYS for one of the TIME concepts 642 static 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(×ysName, "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 641 673 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept, 642 674 const psMetadataItem *pattern, … … 650 682 assert(cameraFormat); 651 683 652 // Need TIMESYS first 653 psString timesysName = psStringCopy(pattern->name); // e.g., "CELL.TIME" --> "CELL.TIMESYS" 654 psStringSubstitute(×ysName, "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 672 685 673 686 // Work out how the time is represented … … 681 694 682 695 // Get format 696 bool mdok; // Status of MD lookup 683 697 psMetadata *formats = psMetadataLookupMetadata(&mdok, cameraFormat, "FORMATS"); 684 698 if (!mdok || !formats) { … … 877 891 } 878 892 893 time->type = timeSys; 894 879 895 psMetadataItem *item = psMetadataItemAllocPtr(pattern->name, PS_DATA_TIME, pattern->comment, time); 880 896 psFree(time); // Drop reference … … 1132 1148 { 1133 1149 psTime *time = concept->data.V; // The time 1150 1151 psTimeType timeSys = conceptGetTimesysForTime(concept->name, fpa, chip, cell); // Time system 1152 psTimeConvert(time, timeSys); 1134 1153 1135 1154 // Work out the format … … 1331 1350 1332 1351 1352 psMetadataItem *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.
