IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppSub

  • branches/cnb_branches/cnb_branch_20090301/ppSub/src

    • Property svn:ignore
      •  

        old new  
        1010stamp-h1
        1111ppSubKernel
         12ppSubErrorCodes.h
         13ppSubErrorCodes.c
         14ppSubVersionDefinitions.h
  • branches/cnb_branches/cnb_branch_20090301/ppSub/src/ppSub.h

    r23352 r24244  
    1414#define PP_SUB_H
    1515
     16#include <stdio.h>
    1617#include <pslib.h>
    1718#include <psmodules.h>
     19
     20#include "ppSubErrorCodes.h"
    1821
    1922/// @addtogroup ppSub
     
    2124
    2225#define PPSUB_RECIPE "PPSUB"            /// Name of the recipe to use
     26#define WCS_TOLERANCE 0.001             // Tolerance for WCS
     27
     28// Output files, for activation/deactivation
     29typedef enum {
     30    PPSUB_FILES_INPUT    = 0x01,        // Input files
     31    PPSUB_FILES_CONV     = 0x02,        // Convolved files (output)
     32    PPSUB_FILES_SUB      = 0x04,        // Subtracted files (output)
     33    PPSUB_FILES_INV      = 0x08,        // Inverse subtracted files (output)
     34    PPSUB_FILES_PSF      = 0x10,        // PSF files (output)
     35    PPSUB_FILES_PHOT_SUB = 0x20,        // Subtraction photometry files (output)
     36    PPSUB_FILES_PHOT_INV = 0x40,        // Inverse subtraction photometry files (output)
     37    PPSUB_FILES_PHOT     = 0x80,        // General photometry files (internal)
     38    PPSUB_FILES_ALL      = 0xFF,        // All files
     39} ppSubFiles;
     40
     41/// Data for processing
     42typedef struct {
     43    pmConfig *config;                   // Configuration
     44    psErrorCode quality;                // Quality code; 0 for no problem
     45    bool photometry;                    // Perform photometry?
     46    bool inverse;                       // Output inverse subtraction as well?
     47    psString stamps;                    // Stamps file
     48    pmPSF *psf;                         // Point Spread Function
     49    psString statsName;                 // Name of statistics file
     50    FILE *statsFile;                    // Statistics file
     51    psMetadata *stats;                  // Statistics
     52} ppSubData;
     53
     54/// Constructor
     55ppSubData *ppSubDataAlloc(pmConfig *config ///< Configuration
     56    );
    2357
    2458/// Setup the arguments parsing
    25 bool ppSubArgumentsSetup(int argc, char *argv[], ///< Command-line arguments
    26                          pmConfig *config    ///< Configuration
    27     );
    28 
    29 /// Parse the arguments
    30 bool ppSubArgumentsParse(pmConfig *config ///< Configuration
     59bool ppSubArguments(int argc, char *argv[], ///< Command-line arguments
     60                    ppSubData *data ///< Processing data
    3161    );
    3262
    3363/// Parse the camera input
    34 bool ppSubCamera(pmConfig *config       ///< Configuration
     64bool ppSubCamera(ppSubData *data        ///< Processing data
    3565    );
    3666
    3767/// Loop over the FPA hierarchy
    38 bool ppSubLoop(pmConfig *config         ///< Configuration
    39     );
    40 
    41 /// Perform PSF-matched image subtraction on the readout
    42 bool ppSubReadout(pmConfig *config,     ///< Configuration
    43                   psMetadata *stats,    ///< Statistics, for output
    44                   const pmFPAview *view ///< View of readout to subtract
     68bool ppSubLoop(ppSubData *data          ///< Processing data
    4569    );
    4670
    4771/// Generate (if needed) and set or update the masks for input and reference images
    48 bool ppSubSetMasks(pmConfig *config,     ///< Configuration
    49                    const pmFPAview *view ///< View of active readout
     72bool ppSubSetMasks(pmConfig *config     ///< Configuration
    5073    );
    5174
    5275/// Generate the PSF-matching kernel and convolve the images as needed.  Most of this function involves
    5376/// looking up the parameters in the recipe and supplying them to the function pmSubtractionMatch()
    54 bool ppSubMatchPSFs(pmConfig *config,    ///< Configuration
    55                     const pmFPAview *view ///< View of active readout
     77bool ppSubMatchPSFs(ppSubData *data     ///< Processing data
    5678    );
    5779
    5880/// Generate the output readout and pass the kernel info to the header
    59 bool ppSubDefineOutput(pmConfig *config, ///< Configuration
    60                        const pmFPAview *view ///< View of active readout
     81bool ppSubDefineOutput(const char *name,///< Name of output to define
     82                       pmConfig *config ///< Configuration
    6183    );
    6284
    6385/// Photometry stage 1: measure the PSF from the minuend image
    64 bool ppSubMakePSF(pmConfig *config,       ///< Configuration
    65                   const pmFPAview *view ///< View of active readout
     86bool ppSubMakePSF(ppSubData *data       ///< Processing data
    6687    );
    6788
    6889/// Perform the actual image subtraction, update output concepts
    69 bool ppSubReadoutSubtract(pmConfig *config,       ///< Configuration
    70                           const pmFPAview *view ///< View of active readout
     90bool ppSubReadoutSubtract(pmConfig *config ///< Configuration
    7191    );
    7292
    7393
    7494/// Photometry stage 2: find and measure sources on the subtracted image
    75 bool ppSubReadoutPhotometry(pmConfig *config,     ///< Configuration
    76                             psMetadata *stats,    ///< Statistics, for output
    77                             const pmFPAview *view ///< View of active readout
    78     );
    79 
    80 /// Renormalize, update headers and generate JPEGs
    81 bool ppSubReadoutUpdate(pmConfig *config, ///< Configuration
    82                         psMetadata *stats, ///< Statistics for output, or NULL
    83                         const pmFPAview *view ///< View of active readout
     95bool ppSubReadoutPhotometry(const char *name, ///< Name of file to photometer
     96                            ppSubData *data ///< Processing data
    8497    );
    8598
    8699/// Higher-order background subtraction
    87 bool ppSubBackground(pmConfig *config,  ///< Configuration
    88                      const pmFPAview *view ///< View to readout
     100bool ppSubBackground(pmConfig *config   ///< Configuration
    89101    );
    90102
     
    96108void ppSubVersionPrint(void);
    97109
     110/// Mark the data quality as bad and prepare to suspend processing
     111void ppSubDataQuality(ppSubData *data,  ///< Processing data
     112                      psErrorCode error,///< Error code
     113                      ppSubFiles files  ///< Files to deactivate
     114    );
     115
     116
     117/// Activate or deactivate files
     118void ppSubFilesActivate(pmConfig *config, // Configuration
     119                        ppSubFiles files, // File to activate/deactivate
     120                        bool state      // Activation state
     121    );
     122
     123/// Generate a view suitable for a readout
     124///
     125/// Assumes we're working with skycells
     126pmFPAview *ppSubViewReadout(void);
     127
     128/// Iterate down the FPA hierarchy, opening files
     129bool ppSubFilesIterateDown(pmConfig *config, // Configuration
     130                           ppSubFiles files // Files to open
     131    );
     132
     133/// Iterate up the FPA hierarchy, closing files
     134bool ppSubFilesIterateUp(pmConfig *config, // Configuration
     135                         ppSubFiles files // Files to open
     136    );
     137
     138/// Collect statistics
     139bool ppSubReadoutStats(ppSubData *data  // Processing data
     140    );
     141
     142/// Generate JPEG images
     143bool ppSubReadoutJpeg(pmConfig *config  // Configuration
     144    );
     145
     146/// Generate inverse subtraction
     147bool ppSubReadoutInverse(pmConfig *config // Configuration
     148    );
     149
    98150
    99151// Copy every instance of a single keyword from one metadata to another
Note: See TracChangeset for help on using the changeset viewer.