IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 13, 2006, 5:14:07 PM (20 years ago)
Author:
Paul Price
Message:

Small hacks from updating psModule code for FPAs and concepts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImage.h

    r5860 r5976  
     1#ifndef PP_IMAGE_H
     2#define PP_IMAGE_H
     3
    14#include <stdio.h>
    25#include <strings.h>
     
    2225
    2326#define RECIPE "PHASE2"                 // Name of the recipe to use
     27#define TIMERNAME "ppImage"             // Name of timer
    2428
     29// How much of the FPA to load at a time
    2530typedef enum {
    26     PP_LOAD_NONE,
    27     PP_LOAD_FPA,
    28     PP_LOAD_CHIP,
    29     PP_LOAD_CELL,
     31    PP_LOAD_NONE,                       // Don't load anything
     32    PP_LOAD_FPA,                        // Load the entire FPA at once
     33    PP_LOAD_CHIP,                       // Load by chip
     34    PP_LOAD_CELL,                       // Load by cell
    3035} ppImageLoadDepth;
    3136
     37// Configuration data
    3238typedef struct {
    33     psMetadata *site;
    34     psMetadata *camera;
    35     psMetadata *recipe;
    36     psMetadata *arguments;
    37     psDB       *database;
     39    psMetadata *site;                   // The site configuration
     40    psMetadata *camera;                 // The camera configuration
     41    psMetadata *recipe;                 // The recipe (i.e., specific setups)
     42    psMetadata *arguments;              // The command-line arguments
     43    psDB       *database;               // Database handle
    3844} ppConfig;
    3945
     46// Options
    4047typedef struct {
    41     bool doMask;                        // Mask bad pixles
    42     bool doBias;                        // Bias subtraction
    43     bool doDark;                        // Dark subtraction
    44     bool doFlat;                        // Flat-field normalisation
    45     bool doFringe;                      // Fringe subtraction
    46     bool doSource;                      // Source identification and photometry
    47     bool doAstrom;                      // Astrometry
     48    bool doMask;                        // Mask bad pixels
     49    bool doBias;                        // Bias subtraction
     50    bool doDark;                        // Dark subtraction
     51    bool doFlat;                        // Flat-field normalisation
     52    bool doFringe;                      // Fringe subtraction
     53    bool doSource;                      // Source identification and photometry
     54    bool doAstrom;                      // Astrometry
    4855
    49     bool doOverscan;                    // Overscan subtraction
    50     int overscanBins;                   // Number of pixels per bin for overscan
    51     psStats *overscanStats;             // Statistics for overscan
    52     void *overscanFit;                  // Overscan fit (polynomial or spline)
    53     pmFit overscanFitType;              // Fit type for overscan
    54     pmOverscanAxis overscanMode;        // Axis for overscan
     56    bool doOverscan;                    // Overscan subtraction
     57    int overscanBins;                   // Number of pixels per bin for overscan
     58    psStats *overscanStats;             // Statistics for overscan
     59    void *overscanFit;                  // Overscan fit (polynomial or spline)
     60    pmFit overscanFitType;              // Fit type for overscan
     61    pmOverscanAxis overscanMode;        // Axis for overscan
    5562
    56     bool doNonLin;                      // Non-linearity correction
     63    bool doNonLin;                      // Non-linearity correction
    5764    psDataType nonLinearType;
    5865    psMetadataItem *nonLinearData;
    5966    void *nonLinearSource;
    6067
    61     ppImageLoadDepth imageLoadDepth;
     68    ppImageLoadDepth imageLoadDepth;    // How much of the FPA to load at once
    6269} ppOptions;
    6370
     71// A file to process
    6472typedef struct {
    65     char *filename;
    66     pmFPA *fpa;
    67     psFits *fits;
    68     psMetadata *header;
    69 } ppFPA;
     73    char *filename;                     // File name
     74    psFits *fits;                       // The FITS file handle
     75    psMetadata *phu;                    // The FITS header
     76    pmFPA *fpa;                         // The FPA, with pixels and extensions
     77} ppFile;
    7078
     79// The data to be processed
    7180typedef struct {
    72     ppFPA *input;
    73     ppFPA *mask;
    74     ppFPA *bias;
    75     ppFPA *dark;
    76     ppFPA *flat;
    77     ppFPA *fringe;
    78     ppFPA *process;
     81    ppFile *input;                      // The input, to be operated upon
     82    ppFile *mask;                       // The bad pixel mask image
     83    ppFile *bias;                       // The bias correction image
     84    ppFile *dark;                       // The dark correction image
     85    ppFile *flat;                       // The flat-field correction image
     86    ppFile *fringe;                     // The fringe correction image
     87#if 0
     88    ppFile *process;                    // A dummy file pointing out what needs to be processed
     89#endif
    7990} ppData;
    8091
     92// Cells to be used in the detrend
    8193typedef struct {
    82     pmCell *input;
    83     pmCell *mask;
    84     pmCell *bias;
    85     pmCell *dark;
    86     pmCell *flat;
     94    pmCell *input;                      // The input cell, to be operated upon
     95    pmCell *mask;                       // The bad pixel mask
     96    pmCell *bias;                       // The bias correction
     97    pmCell *dark;                       // The dark correction
     98    pmCell *flat;                       // The flat-field correction
    8799} ppDetrend;
    88100
    89 bool ppImageConfig (ppConfig *config, int argc, char **argv);
    90 bool ppImageLoadPixels (ppFPA *input, ppFPA *process, psDB *db, int nChip, int nCell);
    91 bool ppImageLoop (ppData *data, ppOptions *options, ppConfig *config);
    92 bool ppImageOptions (ppData *data, ppOptions *options, ppConfig *config);
    93 bool ppImageParseCamera (ppData *data, ppConfig *config);
    94 bool ppImageParseDetrend (ppData *data, ppOptions *options, ppConfig *config);
    95101
    96 bool ppReadoutWeights (pmReadout *readout);
     102// Allocators
     103ppFile *ppFileAlloc(void);
    97104
    98 bool ppDetrendCell (ppDetrend *detrend, ppOptions *options, ppConfig *config);
    99105
    100 bool ppDetrendMask (pmCell *cell, pmReadout *input, pmReadout *mask);
    101 bool ppDetrendNonLinear (pmCell *cell, pmReadout *input, ppOptions *options);
    102 bool ppDetrendNonLinearLookup (pmReadout *input, psMetadataItem *dataItem);
    103 bool ppDetrendNonLinearPolynomial (pmReadout *input, psMetadataItem *dataItem);
    104 bool ppDetrendBias (pmCell *inputCell, pmReadout *inputReadout, pmReadout *pedestal, ppOptions *options);
    105 pmReadout* ppDetrendPedestal (pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options);
    106 pmReadout* ppDetrendSelectFirst (pmCell *cell, char *name, bool doThis);
    107106
    108 bool ppFPAOpen (ppFPA *fpa, psMetadata *camera, char *name, bool doThis);
     107// Parse the site configuration (and camera and recipe if specified); read the command-line arguments
     108bool ppImageConfig(ppConfig *config,   // The configuration(output)
     109                   int argc, char **argv // Command-line arguments
     110                   );
     111
     112// Determine what type of camera, and initialise
     113bool ppImageParseCamera(ppData *data,   // The data to be processed
     114                        ppConfig *config // Configuration
     115                        );
     116
     117// Determine the procession options
     118bool ppImageOptions(ppData *data,       // The data to be processed
     119                    ppOptions *options, // Processing options
     120                    ppConfig *config    // Configuration
     121                    );
     122
     123
     124// Loop over the
     125bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config);
     126
     127// Load the pixels for the given file
     128bool ppImageLoadPixels(ppFile *input,   // File for which to load the pixels
     129                       psDB *db,        // Database handle (for reading concepts)
     130                       int nChip,       // Chip number to load
     131                       int nCell        // Cell number to load
     132                       );
     133
     134bool ppImageParseDetrend(ppData *data, ppOptions *options, ppConfig *config);
     135
     136bool ppReadoutWeights(pmReadout *readout);
     137
     138bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config);
     139
     140bool ppDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask);
     141bool ppDetrendNonLinear(pmCell *cell, pmReadout *input, ppOptions *options);
     142bool ppDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem);
     143bool ppDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem);
     144bool ppDetrendBias(pmCell *inputCell, pmReadout *inputReadout, pmReadout *pedestal, ppOptions *options);
     145pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options);
     146pmReadout* ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis);
     147
     148#if 0
     149bool ppFileOpen(ppFile *fpa, psMetadata *camera, char *name, bool doThis);
     150#endif
     151
     152
     153#endif // Pau.
Note: See TracChangeset for help on using the changeset viewer.