Changeset 14293 for trunk/psModules/src/concepts/pmConceptsStandard.c
- Timestamp:
- Jul 18, 2007, 10:28:32 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsStandard.c
r13862 r14293 5 5 #include <stdio.h> 6 6 #include <string.h> 7 #include <strings.h> /* for strn?casecmp */7 #include <strings.h> /* for strn?casecmp */ 8 8 #include <assert.h> 9 9 #include <pslib.h> … … 49 49 // FPA.FILTER 50 50 psMetadataItem *p_pmConceptParse_FPA_FILTER(const psMetadataItem *concept, 51 const psMetadataItem *pattern,51 const psMetadataItem *pattern, 52 52 pmConceptSource source, 53 const psMetadata *cameraFormat,54 const pmFPA *fpa,55 const pmChip *chip,56 const pmCell *cell)53 const psMetadata *cameraFormat, 54 const pmFPA *fpa, 55 const pmChip *chip, 56 const pmCell *cell) 57 57 { 58 58 assert(concept); … … 102 102 103 103 psMetadataItem *p_pmConceptFormat_FPA_FILTER(const psMetadataItem *concept, 104 pmConceptSource source,105 const psMetadata *cameraFormat,106 const pmFPA *fpa,107 const pmChip *chip,108 const pmCell *cell)104 pmConceptSource source, 105 const psMetadata *cameraFormat, 106 const pmFPA *fpa, 107 const pmChip *chip, 108 const pmCell *cell) 109 109 { 110 110 assert(concept); … … 126 126 127 127 const char *key = concept->data.str; // The name to look up 128 128 if (!key || strlen(key) == 0) { 129 return psMetadataItemAllocStr(concept->name, concept->comment, NULL); 130 } 131 129 132 // the metadata is in the format (internal) STR (external) 130 133 // find the first internal name that matches … … 141 144 // FPA.RA and FPA.DEC 142 145 psMetadataItem *p_pmConceptParse_FPA_Coords(const psMetadataItem *concept, 143 const psMetadataItem *pattern,146 const psMetadataItem *pattern, 144 147 pmConceptSource source, 145 const psMetadata *cameraFormat,146 const pmFPA *fpa,147 const pmChip *chip,148 const pmCell *cell)148 const psMetadata *cameraFormat, 149 const pmFPA *fpa, 150 const pmChip *chip, 151 const pmCell *cell) 149 152 { 150 153 assert(concept); … … 167 170 // XXX: Upgrade path is to allow dd:mm.mmm 168 171 if (sscanf(concept->data.V, "%d:%d:%f", &big, &medium, &small) != 3 && 169 sscanf(concept->data.V, "%d %d %f", &big, &medium, &small) != 3)172 sscanf(concept->data.V, "%d %d %f", &big, &medium, &small) != 3) 170 173 { 171 174 psError(PS_ERR_UNKNOWN, true, "Cannot interpret %s: %s\n", pattern->name, concept->data.str); … … 212 215 // FPA.RA and FPA.DEC 213 216 psMetadataItem *p_pmConceptFormat_FPA_Coords(const psMetadataItem *concept, 214 pmConceptSource source,215 const psMetadata *cameraFormat,216 const pmFPA *fpa,217 const pmChip *chip,218 const pmCell *cell)217 pmConceptSource source, 218 const psMetadata *cameraFormat, 219 const pmFPA *fpa, 220 const pmChip *chip, 221 const pmCell *cell) 219 222 { 220 223 assert(concept); … … 230 233 bool mdok = true; // Status of MD lookup 231 234 psMetadata *formats = psMetadataLookupMetadata(&mdok, 232 cameraFormat,233 "FORMATS");235 cameraFormat, 236 "FORMATS"); 234 237 if (mdok && formats) { 235 238 psString format = psMetadataLookupStr(&mdok,formats, concept->name); … … 274 277 275 278 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(const psMetadataItem *concept, 276 const psMetadataItem *pattern,277 pmConceptSource source,278 const psMetadata *cameraFormat,279 const pmFPA *fpa,280 const pmChip *chip,281 const pmCell *cell)279 const psMetadataItem *pattern, 280 pmConceptSource source, 281 const psMetadata *cameraFormat, 282 const pmFPA *fpa, 283 const pmChip *chip, 284 const pmCell *cell) 282 285 { 283 286 assert(concept); … … 294 297 return NULL; 295 298 } else { 296 // allow for x and y flips in regions299 // allow for x and y flips in regions 297 300 *trimsec = psRegionAndParityFromString(&xParity, &yParity, concept->data.V); 298 301 } … … 311 314 312 315 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(const psMetadataItem *concept, 313 const psMetadataItem *pattern,314 pmConceptSource source,315 const psMetadata *cameraFormat,316 const pmFPA *fpa,317 const pmChip *chip,318 const pmCell *cell)316 const psMetadataItem *pattern, 317 pmConceptSource source, 318 const psMetadata *cameraFormat, 319 const pmFPA *fpa, 320 const pmChip *chip, 321 const pmCell *cell) 319 322 { 320 323 assert(concept); … … 326 329 switch (concept->type) { 327 330 case PS_DATA_STRING: { 328 // a single BIASSEC is of the form [AAAA]329 // we may have multiple BIASSEC entries separated by space, commas, or semicolons330 int xParity = 0;331 int yParity = 0;332 char *p = strchr (concept->data.V, '[');333 while (p != NULL) {334 char *q = strchr (p, ']');335 if (q == NULL) break;336 char *regionString = psAlloc (q - p + 2);337 strncpy (regionString, p, q - p + 1);338 regionString[q - p + 1] = 0;339 340 psRegion *region = psAlloc(sizeof(psRegion)); // The region341 *region = psRegionAndParityFromString(&xParity, &yParity, regionString);342 psListAdd(biassecs, PS_LIST_TAIL, region);343 psFree(region); // Drop reference344 psFree(regionString); // Drop reference345 346 p = strchr (q, '[');347 }348 break;331 // a single BIASSEC is of the form [AAAA] 332 // we may have multiple BIASSEC entries separated by space, commas, or semicolons 333 int xParity = 0; 334 int yParity = 0; 335 char *p = strchr (concept->data.V, '['); 336 while (p != NULL) { 337 char *q = strchr (p, ']'); 338 if (q == NULL) break; 339 char *regionString = psAlloc (q - p + 2); 340 strncpy (regionString, p, q - p + 1); 341 regionString[q - p + 1] = 0; 342 343 psRegion *region = psAlloc(sizeof(psRegion)); // The region 344 *region = psRegionAndParityFromString(&xParity, &yParity, regionString); 345 psListAdd(biassecs, PS_LIST_TAIL, region); 346 psFree(region); // Drop reference 347 psFree(regionString); // Drop reference 348 349 p = strchr (q, '['); 350 } 351 break; 349 352 } 350 353 case PS_DATA_LIST: { 351 psList *regions = concept->data.V; // The list of regions352 psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator353 psMetadataItem *regionItem = NULL; // Item from list iteration354 while ((regionItem = psListGetAndIncrement(regionsIter))) {355 if (regionItem->type != PS_DATA_STRING) {356 psWarning("CELL.BIASSEC member is not of type STR --- ignored.\n");357 continue;358 }359 int xParity = 0;360 int yParity = 0;361 psRegion *region = psAlloc(sizeof(psRegion)); // The region362 *region = psRegionAndParityFromString(&xParity, &yParity, regionItem->data.V);363 psListAdd(biassecs, PS_LIST_TAIL, region);364 psFree(region); // Drop reference365 }366 psFree(regionsIter);367 break;354 psList *regions = concept->data.V; // The list of regions 355 psListIterator *regionsIter = psListIteratorAlloc(regions, PS_LIST_HEAD, false); // Iterator 356 psMetadataItem *regionItem = NULL; // Item from list iteration 357 while ((regionItem = psListGetAndIncrement(regionsIter))) { 358 if (regionItem->type != PS_DATA_STRING) { 359 psWarning("CELL.BIASSEC member is not of type STR --- ignored.\n"); 360 continue; 361 } 362 int xParity = 0; 363 int yParity = 0; 364 psRegion *region = psAlloc(sizeof(psRegion)); // The region 365 *region = psRegionAndParityFromString(&xParity, &yParity, regionItem->data.V); 366 psListAdd(biassecs, PS_LIST_TAIL, region); 367 psFree(region); // Drop reference 368 } 369 psFree(regionsIter); 370 break; 368 371 } 369 372 default: … … 386 389 // CELL.XBIN and CELL.YBIN 387 390 psMetadataItem *p_pmConceptParse_CELL_Binning(const psMetadataItem *concept, 388 const psMetadataItem *pattern,389 pmConceptSource source,390 const psMetadata *cameraFormat,391 const pmFPA *fpa,392 const pmChip *chip,393 const pmCell *cell)391 const psMetadataItem *pattern, 392 pmConceptSource source, 393 const psMetadata *cameraFormat, 394 const pmFPA *fpa, 395 const pmChip *chip, 396 const pmCell *cell) 394 397 { 395 398 assert(concept); … … 399 402 switch (concept->type) { 400 403 case PS_DATA_STRING: { 401 psString binString = concept->data.V; // The string containing the binning402 if ((strcmp(pattern->name, "CELL.XBIN") == 0 && sscanf(binString, "%d %*d", &binning) != 1 &&403 sscanf(binString, "%d,%*d", &binning) != 1) ||404 (strcmp(pattern->name, "CELL.YBIN") == 0 && sscanf(binString, "%*d %d", &binning) != 1 &&405 sscanf(binString, "%*d,%d", &binning) != 1)) {406 psError(PS_ERR_UNKNOWN, true, "Unable to parse string to get %s: %s\n", pattern->name, binString);407 }408 break;404 psString binString = concept->data.V; // The string containing the binning 405 if ((strcmp(pattern->name, "CELL.XBIN") == 0 && sscanf(binString, "%d %*d", &binning) != 1 && 406 sscanf(binString, "%d,%*d", &binning) != 1) || 407 (strcmp(pattern->name, "CELL.YBIN") == 0 && sscanf(binString, "%*d %d", &binning) != 1 && 408 sscanf(binString, "%*d,%d", &binning) != 1)) { 409 psError(PS_ERR_UNKNOWN, true, "Unable to parse string to get %s: %s\n", pattern->name, binString); 410 } 411 break; 409 412 } 410 413 TYPE_CASE(binning, concept, U8); … … 424 427 425 428 psMetadataItem *p_pmConceptParse_TIMESYS(const psMetadataItem *concept, 426 const psMetadataItem *pattern,427 pmConceptSource source,428 const psMetadata *cameraFormat,429 const pmFPA *fpa,430 const pmChip *chip,431 const pmCell *cell)429 const psMetadataItem *pattern, 430 pmConceptSource source, 431 const psMetadata *cameraFormat, 432 const pmFPA *fpa, 433 const pmChip *chip, 434 const pmCell *cell) 432 435 { 433 436 assert(concept); … … 455 458 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept, 456 459 const psMetadataItem *pattern, 457 pmConceptSource source,460 pmConceptSource source, 458 461 const psMetadata *cameraFormat, 459 462 const pmFPA *fpa, … … 480 483 if (!mdok || (timeSys == 0xffffffff)) { 481 484 psWarning("Unable to find %s in concepts when parsing %s --- assuming UTC.\n", 482 timesysName, pattern->name);485 timesysName, pattern->name); 483 486 timeSys = PS_TIME_UTC; 484 487 } … … 560 563 switch (concept->type) { 561 564 case PS_DATA_LIST: { 562 if (!separateTime) {563 psWarning ("DATE and TIME stored separately, but not specified in format\n");564 }565 // The date and time are stored separately566 // Assume the date is first and the time second567 psList *dateTime = concept->data.V; // The list containing items for date and time568 if (psListLength(dateTime) != 2) {569 psError(PS_ERR_BAD_PARAMETER_SIZE, false,570 "Unable to parse %s: date and time are not both available.", pattern->name);571 return NULL;572 }573 psMetadataItem *dateItem = psListGet(dateTime, PS_LIST_HEAD); // Item containing the date574 if (!dateItem) {575 psError(PS_ERR_UNKNOWN, true, "Date is not found.\n");576 return NULL;577 }578 if (dateItem->type != PS_DATA_STRING) {579 psError(PS_ERR_UNKNOWN, true, "Date is not of type STR.\n");580 return NULL;581 }582 psString dateString = dateItem->data.V; // The string with the date583 int day = 0, month = 0, year = 0;584 if (sscanf(dateString, "%d-%d-%d", &year, &month, &day) != 3 &&585 sscanf(dateString, "%d/%d/%d", &year, &month, &day) != 3) {586 psError(PS_ERR_UNKNOWN, true, "Unable to read date: %s\n", dateString);587 return NULL;588 }589 if (backwardsTime) {590 // Need to switch days and years591 int temp = day;592 day = year;593 year = temp;594 }595 if (usaTime) {596 // Need to switch everything around.... Yanks!597 int temp = day;598 day = month;599 month = year;600 year = temp;601 }602 if (year < 100) {603 if (pre2000Time) {604 year += 1900;605 } else {606 year += 2000;607 }608 }609 sprintf(dateString,"%04d-%02d-%02d", year, month, day);610 611 psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time612 if (!timeItem) {613 psError(PS_ERR_UNKNOWN, true, "Time is not found.\n");614 return NULL;615 }616 psString timeString = NULL; // The string with the time617 if (timeItem->type == PS_DATA_STRING) {618 timeString = timeItem->data.V;619 } else {620 // Assume that time is specified in Second of Day (!)621 double seconds = NAN;622 switch (timeItem->type) {623 TYPE_CASE(seconds, timeItem, U8);624 TYPE_CASE(seconds, timeItem, U16);625 TYPE_CASE(seconds, timeItem, U32);626 TYPE_CASE(seconds, timeItem, S8);627 TYPE_CASE(seconds, timeItem, S16);628 TYPE_CASE(seconds, timeItem, S32);629 TYPE_CASE(seconds, timeItem, F32);630 TYPE_CASE(seconds, timeItem, F64);565 if (!separateTime) { 566 psWarning ("DATE and TIME stored separately, but not specified in format\n"); 567 } 568 // The date and time are stored separately 569 // Assume the date is first and the time second 570 psList *dateTime = concept->data.V; // The list containing items for date and time 571 if (psListLength(dateTime) != 2) { 572 psError(PS_ERR_BAD_PARAMETER_SIZE, false, 573 "Unable to parse %s: date and time are not both available.", pattern->name); 574 return NULL; 575 } 576 psMetadataItem *dateItem = psListGet(dateTime, PS_LIST_HEAD); // Item containing the date 577 if (!dateItem) { 578 psError(PS_ERR_UNKNOWN, true, "Date is not found.\n"); 579 return NULL; 580 } 581 if (dateItem->type != PS_DATA_STRING) { 582 psError(PS_ERR_UNKNOWN, true, "Date is not of type STR.\n"); 583 return NULL; 584 } 585 psString dateString = dateItem->data.V; // The string with the date 586 int day = 0, month = 0, year = 0; 587 if (sscanf(dateString, "%d-%d-%d", &year, &month, &day) != 3 && 588 sscanf(dateString, "%d/%d/%d", &year, &month, &day) != 3) { 589 psError(PS_ERR_UNKNOWN, true, "Unable to read date: %s\n", dateString); 590 return NULL; 591 } 592 if (backwardsTime) { 593 // Need to switch days and years 594 int temp = day; 595 day = year; 596 year = temp; 597 } 598 if (usaTime) { 599 // Need to switch everything around.... Yanks! 600 int temp = day; 601 day = month; 602 month = year; 603 year = temp; 604 } 605 if (year < 100) { 606 if (pre2000Time) { 607 year += 1900; 608 } else { 609 year += 2000; 610 } 611 } 612 sprintf(dateString,"%04d-%02d-%02d", year, month, day); 613 614 psMetadataItem *timeItem = psListGet(dateTime, PS_LIST_HEAD + 1); // Item containing the time 615 if (!timeItem) { 616 psError(PS_ERR_UNKNOWN, true, "Time is not found.\n"); 617 return NULL; 618 } 619 psString timeString = NULL; // The string with the time 620 if (timeItem->type == PS_DATA_STRING) { 621 timeString = timeItem->data.V; 622 } else { 623 // Assume that time is specified in Second of Day (!) 624 double seconds = NAN; 625 switch (timeItem->type) { 626 TYPE_CASE(seconds, timeItem, U8); 627 TYPE_CASE(seconds, timeItem, U16); 628 TYPE_CASE(seconds, timeItem, U32); 629 TYPE_CASE(seconds, timeItem, S8); 630 TYPE_CASE(seconds, timeItem, S16); 631 TYPE_CASE(seconds, timeItem, S32); 632 TYPE_CASE(seconds, timeItem, F32); 633 TYPE_CASE(seconds, timeItem, F64); 631 634 default: 632 psError(PS_ERR_UNKNOWN, true, "Time is not of an expected type: %x\n", timeItem->type);633 return NULL;634 }635 // Now print to timeString as "hh:mm:ss.ss"636 int hours = seconds / 3600;637 seconds -= (double)hours * 3600.0;638 int minutes = seconds / 60;639 seconds -= (double)minutes * 60.0;640 psStringAppend(&timeString, "%02d:%02d:%02f", hours, minutes, seconds);641 }642 psString dateTimeString = NULL;643 psStringAppend(&dateTimeString, "%sT%s", dateString, timeString);644 time = psTimeFromISO(dateTimeString, timeSys);645 psFree(dateTimeString);646 break;635 psError(PS_ERR_UNKNOWN, true, "Time is not of an expected type: %x\n", timeItem->type); 636 return NULL; 637 } 638 // Now print to timeString as "hh:mm:ss.ss" 639 int hours = seconds / 3600; 640 seconds -= (double)hours * 3600.0; 641 int minutes = seconds / 60; 642 seconds -= (double)minutes * 60.0; 643 psStringAppend(&timeString, "%02d:%02d:%02f", hours, minutes, seconds); 644 } 645 psString dateTimeString = NULL; 646 psStringAppend(&dateTimeString, "%sT%s", dateString, timeString); 647 time = psTimeFromISO(dateTimeString, timeSys); 648 psFree(dateTimeString); 649 break; 647 650 } 648 651 case PS_DATA_STRING: { 649 psString timeString = concept->data.V; // String with the time650 if (jdTime) {651 double timeValue = strtod (timeString, NULL);652 time = psTimeFromJD(timeValue);653 } else if (mjdTime) {654 double timeValue = strtod (timeString, NULL);655 time = psTimeFromMJD(timeValue);656 } else {657 // It's ISO658 time = psTimeFromISO(timeString, timeSys);659 } // Interpreting the time string660 break;652 psString timeString = concept->data.V; // String with the time 653 if (jdTime) { 654 double timeValue = strtod (timeString, NULL); 655 time = psTimeFromJD(timeValue); 656 } else if (mjdTime) { 657 double timeValue = strtod (timeString, NULL); 658 time = psTimeFromMJD(timeValue); 659 } else { 660 // It's ISO 661 time = psTimeFromISO(timeString, timeSys); 662 } // Interpreting the time string 663 break; 661 664 } 662 665 case PS_TYPE_F32: { 663 double timeValue = (double)concept->data.F32;664 if (jdTime) {665 time = psTimeFromJD(timeValue);666 } else if (mjdTime) {667 time = psTimeFromMJD(timeValue);668 } else {669 psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",670 pattern->name, timeValue);671 time = psTimeFromJD(timeValue);672 }673 break;666 double timeValue = (double)concept->data.F32; 667 if (jdTime) { 668 time = psTimeFromJD(timeValue); 669 } else if (mjdTime) { 670 time = psTimeFromMJD(timeValue); 671 } else { 672 psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n", 673 pattern->name, timeValue); 674 time = psTimeFromJD(timeValue); 675 } 676 break; 674 677 } 675 678 case PS_TYPE_F64: { 676 double timeValue = (double)concept->data.F64;677 if (jdTime) {678 time = psTimeFromJD(timeValue);679 } else if (mjdTime) {680 time = psTimeFromMJD(timeValue);681 } else {682 psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n",683 pattern->name, timeValue);684 time = psTimeFromJD(timeValue);685 }686 break;679 double timeValue = (double)concept->data.F64; 680 if (jdTime) { 681 time = psTimeFromJD(timeValue); 682 } else if (mjdTime) { 683 time = psTimeFromMJD(timeValue); 684 } else { 685 psError(PS_ERR_UNKNOWN, true, "Not sure how to parse %s (%f) --- trying JD\n", 686 pattern->name, timeValue); 687 time = psTimeFromJD(timeValue); 688 } 689 break; 687 690 } 688 691 default: … … 713 716 714 717 psMetadataItem *p_pmConceptParse_Positions(const psMetadataItem *concept, 715 const psMetadataItem *pattern,716 pmConceptSource source,717 const psMetadata *cameraFormat,718 const pmFPA *fpa,719 const pmChip *chip,720 const pmCell *cell)718 const psMetadataItem *pattern, 719 pmConceptSource source, 720 const psMetadata *cameraFormat, 721 const pmFPA *fpa, 722 const pmChip *chip, 723 const pmCell *cell) 721 724 { 722 725 assert(concept); … … 735 738 736 739 case PS_DATA_STRING: { 737 // Interpret as a region specifier [x0:x1,y0:y1]738 int xParity = 0;739 int yParity = 0;740 psRegion region = psRegionAndParityFromString(&xParity, &yParity, concept->data.V);741 if (strstr(pattern->name, ".X0")) {742 offset = region.x0;743 } else if (strstr(pattern->name, ".Y0")) {744 offset = region.y0;745 } else if (strstr(pattern->name, ".X1")) {746 offset = region.x1;747 } else if (strstr(pattern->name, ".Y1")) {748 offset = region.y1;749 } else {750 psError(PS_ERR_UNKNOWN, true,751 "Unable to interpret %s because unable to determine if concept is X or Y.\n",752 pattern->name);753 return NULL;754 }755 break;740 // Interpret as a region specifier [x0:x1,y0:y1] 741 int xParity = 0; 742 int yParity = 0; 743 psRegion region = psRegionAndParityFromString(&xParity, &yParity, concept->data.V); 744 if (strstr(pattern->name, ".X0")) { 745 offset = region.x0; 746 } else if (strstr(pattern->name, ".Y0")) { 747 offset = region.y0; 748 } else if (strstr(pattern->name, ".X1")) { 749 offset = region.x1; 750 } else if (strstr(pattern->name, ".Y1")) { 751 offset = region.y1; 752 } else { 753 psError(PS_ERR_UNKNOWN, true, 754 "Unable to interpret %s because unable to determine if concept is X or Y.\n", 755 pattern->name); 756 return NULL; 757 } 758 break; 756 759 } 757 760 #endif … … 772 775 773 776 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(const psMetadataItem *concept, 774 pmConceptSource source,775 const psMetadata *cameraFormat,776 const pmFPA *fpa,777 const pmChip *chip,778 const pmCell *cell)777 pmConceptSource source, 778 const psMetadata *cameraFormat, 779 const pmFPA *fpa, 780 const pmChip *chip, 781 const pmCell *cell) 779 782 { 780 783 assert(concept); … … 801 804 psFree(trimsec); 802 805 psMetadataItem *formatted = psMetadataItemAllocStr(concept->name, concept->comment, 803 trimsecString);806 trimsecString); 804 807 psFree(trimsecString); 805 808 return formatted; … … 807 810 808 811 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(const psMetadataItem *concept, 809 pmConceptSource source,810 const psMetadata *cameraFormat,811 const pmFPA *fpa,812 const pmChip *chip,813 const pmCell *cell)812 pmConceptSource source, 813 const psMetadata *cameraFormat, 814 const pmFPA *fpa, 815 const pmChip *chip, 816 const pmCell *cell) 814 817 { 815 818 // Return a metadata item containing a list of metadata items of region strings … … 853 856 psMetadataItem *p_pmConceptFormat_CELL_XBIN(const psMetadataItem *concept, 854 857 pmConceptSource source, 855 const psMetadata *cameraFormat,856 const pmFPA *fpa,857 const pmChip *chip,858 const pmCell *cell)858 const psMetadata *cameraFormat, 859 const pmFPA *fpa, 860 const pmChip *chip, 861 const pmCell *cell) 859 862 { 860 863 assert(concept); … … 865 868 psString yKeyword = psMetadataLookupStr(&yBinOK, translation, "CELL.YBIN"); 866 869 if (xBinOK && yBinOK && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 && 867 strcasecmp(xKeyword, yKeyword) == 0) {870 strcasecmp(xKeyword, yKeyword) == 0) { 868 871 psMetadataItem *yBinItem = psMetadataLookup(cell->concepts, "CELL.YBIN"); // Binning factor in y 869 872 psString binString = NULL; … … 881 884 psMetadataItem *p_pmConceptFormat_CELL_YBIN(const psMetadataItem *concept, 882 885 pmConceptSource source, 883 const psMetadata *cameraFormat,884 const pmFPA *fpa,885 const pmChip *chip,886 const pmCell *cell)886 const psMetadata *cameraFormat, 887 const pmFPA *fpa, 888 const pmChip *chip, 889 const pmCell *cell) 887 890 { 888 891 assert(concept); … … 893 896 psString yKeyword = psMetadataLookupStr(&yBinOK, translation, "CELL.YBIN"); 894 897 if (xBinOK && yBinOK && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 && 895 strcasecmp(xKeyword, yKeyword) == 0) {898 strcasecmp(xKeyword, yKeyword) == 0) { 896 899 // Censor this --- it's already done (though no harm if it's done twice 897 900 return NULL; … … 904 907 905 908 psMetadataItem *p_pmConceptFormat_TIMESYS(const psMetadataItem *concept, 906 pmConceptSource source,907 const psMetadata *cameraFormat,908 const pmFPA *fpa,909 const pmChip *chip,910 const pmCell *cell)909 pmConceptSource source, 910 const psMetadata *cameraFormat, 911 const pmFPA *fpa, 912 const pmChip *chip, 913 const pmCell *cell) 911 914 { 912 915 psString sys = NULL; // String to store … … 934 937 935 938 psMetadataItem *p_pmConceptFormat_TIME(const psMetadataItem *concept, 936 pmConceptSource source,939 pmConceptSource source, 937 940 const psMetadata *cameraFormat, 938 941 const pmFPA *fpa, … … 993 996 } else { 994 997 psWarning("Unrecognised FORMATS option for %s: %s --- " 995 "ignored.\n", concept->name, format);998 "ignored.\n", concept->name, format); 996 999 } 997 1000 } … … 1034 1037 1035 1038 psMetadataItem *dateItem = psMetadataItemAllocStr(concept->name, "The date of observation", 1036 dateString);1039 dateString); 1037 1040 psMetadataItem *timeItem = psMetadataItemAllocStr(concept->name, "The time of observation", 1038 timeString);1041 timeString); 1039 1042 1040 1043 psListRemove(dateTime, PS_LIST_HEAD); … … 1045 1048 1046 1049 psMetadataItem *item = psMetadataItemAllocPtr(concept->name, PS_DATA_LIST, concept->comment, 1047 dateTime);1050 dateTime); 1048 1051 psFree (dateItem); 1049 1052 psFree (timeItem); … … 1070 1073 psMetadataItem *p_pmConceptFormat_Positions(const psMetadataItem *concept, 1071 1074 pmConceptSource source, 1072 const psMetadata *cameraFormat,1073 const pmFPA *fpa,1074 const pmChip *chip,1075 const pmCell *cell)1075 const psMetadata *cameraFormat, 1076 const pmFPA *fpa, 1077 const pmChip *chip, 1078 const pmCell *cell) 1076 1079 { 1077 1080 assert(concept); … … 1103 1106 psString yKeyword = psMetadataLookupStr(&yFound, translation, companion); 1104 1107 if (xFound && yFound && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 && 1105 strcasecmp(xKeyword, yKeyword) == 0) {1108 strcasecmp(xKeyword, yKeyword) == 0) { 1106 1109 psMetadataItem *yItem = psMetadataLookup(cell->concepts, companion); // Corresponding y value 1107 1110 … … 1128 1131 psFree(companion); 1129 1132 if (xFound && yFound && strlen(xKeyword) > 0 && strlen(yKeyword) > 0 && 1130 strcasecmp(xKeyword, yKeyword) == 0) {1133 strcasecmp(xKeyword, yKeyword) == 0) { 1131 1134 return NULL; // We did it with the X; don't do anything. 1132 1135 }
Note:
See TracChangeset
for help on using the changeset viewer.
