Changeset 5462 for trunk/archive/scripts/src/phase2/pmFPAConceptsGet.c
- Timestamp:
- Nov 2, 2005, 3:30:32 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/phase2/pmFPAConceptsGet.c
r5371 r5462 100 100 psMetadataItem *defItem = psMetadataLookup(defaults, concept); 101 101 if (defItem) { 102 if (defItem->type == PS_ META_META) {102 if (defItem->type == PS_DATA_METADATA) { 103 103 // A dependent default 104 104 psTrace(__func__, 7, "Evaluating dependent default....\n"); … … 122 122 return NULL; 123 123 } 124 if (depItem->type != PS_ META_STR) {124 if (depItem->type != PS_DATA_STRING) { 125 125 psError(PS_ERR_IO, true, "Value of %s is not of type string, as required for dependency" 126 126 " --- ignored.\n", dependsOn); … … 270 270 if (item) { 271 271 switch (item->type) { 272 case PS_ META_F32:272 case PS_DATA_F32: 273 273 value = item->data.F32; 274 274 break; 275 case PS_ META_F64:275 case PS_DATA_F64: 276 276 // Assume it's OK to truncate to floating point from double 277 277 value = (float)item->data.F64; 278 278 break; 279 case PS_ META_S32:279 case PS_DATA_S32: 280 280 // Promote to float 281 281 value = (float)item->data.S32; … … 370 370 if (item) { 371 371 switch (item->type) { 372 case PS_ META_STR:372 case PS_DATA_STRING: 373 373 value = item->data.V; 374 374 break; … … 383 383 psTrace(__func__, 7, "Adding %s (%s): %s\n", name, comment, value); 384 384 385 psMetadataAdd(concepts, PS_LIST_TAIL, name, PS_ META_STR, comment, value);385 psMetadataAdd(concepts, PS_LIST_TAIL, name, PS_DATA_STRING, comment, value); 386 386 } 387 387 … … 428 428 ra = raItem->data.F64; 429 429 break; 430 case PS_ META_STR:430 case PS_DATA_STRING: 431 431 // Sexagesimal format 432 432 { … … 480 480 } 481 481 482 psMetadataAdd(fpa->concepts, PS_LIST_TAIL, "FPA.RA", PS_ META_F64,482 psMetadataAdd(fpa->concepts, PS_LIST_TAIL, "FPA.RA", PS_DATA_F64, 483 483 "Right Ascension of the boresight (radians)", ra); 484 484 … … 497 497 dec = decItem->data.F64; 498 498 break; 499 case PS_ META_STR:499 case PS_DATA_STRING: 500 500 // Sexagesimal format 501 501 { … … 549 549 } 550 550 551 psMetadataAdd(fpa->concepts, PS_LIST_TAIL, "FPA.DEC", PS_ META_F64,551 psMetadataAdd(fpa->concepts, PS_LIST_TAIL, "FPA.DEC", PS_DATA_F64, 552 552 "Declination of the boresight (radians)", dec); 553 553 … … 633 633 psError(PS_ERR_IO, false, "Couldn't find CELL.TRIMSEC.\n"); 634 634 *trimsec = psRegionSet(0.0, 0.0, 0.0, 0.0); 635 } else if (secItem->type != PS_ META_STR) {635 } else if (secItem->type != PS_DATA_STRING) { 636 636 psError(PS_ERR_IO, true, "CELL.TRIMSEC is not of type STR (%x)\n", secItem->type); 637 637 *trimsec = psRegionSet(0.0, 0.0, 0.0, 0.0); … … 643 643 psError(PS_ERR_IO, false, "Couldn't find CELL.TRIMSEC.SOURCE.\n"); 644 644 *trimsec = psRegionSet(0.0, 0.0, 0.0, 0.0); 645 } else if (sourceItem->type != PS_ META_STR) {645 } else if (sourceItem->type != PS_DATA_STRING) { 646 646 psError(PS_ERR_IO, true, "CELL.TRIMSEC.SOURCE is not of type STR (%x)\n", sourceItem->type); 647 647 *trimsec = psRegionSet(0.0, 0.0, 0.0, 0.0); … … 681 681 } // Looking up CELL.TRIMSEC 682 682 683 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.TRIMSEC", PS_ META_UNKNOWN,683 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.TRIMSEC", PS_DATA_UNKNOWN, 684 684 "Trim section", trimsec); 685 685 psFree(trimsec); … … 693 693 if (! secItem) { 694 694 psError(PS_ERR_IO, false, "Couldn't find CELL.BIASSEC.\n"); 695 } else if (secItem->type != PS_ META_STR) {695 } else if (secItem->type != PS_DATA_STRING) { 696 696 psError(PS_ERR_IO, true, "CELL.BIASSEC is not of type STR (%x)\n", secItem->type); 697 697 } else { … … 701 701 if (! sourceItem) { 702 702 psError(PS_ERR_IO, false, "Couldn't find CELL.BIASSEC.SOURCE.\n"); 703 } else if (sourceItem->type != PS_ META_STR) {703 } else if (sourceItem->type != PS_DATA_STRING) { 704 704 psError(PS_ERR_IO, true, "CELL.BIASSEC.SOURCE is not of type STR (%x)\n", sourceItem->type); 705 705 } else { … … 752 752 } // Looking up CELL.BIASSEC 753 753 754 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.BIASSEC", PS_ META_LIST, "Bias sections", biassecs);754 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.BIASSEC", PS_DATA_LIST, "Bias sections", biassecs); 755 755 psFree(biassecs); 756 756 } … … 762 762 if (! binItem) { 763 763 psError(PS_ERR_IO, false, "Couldn't find CELL.XBIN.\n"); 764 } else if (binItem->type == PS_ META_STR) {764 } else if (binItem->type == PS_DATA_STRING) { 765 765 psString binString = binItem->data.V; // The string containing the binning 766 766 if (sscanf(binString, "%d %*d", &xBin) != 1 && … … 784 784 if (! binItem) { 785 785 psError(PS_ERR_IO, false, "Couldn't find CELL.YBIN.\n"); 786 } else if (binItem->type == PS_ META_STR) {786 } else if (binItem->type == PS_DATA_STRING) { 787 787 psString binString = binItem->data.V; // The string containing the binning 788 788 if (sscanf(binString, "%*d %d", &yBin) != 1 && … … 809 809 if (! sysItem) { 810 810 psError(PS_ERR_IO, true, "Couldn't find CELL.TIMESYS --- assuming UTC.\n"); 811 } else if (sysItem->type != PS_ META_STR) {811 } else if (sysItem->type != PS_DATA_STRING) { 812 812 psError(PS_ERR_IO, true, "CELL.TIMESYS isn't of type STRING --- assuming UTC.\n"); 813 813 } else { … … 839 839 if (mdok && strlen(timeFormat) > 0) { 840 840 switch (timeItem->type) { 841 case PS_ META_STR:841 case PS_DATA_STRING: 842 842 { 843 843 psString timeString = timeItem->data.V; // String with the time … … 887 887 psError(PS_ERR_IO, false, "Unable to find time header: %s\n", 888 888 timeName); 889 } else if (timeItem->type == PS_ META_STR) {889 } else if (timeItem->type == PS_DATA_STRING) { 890 890 // Time is a string, in the usual way: 891 891 psStringAppend(&dateString, "T%s", timeItem->data.V); … … 965 965 } // Getting CELL.TIME 966 966 967 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.TIME", PS_ META_UNKNOWN, "Time of exposure", time);967 psMetadataAdd(cell->concepts, PS_LIST_TAIL, "CELL.TIME", PS_DATA_UNKNOWN, "Time of exposure", time); 968 968 psFree(time); 969 969 }
Note:
See TracChangeset
for help on using the changeset viewer.
