Changeset 30682
- Timestamp:
- Feb 17, 2011, 3:25:55 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules/src
- Files:
-
- 2 edited
-
camera/pmFPAfileDefine.c (modified) (3 diffs)
-
config/pmConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/camera/pmFPAfileDefine.c
r27657 r30682 282 282 case PS_FITS_SCALE_NONE: 283 283 case PS_FITS_SCALE_RANGE: 284 case PS_FITS_SCALE_LOG_RANGE: 284 285 // No options required 285 286 break; 286 287 case PS_FITS_SCALE_STDEV_POSITIVE: 287 288 case PS_FITS_SCALE_STDEV_NEGATIVE: 289 case PS_FITS_SCALE_LOG_STDEV_POSITIVE: 290 case PS_FITS_SCALE_LOG_STDEV_NEGATIVE: 288 291 options->stdevNum = parseOptionFloat(scheme, "STDEV.NUM", source); // Padding to edge 289 292 if (!isfinite(options->stdevNum)) { … … 295 298 // Flow through 296 299 case PS_FITS_SCALE_STDEV_BOTH: 300 case PS_FITS_SCALE_LOG_STDEV_BOTH: 297 301 options->stdevBits = parseOptionInt(scheme, "STDEV.BITS", source, 0); // Bits for stdev 298 302 if (options->stdevBits <= 0) { … … 308 312 options->bzero = parseOptionDouble(scheme, "BZERO", source); // Zero point 309 313 break; 314 case PS_FITS_SCALE_LOG_MANUAL: 315 options->bscale = parseOptionDouble(scheme, "BSCALE", source); // Scaling 316 options->bzero = parseOptionDouble(scheme, "BZERO", source); // Zero point 317 options->boffset = parseOptionDouble(scheme, "BOFFSET", source); // Log offset 318 break; 310 319 default: 311 320 psAbort("Should never get here."); -
branches/eam_branches/ipp-20110213/psModules/src/config/pmConfig.c
r29004 r30682 897 897 psMetadataAddMetadata(filerules, PS_LIST_TAIL, old, PS_META_REPLACE, 898 898 "Original replaced by -F option", newRule); 899 } 900 psFree(camerasIter); 901 } 902 903 // Look for command-line options for files to replace 904 while ((argNum = psArgumentGet(*argc, argv, "-R")) > 0) { 905 psArgumentRemove(argNum, argc, argv); 906 if (argNum + 2 >= *argc) { 907 psError(PM_ERR_CONFIG, true, 908 "Filerule element switch (-R) provided without filerule element and value."); 909 psFree(config); 910 return NULL; 911 } 912 913 const char *rulename = argv[argNum]; // The filerule, to be modified 914 psArgumentRemove(argNum, argc, argv); 915 const char *element = argv[argNum]; // The element, to be modified 916 psArgumentRemove(argNum, argc, argv); 917 const char *value = argv[argNum]; // The value, to be set 918 psArgumentRemove(argNum, argc, argv); 919 920 psMetadata *cameras = psMetadataLookupMetadata(NULL, config->system, "CAMERAS"); // List of cameras 921 if (!cameras) { 922 psError(PM_ERR_CONFIG, false, "Unable to find CAMERAS in the site configuration.\n"); 923 return false; 924 } 925 926 psMetadataIterator *camerasIter = psMetadataIteratorAlloc(cameras, PS_LIST_HEAD, NULL); // Iterator 927 psMetadataItem *cameraItem; // Item from iteration 928 while ((cameraItem = psMetadataGetAndIncrement(camerasIter))) { 929 // Silently ignore problems --- they will be caught later, because if the user wants the nominated 930 // file and it's not available for that camera, then they will know. 931 932 if (cameraItem->type != PS_DATA_METADATA) { 933 psTrace("psModules.config", 2, 934 "Entry %s in CAMERAS is not of type METADATA --- ignored.", cameraItem->name); 935 continue; 936 } 937 psMetadata *camera = cameraItem->data.md; // Camera configuration 938 939 psMetadata *newRule = pmConfigFileRule(config, camera, rulename); // The rule of interest 940 if (!newRule) { 941 psTrace("psModules.config", 2, 942 "Unable to find filerule %s in camera %s --- ignored.", rulename, cameraItem->name); 943 continue; 944 } 945 946 // By calling pmConfigFileRule, we've assured that the FILERULES is now a metadata 947 psMetadata *filerules = psMetadataLookupMetadata(NULL, camera, "FILERULES"); // File rules 948 if (!filerules) { 949 psTrace("psModules.config", 2, 950 "Can't find FILERULES of type METADATA in camera %s --- ignored.", cameraItem->name); 951 continue; 952 } 953 954 // Convert newRule to have the element value requested. 955 if (!psMetadataLookupStr(NULL,newRule,element)) { 956 psTrace("psModules.config", 2, 957 "Unable to find filerule element %s in filerule %s in camera %s --- ignored.", 958 element,rulename,cameraItem->name); 959 continue; 960 } 961 psMetadataAddStr(newRule, PS_LIST_TAIL, element, PS_META_REPLACE, 962 "Original replaced by -R option", value); 963 964 psMetadataAddMetadata(filerules, PS_LIST_TAIL, rulename, PS_META_REPLACE, 965 "Original replaced by -R option", newRule); 899 966 } 900 967 psFree(camerasIter);
Note:
See TracChangeset
for help on using the changeset viewer.
