IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 17, 2009, 8:33:56 AM (17 years ago)
Author:
eugene
Message:

ppNoiseMap builds correctly (but does nothing yet)

Location:
trunk/ppNoiseMap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppNoiseMap

    • Property svn:ignore set to
      configure
      Makefile.in
      Doxyfile
      config.log
      depcomp
      config.status
      config.guess
      ltmain.sh
      config.sub
      autom4te.cache
      libtool
      missing
      Makefile
      aclocal.m4
      install-sh
  • trunk/ppNoiseMap/src

    • Property svn:ignore set to
      Makefile.in
      stamp-h1
      config.h
      config.h.in
      .deps
      ppNoiseMap
      Makefile
  • trunk/ppNoiseMap/src/ppNoiseMap.h

    r24453 r24458  
    1212#include "pslib.h"
    1313#include "psmodules.h"
    14 #include "psphot.h"
    15 #include "psastro.h"
    16 #include "ppStats.h"
    1714
    18 #define RECIPE_NAME   "PPNOISEMAP"      // Name of the recipe to use
    19 #define TIMER_TOTAL   "PPNOISE.TOTAL"   // Name of timer for total time
    20 #define TIMER_DETREND "PPNOISE.DETREND" // Name of timer for detrend time
    21 #define TIMER_PHOT    "PPNOISE.PHOT"    // Name of timer for photometry time
     15#define RECIPE_NAME   "PPNOISEMAP"       // Name of the recipe to use
     16#define TIMER_TOTAL   "PPNOISEMAP.TOTAL" // Name of timer for total time
    2217
    23 // Options for ppImage processing
    24 typedef struct {
    25     // actions which ppImage should perform
    26     bool doMaskBuild;                   // Build internal mask
    27     bool doVarianceBuild;               // Build internal variance map
    28     bool doMask;                        // Mask bad pixels
    29     bool doNonLin;                      // Non-linearity correction
    30     bool doOverscan;                    // Overscan subtraction
    31     bool doBias;                        // Bias subtraction
    32     bool doDark;                        // Dark subtraction
    33     bool doRemnance;                    // Remnance masking
    34     bool doShutter;                     // Shutter correction
    35     bool doFlat;                        // Flat-field normalisation
    36     bool doFringe;                      // Fringe subtraction
    37     bool doPhotom;                      // Source identification and photometry
    38     bool doBG;                          // Background subtraction
    39     bool doAstromChip;                  // per-chip Astrometry
    40     bool doAstromMosaic;                // full-mosaic Astrometry
    41     bool doStats;                       // call ppStats on the image
    42     bool checkCTE;                      // measure pixel-based variance
     18/// Get the configuration
     19pmConfig *ppNoiseMapArguments(int argc, char **argv);
    4320
    44     // output files requested
    45     bool BaseFITS;
    46     bool BaseMaskFITS;
    47     bool BaseVarianceFITS;
     21/// Determine what type of camera, and initialise
     22bool ppNoiseMapParseCamera(pmConfig *config);
    4823
    49     bool ChipFITS;
    50     bool ChipMaskFITS;
    51     bool ChipVarianceFITS;
     24/// Loop over the input
     25bool ppNoiseMapLoop(pmConfig *config);
    5226
    53     bool FPA1FITS;
    54     bool FPA2FITS;
    55     bool Bin1FITS;
    56     bool Bin1JPEG;
    57     bool Bin2FITS;
    58     bool Bin2JPEG;
     27/// free memory, check for leaks
     28void ppNoiseMapCleanup (pmConfig *config);
    5929
    60     // make values for abstract concepts of masking
    61     psImageMaskType maskValue;          // apply this bit-mask to choose masked bits
    62     psImageMaskType markValue;          // apply this bit-mask to choose masked bits
    63     psImageMaskType satMask;            // Mask value to give saturated pixels
    64     psImageMaskType badMask;            // Mask value to give bad pixels
    65     psImageMaskType flatMask;           // Mask value to give bad flat pixels
    66     psImageMaskType blankMask;          // Mask value to give blank pixels
    67 
    68     // non-linear correction parameters
    69     psDataType nonLinearType;
    70     psMetadataItem *nonLinearData;
    71     void *nonLinearSource;
    72 
    73     // options for the analysis
    74     pmOverscanOptions *overscan;        // Overscan options
    75 
    76     // binning parameters
    77     int xBin1;                          // x-binning, scale 1
    78     int yBin1;                          // y-binning, scale 1
    79     int xBin2;                          // x-binning, scale 2
    80     int yBin2;                          // y-binning, scale 2
    81 
    82     // parameters used by the fringe analysis
    83     float fringeRej;                    // Fringe rejection limit
    84     int fringeIter;                     // Fringe iterations
    85     float fringeKeep;                   // Fringe keep fraction
    86 
    87     int remnanceSize;                   // Size for remnance detection
    88     float remnanceThresh;               // Threshold for remnance detection
    89 
    90     char *normClass;                    // class to use for per-class normalization
    91 } ppImageOptions;
    92 
    93 // Cells to be used in the detrend
    94 typedef struct {
    95     pmCell *input;                      // The input cell, to be operated upon
    96     pmCell *mask;                       // The bad pixel mask
    97     pmCell *bias;                       // The bias correction
    98     pmCell *dark;                       // The dark correction
    99     pmCell *flat;                       // The flat-field correction
    100 } ppImageDetrend;
    101 
    102 ppImageOptions *ppImageOptionsAlloc(void);
    103 
    104 // Determine the processing options
    105 ppImageOptions *ppImageOptionsParse(pmConfig *config);
    106 
    107 // Get the configuration
    108 pmConfig *ppImageArguments(int argc, char **argv);
    109 
    110 // Determine what type of camera, and initialise
    111 ppImageOptions *ppImageParseCamera(pmConfig *config);
    112 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options);
    113 
    114 // Loop over the input
    115 bool ppImageLoop(pmConfig *config, ppImageOptions *options);
    116 
    117 // free memory, check for leaks
    118 void ppImageCleanup (pmConfig *config, ppImageOptions *options);
    119 
    120 // perform the detrend analysis on the current readout
    121 bool ppImageDetrendReadout (pmConfig *config, ppImageOptions *options, pmFPAview *view);
    122 
    123 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options);
    124 
    125 bool ppImageDetrendNonLinear(pmReadout *input, ppImageOptions *options);
    126 bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem);
    127 bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem);
    128 
    129 bool ppImageDetrendCell(ppImageDetrend *detrend, ppImageOptions *options, pmConfig *config);
    130 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options);
    131 pmReadout* ppImageDetrendSelectFirst(pmCell *cell, char *name, bool doThis);
    132 
    133 bool ppImageDetrendFree(pmConfig *config, pmFPAview *view);
    134 bool ppImageFringeFree(pmConfig *config, pmFPAview *view);
    135 
    136 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
    137 
    138 // Record which detrend file was used for the detrending
    139 bool ppImageDetrendRecord(
    140     pmCell *cell,                       // Cell of interest
    141     const pmConfig *config,             // Configuration
    142     const ppImageOptions *options,      // Processing options
    143     const pmFPAview *view               // View to cell
    144     );
    145 
    146 bool ppImageRebinChip (pmConfig *config, pmFPAview *view, ppImageOptions *options, char *outName);
    147 
    148 bool ppImagePhotom (pmConfig *config, pmFPAview *view);
    149 bool ppImageAstrom (pmConfig *config);
    150 bool ppImageAddstar (pmConfig *config);
    151 
    152 // Subtract background from the chip-mosaicked image
    153 bool ppImageSubtractBackground(
    154     pmConfig *config,                   // Configuration
    155     const pmFPAview *view,              // View to chip of interest
    156     const ppImageOptions *options       // Processing options
    157     );
    158 
    159 bool ppImageMosaicChip (pmConfig *config, const ppImageOptions *options, const pmFPAview *view,
    160                         const char *outFile, const char *inFile);
    161 bool ppImageMosaicFPA (pmConfig *config, const ppImageOptions *options,
    162                        const char *outFile, const char *inFile);
    163 
    164 bool ppImageSetMaskBits (pmConfig *config, ppImageOptions *options);
    165 
    166 void ppImageFileCheck (pmConfig *config);
    167 
    168 // functions used by ppFocus
    169 pmConfig *ppFocusArguments(int argc, char **argv);
    170 ppImageOptions *ppFocusParseCamera (pmConfig *config, int entry);
    171 bool ppFocusGetFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
    172 bool ppFocusFitFWHM (pmConfig *config, psVector *focus, psVector *fwhm);
    173 
    174 void ppFocusDropCamera (pmConfig *config);
    175 
    176 bool ppImageDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType);
    177 
    178 // write stats to output file
    179 bool ppImageStatsOutput(pmConfig *config, // Configuration
    180                         psMetadata *stats, // Statistics output
    181                         const ppImageOptions *options // Options
    182     );
    183 
    184 
    185 // Measure fringes
    186 bool ppImageDetrendFringeMeasure(pmReadout *readout, // Readout to measure
    187                                  pmCell *fringe, // Fringe cell (each readout is a different component)
    188                                  const bool isResidual,
    189                                  const ppImageOptions *options // Options
    190     );
    191 
    192 // Solve the fringe system
    193 bool ppImageDetrendFringeSolve(pmChip *scienceChip, // Chip with science
    194                                const pmChip *refChip, // Chip with reference fringes
    195                                const bool isResidual,
    196                                const ppImageOptions *options // Options
    197     );
    198 
    199 // Generate fringe frame
    200 bool ppImageDetrendFringeGenerate(pmCell *science, // Science cell
    201                                   pmCell *fringes, // Fringe cell, one readout per fringe component
    202                                   const ppImageOptions *options // Options
    203     );
    204 
    205 
    206 bool ppImageDetrendFringeApply (pmConfig *config, // config
    207                                 pmChip *chip, // science chip
    208                                 const pmFPAview *inputView, // current view
    209                                 const ppImageOptions *options // options
    210     );
     30/// define the input files
     31bool ppNoiseMapDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType);
    21132
    21233/// Return short version information
    213 psString ppImageVersion(void);
     34psString ppNoiseMapVersion(void);
    21435
    21536/// Return software source
    216 psString ppImageSource(void);
     37psString ppNoiseMapSource(void);
    21738
    21839/// Return long version information
    219 psString ppImageVersionLong(void);
     40psString ppNoiseMapVersionLong(void);
    22041
    22142/// Populate the header with version information for all dependencies
    222 bool ppImageVersionHeader(psMetadata *metadata ///< Header to populate
    223     );
     43bool ppNoiseMapVersionHeader(psMetadata *header);
    22444
    22545/// Print version information
    226 void ppImageVersionPrint(void);
    227 
    228 
    229 // calculate stats, including MD5
    230 bool ppImagePixelStats(pmConfig *config,// Configuration
    231                        psMetadata *stats, // Statistics output
    232                        const ppImageOptions *options, // Options
    233                        const pmFPAview *inputView // View to data
    234     );
    235 
    236 // calculate stats from headers and concepts
    237 bool ppImageMetadataStats(pmConfig *config, // Configuration
    238                           psMetadata *stats, // Statistics output
    239                           const ppImageOptions *options // Options
    240     );
    241 
    242 void ppImageFileCheck(pmConfig *config);
    243 
    244 /// Dump memory summary to text file
    245 void ppImageMemoryDump(const char *description);
     46void ppNoiseMapVersionPrint(void);
    24647
    24748#endif
Note: See TracChangeset for help on using the changeset viewer.