Changeset 7073 for trunk/ppMerge/src/ppMergeOptions.c
- Timestamp:
- May 4, 2006, 5:37:16 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeOptions.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeOptions.c
r7067 r7073 14 14 ) 15 15 { 16 psFree(options->format); 16 17 psFree(options->combine); 17 18 } … … 23 24 psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree); 24 25 26 options->format = NULL; 25 27 options->rows = 0; 26 28 options->minElectrons = NAN; … … 91 93 ppMergeOptions *options = ppMergeOptionsAlloc(); // The merge options 92 94 95 // We need to work out the camera before we can get the recipe. Take the first input and inspect it. 96 if (!config->camera) { 97 psArray *filenames = psMetadataLookupPtr(NULL, config->arguments, "INPUT"); // The input file names 98 psFits *inFile = psFitsOpen(filenames->data[0], "r"); // The FITS file to read 99 if (!inFile) { 100 psError(PS_ERR_IO, false, "Unable to open input file %s to determine camera.\n", 101 filenames->data[0]); 102 exit(EXIT_FAILURE); 103 } 104 psMetadata *header = psFitsReadHeader(NULL, inFile); // The FITS (primary) header 105 psFitsClose(inFile); 106 107 options->format = pmConfigCameraFormatFromHeader(config, header); 108 psFree(header); 109 if (!options->format) { 110 psLogMsg(__func__, PS_LOG_WARN, "Unable to identify camera format for input file %s\n", 111 filenames->data[0]); 112 exit(EXIT_FAILURE); 113 } 114 } 115 116 // Get the recipes 117 if (!config->recipes && !pmConfigReadRecipes(config)) { 118 psError(PS_ERR_IO, false, "Unable to read recipes.\n"); 119 exit(EXIT_FAILURE); 120 } 121 122 // Now we can read the recipe 93 123 bool mdok = true; // Status of MD lookup 94 124 psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, RECIPENAME); // Recipe information
Note:
See TracChangeset
for help on using the changeset viewer.
