IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2006, 12:51:48 PM (20 years ago)
Author:
eugene
Message:

various fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageRebinReadout.c

    r6849 r7621  
    11#include "ppImage.h"
    22
    3 bool ppImageRebinReadout (pmConfig *config, pmFPAview *view, char *filename)
     3bool 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
     37bool ppImageRebinReadout (pmReadout *output, pmReadout *input, pmFPAfile *outFile)
    438{
    5     bool status;
    639    psF32 value;
    740    psS32 nPix;
    8 
    9     // find the currently selected readout
    10     pmReadout *input = pmFPAfileThisReadout (config->files, view, "PPIMAGE.INPUT");
    11 
    12     // set up the readouts for dark and bias
    13     pmReadout  *output = pmFPAfileThisReadout (config->files, view, filename);
    14 
    15     // we need the file for the binning factors as well
    16     pmFPAfile *file = psMetadataLookupPtr (&status, config->files, filename);
    17     if (file == NULL) return NULL;
    1841
    1942    // the binning process must not change the size of the output image...
     
    2245    // psFree (stats);
    2346
    24     int dX = file->xBin;
    25     int dY = file->yBin;
     47    int dX = outFile->xBin;
     48    int dY = outFile->yBin;
    2649
    2750    int nX = input->image->numCols;
Note: See TracChangeset for help on using the changeset viewer.