Changeset 6079 for trunk/ppImage/src
- Timestamp:
- Jan 19, 2006, 11:44:37 PM (21 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 4 edited
-
Makefile.am (modified) (2 diffs)
-
ppImageDetrendCell.c (modified) (3 diffs)
-
ppImageLoadPixels.c (modified) (1 diff)
-
ppImageLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/Makefile.am
r6064 r6079 12 12 ppImage.c \ 13 13 ppImageConfig.c \ 14 ppImageLoadPixels.c \15 14 ppImageLoop.c \ 16 15 ppImageOptions.c \ … … 20 19 ppImageOutput.c \ 21 20 ppImagePhot.c 21 # ppImageLoadPixels.c 22 22 # ppDetrendFlat.c 23 23 # ppImageOutput.c -
trunk/ppImage/src/ppImageDetrendCell.c
r6064 r6079 3 3 4 4 // mask, bias, dark, flat are defined per Cell 5 // pedestal is constructed for each readout, which may have different exposure times6 5 7 6 pmReadout *ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis) … … 23 22 bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config) 24 23 { 25 26 24 pmCellSetWeights(detrend->input); 27 25 … … 30 28 pmReadout *dark = ppDetrendSelectFirst(detrend->dark, "dark", options->doDark); 31 29 pmReadout *flat = ppDetrendSelectFirst(detrend->flat, "flat", options->doFlat); 30 31 #if 0 32 printf("Flat type: %x\n", flat->image->type.type); 33 printf("Flat value: %f\n", flat->image->data.F32[flat->image->numRows/2][flat->image->numCols/2]); 34 #endif 32 35 33 36 // Dark time for dark image -
trunk/ppImage/src/ppImageLoadPixels.c
r5976 r6079 14 14 15 15 psTrace(__func__, 1, "Loading %d,%d for %s\n", chipNum, cellNum, input->filename); 16 17 pmFPA *fpa = input->fpa; // The entire focal plane array 18 psArray *chips = fpa->chips; // The array of chips 19 if (chipNum >= 0 && chipNum < chips->n) { 20 loadCells(chips->data[chipNum]); 21 if (! chip->exists && chip->process) { 22 loadCells(chip, cellNum); 23 } 24 } else { 25 for (int i = 0; i < chips->n; i++) { 26 pmChip *chip = chips->data[i]; 27 } 16 28 17 29 // set input:valid flags according to process and chipNum/cellNum -
trunk/ppImage/src/ppImageLoop.c
r5976 r6079 1 1 # include "ppImage.h" 2 3 // Read the entire FPA 4 void readFPA(ppFile *file, // File to read 5 ppConfig *config // Configuration, containing the DB handle 6 ) 7 { 8 if (file->fpa && file->fits) { 9 if (! pmFPARead(file->fpa, file->fits, file->phu, config->database)) { 10 psErrorStackPrint(stderr, "Unable to populate camera from input FITS file\n"); 11 exit(EXIT_FAILURE); 12 } 13 } 14 } 15 16 // Read a specified chip only 17 void readChip(ppFile *file, // File to read 18 ppConfig *config, // Configuration 19 int chipNum // Chip number to read 20 ) 21 { 22 pmFPASelectChip(file->fpa, chipNum); 23 readFPA(file, config); 24 } 25 26 27 void readCell(ppFile *file, ppConfig *config, int chipNum, int cellNum) 28 { 29 pmChip *chip = file->fpa->chips->data[chipNum]; 30 pmChipSelectCell(chip, cellNum); 31 readFPA(file, config); 32 } 33 2 34 3 35 bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config) … … 5 37 ppDetrend detrend; 6 38 7 if (options->imageLoadDepth == PP_LOAD_FPA) { 39 int processChip = psMetadataLookupS32(NULL, config->arguments, "-chip"); // Chip number to process or -1 40 41 // Load at FPA level if requested 42 if (processChip < 0 && options->imageLoadDepth == PP_LOAD_FPA) { 8 43 psTrace(__func__, 1, "Loading pixels for FPA...\n"); 9 ppImageLoadPixels(data->input, config->database, -1, -1);10 ppImageLoadPixels(data->bias, config->database, -1, -1);11 ppImageLoadPixels(data->dark, config->database, -1, -1);12 ppImageLoadPixels(data->mask, config->database, -1, -1);13 ppImageLoadPixels(data->flat, config->database, -1, -1);44 readFPA(data->input, config); 45 readFPA(data->bias, config); 46 readFPA(data->dark, config); 47 readFPA(data->mask, config); 48 readFPA(data->flat, config); 14 49 } 15 50 16 for (int i = 0; i < data->input->fpa->chips->n; i++) { 17 pmChip *inputChip = data->input->fpa->chips->data[i]; // Chip of interest in input image 18 pmChip *biasChip = data->bias->fpa->chips->data[i]; // Chip of interest in bias image 19 pmChip *darkChip = data->dark->fpa->chips->data[i]; // Chip of interest in dark image 20 pmChip *maskChip = data->mask->fpa->chips->data[i]; // Chip of interest in mask image 21 pmChip *flatChip = data->flat->fpa->chips->data[i]; // Chip of interest in flat image 22 23 printf("Chip %d: %x %x\n", i, inputChip->exists, inputChip->process); 24 if (! inputChip->process) { continue; } 25 51 psArray *chips = data->input->fpa->chips; // Component chips 52 for (int i = 0; i < chips->n; i++) { 53 if (processChip >= 0 && i != processChip) { 54 continue; 55 } 26 56 if (options->imageLoadDepth == PP_LOAD_CHIP) { 27 57 psTrace(__func__, 1, "Loading pixels for chip %d...\n", i); 28 ppImageLoadPixels(data->input, config->database, i, -1);29 ppImageLoadPixels(data->bias, config->database, i, -1);30 ppImageLoadPixels(data->dark, config->database, i, -1);31 ppImageLoadPixels(data->mask, config->database, i, -1);32 ppImageLoadPixels(data->flat, config->database, i, -1);58 readChip(data->input, config, i); 59 readChip(data->bias, config, i); 60 readChip(data->dark, config, i); 61 readChip(data->mask, config, i); 62 readChip(data->flat, config, i); 33 63 } 34 64 35 for (int j = 0; j < inputChip->cells->n; j++) { 65 pmChip *inputChip = chips->data[i]; 66 pmChip *biasChip = data->bias->fpa->chips->data[i]; 67 pmChip *darkChip = data->dark->fpa->chips->data[i]; 68 pmChip *maskChip = data->mask->fpa->chips->data[i]; 69 pmChip *flatChip = data->flat->fpa->chips->data[i]; 70 71 psArray *cells = inputChip->cells; 72 for (int j = 0; j < cells->n; j++) { 36 73 detrend.input = inputChip->cells->data[j]; // Cell of interest in input image 37 74 detrend.bias = biasChip->cells->data[j]; // Cell of interest in bias image … … 40 77 detrend.flat = flatChip->cells->data[j]; // Cell of interest in flat image 41 78 42 printf ("\tCell %d: %x %x\n", j, detrend.input->exists, detrend.input->process);43 79 if (! detrend.input->process) { continue; } 44 80 45 81 if (options->imageLoadDepth == PP_LOAD_CELL) { 46 82 psTrace(__func__, 1, "Loading pixels for chip %d, cell %d...\n", i, j); 47 ppImageLoadPixels(data->input, config->database, i, j);48 ppImageLoadPixels(data->bias, config->database, i, j);49 ppImageLoadPixels(data->dark, config->database, i, j);50 ppImageLoadPixels(data->mask, config->database, i, j);51 ppImageLoadPixels(data->flat, config->database, i, j);83 readCell(data->input, config, i, j); 84 readCell(data->bias, config, i, j); 85 readCell(data->dark, config, i, j); 86 readCell(data->mask, config, i, j); 87 readCell(data->flat, config, i, j); 52 88 } 53 89 54 ppDetrendCell (&detrend, options, config);90 ppDetrendCell(&detrend, options, config); 55 91 } 56 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
