IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 10:00:02 AM (17 years ago)
Author:
Paul Price
Message:

Reorganising ppStackLoop: splitting into multiple separate functions which are joined using a common data carrier, ppStackOptions (which aren't really 'options', but that's the word I chose...).

File:
1 edited

Legend:

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

    r23195 r23341  
    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
     
    1818} ppStackMask;
    1919
    20 // Thread for stacking chunks
    21 //
    22 // Each input file contributes a readout, into which is read a chunk from that file
    23 typedef struct {
    24     psArray *readouts;                  // Input readouts to read and stack
    25     bool read;                          // Has the scan been read?
    26     bool busy;                          // Is the scan being processed?
    27     int firstScan;                      // First row of the chunk to be read for this group
    28     int lastScan;                       // Last row of the chunk to be read for this group
    29 } 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;
    3027
    31 // Allocator
    32 ppStackThread *ppStackThreadAlloc(psArray *readouts // Inputs readouts to read and stack
    33     );
    34 
    35 // Data for threads
    36 typedef struct {
    37     psArray *threads;                   // Threads doing stacking
    38     int lastScan;                       // Last row that's been read
    39     psArray *imageFits;                 // FITS file pointers for images
    40     psArray *maskFits;                  // FITS file pointers for masks
    41     psArray *varianceFits;                // FITS file pointers for variances
    42 } ppStackThreadData;
    43 
    44 // Set up thread data
    45 ppStackThreadData *ppStackThreadDataSetup(const psArray *cells, // Array of input cells
    46                                           const psArray *imageNames, // Names of images to read
    47                                           const psArray *maskNames, // Names of masks to read
    48                                           const psArray *varianceNames, // Names of variance maps to read
    49                                           const psArray *covariances, // Covariance matrices (already read)
    50                                           const pmConfig *config // Configuration
    51     );
    52 
    53 // Read chunk into the first available file thread
    54 ppStackThread *ppStackThreadRead(bool *status, // Status of read
    55                                  ppStackThreadData *stack, // Stacks available for reading
    56                                  pmConfig *config, // Configuration
    57                                  int numChunk, // Chunk number (only for interest)
    58                                  int overlap // Overlap between subsequent scans
    59     );
    60 
    61 // Initialise the threads
    62 void ppStackThreadInit(void);
    6328
    6429// Setup command-line arguments
     
    7338// Parse cameras
    7439bool ppStackCamera(pmConfig *config     // Configuration
    75     );
    76 
    77 // Loop over the inputs, doing the combination
    78 bool ppStackLoop(pmConfig *config       // Configuration
    7940    );
    8041
     
    12788    );
    12889
    129 // Perform photometry on stack
    130 bool ppStackPhotometry(pmConfig *config, // Configuration
    131                        const pmReadout *readout, // Readout to be photometered
    132                        const pmFPAview *view // View to readout
    133     );
    134 
    13590// Return software version
    13691psString ppStackVersion(void);
     
    171126    );
    172127
     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
    173171#endif
Note: See TracChangeset for help on using the changeset viewer.