Changeset 7621 for trunk/ppImage/src/ppImageRebinReadout.c
- Timestamp:
- Jun 21, 2006, 12:51:48 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageRebinReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageRebinReadout.c
r6849 r7621 1 1 #include "ppImage.h" 2 2 3 bool ppImageRebinReadout (pmConfig *config, pmFPAview *view, char *filename) 3 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, char *outName, char *inName) { 4 5 pmCell *cell; 6 pmReadout *inReadout, *outReadout; 7 8 pmFPAfile *inFile = psMetadataLookupPtr (NULL, config->files, inName); 9 if (inFile == NULL) return NULL; 10 11 pmFPAfile *outFile = psMetadataLookupPtr (NULL, config->files, outName); 12 if (outFile == NULL) return NULL; 13 14 // XXX double check that chip != -1? 15 16 pmChip *inChip = pmFPAviewThisChip (view, inFile->fpa); 17 pmChip *outChip = pmFPAviewThisChip (view, outFile->fpa); 18 pmChipCopyStructure (outChip, inChip, outFile->xBin, outFile->yBin); 19 20 while ((cell = pmFPAviewNextCell (view, inFile->fpa, 1)) != NULL) { 21 psLogMsg ("ppImageRebinChip", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 22 if (! cell->process || ! cell->file_exists) { continue; } 23 24 // process each of the readouts 25 while ((inReadout = pmFPAviewNextReadout (view, inFile->fpa, 1)) != NULL) { 26 if (! inReadout->data_exists) { continue; } 27 28 outReadout = pmFPAviewThisReadout (view, outFile->fpa); 29 30 // run the rebin code 31 ppImageRebinReadout (outReadout, inReadout, outFile); 32 } 33 } 34 return true; 35 } 36 37 bool ppImageRebinReadout (pmReadout *output, pmReadout *input, pmFPAfile *outFile) 4 38 { 5 bool status;6 39 psF32 value; 7 40 psS32 nPix; 8 9 // find the currently selected readout10 pmReadout *input = pmFPAfileThisReadout (config->files, view, "PPIMAGE.INPUT");11 12 // set up the readouts for dark and bias13 pmReadout *output = pmFPAfileThisReadout (config->files, view, filename);14 15 // we need the file for the binning factors as well16 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, filename);17 if (file == NULL) return NULL;18 41 19 42 // the binning process must not change the size of the output image... … … 22 45 // psFree (stats); 23 46 24 int dX = file->xBin;25 int dY = file->yBin;47 int dX = outFile->xBin; 48 int dY = outFile->yBin; 26 49 27 50 int nX = input->image->numCols;
Note:
See TracChangeset
for help on using the changeset viewer.
