Changeset 7064 for trunk/ppMerge
- Timestamp:
- May 3, 2006, 6:12:17 PM (20 years ago)
- Location:
- trunk/ppMerge/src
- Files:
-
- 9 edited
-
ppMerge.c (modified) (3 diffs)
-
ppMerge.h (modified) (1 diff)
-
ppMergeBackground.c (modified) (5 diffs)
-
ppMergeBackground.h (modified) (1 diff)
-
ppMergeCheckInputs.h (modified) (1 diff)
-
ppMergeCombine.h (modified) (1 diff)
-
ppMergeConfig.h (modified) (1 diff)
-
ppMergeData.h (modified) (1 diff)
-
ppMergeOptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMerge.c
r7061 r7064 4 4 5 5 #include "ppMerge.h" 6 #include "ppMem.h" 6 #include "ppMergeConfig.h" 7 #include "ppMergeData.h" 8 #include "ppMergeOptions.h" 9 #include "ppMergeCheckInputs.h" 10 #include "ppMergeBackground.h" 11 #include "ppMergeCombine.h" 12 13 //#include "ppMem.h" 7 14 8 15 int main(int argc, char **argv) 9 16 { 10 ppMergeOptions *options = ppMergeOptionsAlloc();11 ppConfig *config = ppConfigAlloc();12 13 17 psTimerStart(TIMERNAME); 14 18 … … 25 29 ppMergeData *data = ppMergeCheckInputs(options, config); 26 30 if (!data) { 27 psError( "Not enough valid input files.\n");31 psError(PS_ERR_IO, false, "Not enough valid input files.\n"); 28 32 exit(EXIT_FAILURE); 29 33 } … … 50 54 pmConfigDone(); 51 55 52 ppMemCheck();56 // ppMemCheck(); 53 57 54 58 return EXIT_SUCCESS; -
trunk/ppMerge/src/ppMerge.h
r7061 r7064 2 2 #define PP_MERGE_H 3 3 4 #include <stdio.h> 5 #include <pslib.h> 6 #include <psmodules.h> 4 #define TIMERNAME "ppMerge" 7 5 8 #define RECIPE "PPMERGE" // Name of the recipe to use 9 6 #endif -
trunk/ppMerge/src/ppMergeBackground.c
r7061 r7064 34 34 35 35 // Get the scale and zero for each chip of each input 36 bool ppMergeScaleZero(p pImage **scales, // The scales for each integration/cell37 p pImage **zeros, // The zeroes for each integration/cell36 bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell 37 psImage **zeros, // The zeroes for each integration/cell 38 38 ppMergeData *data,// The data 39 39 const ppMergeOptions *options, // The options … … 76 76 psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read 77 77 if (!inFile) { 78 ps ErrorPrint(PS_ERR_IO, false, "Unable to open input file %s --- ignored.\n", name);78 psLogMsg(__func__, PS_LOG_WARN, "Unable to open input file %s --- ignored.\n", name); 79 79 status = false; 80 80 continue; 81 81 } 82 82 83 pmFPA *fpa = in->data[i];// The FPA for this input83 pmFPA *fpa = data->in->data[i]; // The FPA for this input 84 84 int cellNum = -1; // Number of the cell 85 85 psArray *chips = fpa->chips; // Array of chips … … 106 106 if (options->exptime) { 107 107 bool mdok = true; // Status of MD lookup 108 exptime->data.F64[i][cellNum] = psMetadataLookup(&mdok, cell->concepts, "CELL.EXPOSURE"); 108 exptime->data.F64[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts, 109 "CELL.EXPOSURE"); 109 110 if (!mdok || isnan(exptime->data.F64[i][cellNum])) { 110 111 psLogMsg(__func__, PS_LOG_WARN, "CELL.EXPOSURE for file %s chip %d cell %d is not " … … 139 140 if (options->scale) { 140 141 bool mdok = true; // Status of MD lookup 141 gain ->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");142 if (!mdok || isnan(gain ->data.F32[cellNum])) {142 gains->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN"); 143 if (!mdok || isnan(gains->data.F32[cellNum])) { 143 144 psLogMsg(__func__, PS_LOG_WARN, "CELL.GAIN for file %s chip %d cell %d is not " 144 145 "set.\n", name, j, k); 145 gain ->data.F32[cellNum] = NAN;146 gains->data.F32[cellNum] = NAN; 146 147 status = false; 147 148 } … … 150 151 // Get the background 151 152 psImageStats(bgStats, image, readout->mask, options->maskVal); 152 background [i][cellNum] = getStat(bgStats, options->background);153 } 154 155 p sCellFreeData(cell);153 background->data.F64[i][cellNum] = getStat(bgStats, options->background); 154 } 155 156 pmCellFreeData(cell); 156 157 } 157 p sChipFreeData(chip);158 } 159 p sFPAFreeData(fpa);158 pmChipFreeData(chip); 159 } 160 pmFPAFreeData(fpa); 160 161 psFitsClose(inFile); 161 162 } -
trunk/ppMerge/src/ppMergeBackground.h
r7061 r7064 2 2 #define PP_MERGE_BACKGROUND_H 3 3 4 #include <pslib.h> 5 #include <psmodules.h> 6 7 #include "ppMergeData.h" 8 #include "ppMergeOptions.h" 9 4 10 // Get the scale and zero for each chip of each input 5 bool ppMergeScaleZero(p pImage **scales, // The scales for each integration/cell6 p pImage **zeros, // The zeroes for each integration/cell11 bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell 12 psImage **zeros, // The zeroes for each integration/cell 7 13 ppMergeData *data,// The data 8 14 const ppMergeOptions *options, // The options -
trunk/ppMerge/src/ppMergeCheckInputs.h
r7061 r7064 2 2 #define PP_MERGE_CHECK_INPUTS_H 3 3 4 #include <psmodules.h> 5 #include "ppMergeOptions.h" 6 #include "ppMergeData.h" 7 4 8 // Check input files to make sure everything's consistent 5 boolppMergeCheckInputs(ppMergeOptions *options, // Options6 const pmConfig *config // Configuration9 ppMergeData *ppMergeCheckInputs(ppMergeOptions *options, // Options 10 const pmConfig *config // Configuration 7 11 ); 8 12 -
trunk/ppMerge/src/ppMergeCombine.h
r7061 r7064 4 4 #include <pslib.h> 5 5 #include <psmodules.h> 6 7 #include "ppMergeData.h" 8 #include "ppMergeOptions.h" 6 9 7 10 // Combine readouts -
trunk/ppMerge/src/ppMergeConfig.h
r6998 r7064 1 1 #ifndef PP_MERGE_CONFIG_H 2 2 #define PP_MERGE_CONFIG_H 3 4 #include <psmodules.h> 3 5 4 6 // Get the configuration information -
trunk/ppMerge/src/ppMergeData.h
r7061 r7064 1 1 #ifndef PP_MERGE_DATA_H 2 2 #define PP_MERGE_DATA_H 3 4 #include <pslib.h> 5 #include <psmodules.h> 3 6 4 7 // Container for the data -
trunk/ppMerge/src/ppMergeOptions.h
r6998 r7064 2 2 #define PP_MERGE_OPTIONS_H 3 3 4 #include <psModules.h> 4 #include <pslib.h> 5 #include <psmodules.h> 5 6 6 7 // Mode of on/off pairs; the value corresponds to how many images are in each set
Note:
See TracChangeset
for help on using the changeset viewer.
