IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ppStack

  • branches/cnb_branches/cnb_branch_20090301/ppStack/src/ppStack.h

    r21477 r23352  
    1 #ifndef PP_STACK_H
    2 #define PP_STACK_H
     1#ifndef PPSTACK_H
     2#define PPSTACK_H
    33
    44#define PPSTACK_RECIPE "PPSTACK"        // Name of the recipe
     
    1010// Mask values for inputs
    1111typedef enum {
    12     PPSTACK_MASK_MATCH  = 0x01,         // PSF-matching failed
    13     PPSTACK_MASK_CHI2   = 0x02,         // Chi^2 too deviant
    14     PPSTACK_MASK_REJECT = 0x04,         // Rejection failed
    15     PPSTACK_MASK_BAD    = 0x08,         // Bad image (too many pixels rejected)
     12    PPSTACK_MASK_CAL    = 0x01,         // Photometric calibration failed
     13    PPSTACK_MASK_MATCH  = 0x02,         // PSF-matching failed
     14    PPSTACK_MASK_CHI2   = 0x04,         // Chi^2 too deviant
     15    PPSTACK_MASK_REJECT = 0x08,         // Rejection failed
     16    PPSTACK_MASK_BAD    = 0x10,         // Bad image (too many pixels rejected)
    1617    PPSTACK_MASK_ALL    = 0xff          // All errors
    1718} ppStackMask;
    1819
    19 // Thread for stacking chunks
    20 //
    21 // Each input file contributes a readout, into which is read a chunk from that file
    22 typedef struct {
    23     psArray *readouts;                  // Input readouts to read and stack
    24     bool read;                          // Has the scan been read?
    25     bool busy;                          // Is the scan being processed?
    26     int firstScan;                      // First row of the chunk to be read for this group
    27     int lastScan;                       // Last row of the chunk to be read for this group
    28 } ppStackThread;
     20// List of files
     21typedef enum {
     22    PPSTACK_FILES_PREPARE,              // Files for preparation
     23    PPSTACK_FILES_CONVOLVE,             // Files for convolution
     24    PPSTACK_FILES_COMBINE,              // Files for combination
     25    PPSTACK_FILES_PHOT                  // Files for photometry
     26} ppStackFileList;
    2927
    30 // Allocator
    31 ppStackThread *ppStackThreadAlloc(psArray *readouts // Inputs readouts to read and stack
    32     );
    33 
    34 // Data for threads
    35 typedef struct {
    36     psArray *threads;                   // Threads doing stacking
    37     int lastScan;                       // Last row that's been read
    38     psArray *imageFits;                 // FITS file pointers for images
    39     psArray *maskFits;                  // FITS file pointers for masks
    40     psArray *varianceFits;                // FITS file pointers for variances
    41 } ppStackThreadData;
    42 
    43 // Set up thread data
    44 ppStackThreadData *ppStackThreadDataSetup(const psArray *cells, // Array of input cells
    45                                           const psArray *imageNames, // Names of images to read
    46                                           const psArray *maskNames, // Names of masks to read
    47                                           const psArray *varianceNames, // Names of variance maps to read
    48                                           const psArray *covariances, // Covariance matrices (already read)
    49                                           const pmConfig *config // Configuration
    50     );
    51 
    52 // Read chunk into the first available file thread
    53 ppStackThread *ppStackThreadRead(bool *status, // Status of read
    54                                  ppStackThreadData *stack, // Stacks available for reading
    55                                  pmConfig *config, // Configuration
    56                                  int numChunk, // Chunk number (only for interest)
    57                                  int overlap // Overlap between subsequent scans
    58     );
    59 
    60 // Initialise the threads
    61 void ppStackThreadInit(void);
    6228
    6329// Setup command-line arguments
     
    7440    );
    7541
    76 // Loop over the inputs, doing the combination
    77 bool ppStackLoop(pmConfig *config       // Configuration
    78     );
    79 
    8042// Determine target PSF for input images
    8143pmPSF *ppStackPSF(const pmConfig *config, // Configuration
    8244                  int numCols, int numRows, // Size of image
    83                   const psArray *psfs   // List of input PSFs
     45                  const psArray *psfs,  // List of input PSFs
     46                  const psVector *inputMask // Mask for inputs
    8447    );
    8548
     
    12588    );
    12689
    127 // Perform photometry on stack
    128 bool ppStackPhotometry(pmConfig *config, // Configuration
    129                        const pmReadout *readout, // Readout to be photometered
    130                        const pmFPAview *view // View to readout
    131     );
    132 
    13390// Return software version
    13491psString ppStackVersion(void);
     92
     93/// Return software source
     94psString ppStackSource(void);
    13595
    13696// Return long description of software version
    13797psString ppStackVersionLong(void);
    13898
    139 // Supplement metadata with software version
    140 void ppStackVersionMetadata(psMetadata *metadata // Metadata to supplement
     99// Supplement header with software version
     100bool ppStackVersionHeader(psMetadata *header // Header to supplement
    141101    );
     102
     103/// Print version information
     104void ppStackVersionPrint(void);
    142105
    143106/// Convolve image to match specified seeing
     
    158121/// Corrects the source PSF photometry to a common system.  Return the sum of the exposure times.
    159122float ppStackSourcesTransparency(const psArray *sourceLists, // Sources for each input
     123                                 psVector *inputMask, // Indicates bad input
    160124                                 const pmFPAview *view, // View to readout
    161125                                 const pmConfig *config // Configuration
    162126    );
    163127
     128/// Dump memory debugging information
     129void ppStackMemDump(
     130    const char *name                    ///< Stage name, for inclusion in the output file name
     131    );
     132
     133/// Activate/deactivate a list of files
     134void ppStackFileActivation(
     135    pmConfig *config,                   // Configuration
     136    ppStackFileList list,               // Files to turn on/off
     137    bool state                          // Activation state
     138    );
     139
     140// Activate/deactivate a single element for a list
     141void ppStackFileActivationSingle(
     142    pmConfig *config,                   // Configuration
     143    ppStackFileList list,               // Files to turn on/off
     144    bool state,                         // Activation state
     145    int num                             // Number of file in sequence
     146    );
     147
     148/// Iterate down the hierarchy, loading files
     149///
     150/// We can get away with this simplistic treatment of the FPA hierarchy because we're working on skycells.
     151pmFPAview *ppStackFilesIterateDown(
     152    pmConfig *config                    // Configuration
     153    );
     154
     155/// Iterate up the hierarchy, writing files
     156///
     157/// We can get away with this simplistic treatment of the FPA hierarchy because we're working on skycells.
     158bool ppStackFilesIterateUp(
     159    pmConfig *config                    // Configuration
     160    );
     161
     162/// Write an image to a FITS file
     163bool ppStackWriteImage(
     164    const char *name,                   // Name of image
     165    psMetadata *header,                 // Header
     166    const psImage *image,               // Image
     167    pmConfig *config                    // Configuration
     168    );
     169
     170
    164171#endif
Note: See TracChangeset for help on using the changeset viewer.