IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21238


Ignore:
Timestamp:
Jan 30, 2009, 12:00:00 PM (17 years ago)
Author:
giebink
Message:

Doxygen comments added

Location:
branches/eam_branch_20081230/ppMerge/src
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/ppMerge/src/ppMerge.c

    r18839 r21238  
     1/** @file ppMerge.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.25.20.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
     
    1224    psTimerStart(TIMERNAME);
    1325
    14     psExit exitValue = PS_EXIT_SUCCESS; // Exit value for program
     26    psExit exitValue = PS_EXIT_SUCCESS; ///< Exit value for program
    1527
    16     pmConfig *config = pmConfigRead(&argc, argv, PPMERGE_RECIPE); // Configuration
     28    pmConfig *config = pmConfigRead(&argc, argv, PPMERGE_RECIPE); ///< Configuration
    1729    if (!config) {
    1830        psErrorStackPrint(stderr, "Error reading configuration.");
     
    2739    }
    2840
    29     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
     41    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
    3042    switch (type) {
    3143      case PPMERGE_TYPE_MASK:
     
    5870
    5971    // Output the statistics
    60     bool mdok;                          // Status of MD lookup
    61     psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); // Statistics file name
     72    bool mdok;                          ///< Status of MD lookup
     73    psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); ///< Statistics file name
    6274    if (mdok && statsName && strlen(statsName) > 0) {
    63         psString resolved = pmConfigConvertFilename(statsName, config, true, true); // Resolved filename
    64         FILE *statsFile = fopen(resolved, "w"); // Output statistics file
     75        psString resolved = pmConfigConvertFilename(statsName, config, true, true); ///< Resolved filename
     76        FILE *statsFile = fopen(resolved, "w"); ///< Output statistics file
    6577        if (!statsFile) {
    6678            psError(PS_ERR_IO, true, "Unable to open statistics file %s for writing.", resolved);
     
    7082        }
    7183        psFree(resolved);
    72         psMetadata *stats = psMetadataLookupMetadata(&mdok, config->arguments, "STATS.DATA"); // Statistics
     84        psMetadata *stats = psMetadataLookupMetadata(&mdok, config->arguments, "STATS.DATA"); ///< Statistics
    7385        if (!stats) {
    7486            psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find statistics");
     
    7688            goto die;
    7789        }
    78         psString statsOut = psMetadataConfigFormat(stats); // String to write out
     90        psString statsOut = psMetadataConfigFormat(stats); ///< String to write out
    7991        fprintf(statsFile, "%s", statsOut);
    8092        psFree(statsOut);
  • branches/eam_branch_20081230/ppMerge/src/ppMerge.h

    r21072 r21238  
     1/** @file ppMerge.h
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.12.18.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#ifndef PP_MERGE_H
    214#define PP_MERGE_H
     
    1325#include <ppStats.h>
    1426
    15 #define TIMERNAME "ppMerge"             // Name for timer
    16 #define PPMERGE_RECIPE "PPMERGE"        // Recipe name
    17 #define THREADED 1                      // Compile with threads?
     27/// @addtogroup ppArith
     28/// @{
    1829
    19 // Type of frame to merge
     30#define TIMERNAME "ppMerge"             ///< Name for timer
     31#define PPMERGE_RECIPE "PPMERGE"        ///< Recipe name
     32#define THREADED 1                      ///< Compile with threads?
     33
     34/**
     35 * Type of frame to merge
     36 */
    2037typedef enum {
    21     PPMERGE_TYPE_UNKNOWN,               // Unknown type
    22     PPMERGE_TYPE_BIAS,                  // Bias frame
    23     PPMERGE_TYPE_DARK,                  // (Multi-)Dark frame
    24     PPMERGE_TYPE_MASK,                  // Mask frame
    25     PPMERGE_TYPE_SHUTTER,               // Shutter frame
    26     PPMERGE_TYPE_FLAT,                  // Flat-field frame (dome or sky)
    27     PPMERGE_TYPE_FRINGE,                // Fringe frame
     38    PPMERGE_TYPE_UNKNOWN,               ///< Unknown type
     39    PPMERGE_TYPE_BIAS,                  ///< Bias frame
     40    PPMERGE_TYPE_DARK,                  ///< (Multi-)Dark frame
     41    PPMERGE_TYPE_MASK,                  ///< Mask frame
     42    PPMERGE_TYPE_SHUTTER,               ///< Shutter frame
     43    PPMERGE_TYPE_FLAT,                  ///< Flat-field frame (dome or sky)
     44    PPMERGE_TYPE_FRINGE,                ///< Fringe frame
    2845} ppMergeType;
    2946
    30 // Files, for activation
     47/**
     48 * Files, for activation
     49 */
    3150typedef enum {
    32     PPMERGE_FILES_ALL,                  // All files
    33     PPMERGE_FILES_INPUT,                // Input files
    34     PPMERGE_FILES_OUTPUT                // Output files
     51    PPMERGE_FILES_ALL,                  ///< All files
     52    PPMERGE_FILES_INPUT,                ///< Input files
     53    PPMERGE_FILES_OUTPUT                ///< Output files
    3554} ppMergeFiles;
    3655
    37 // Group of files to read
    38 //
    39 // Each file contributes a readout, into which is read a chunk from that file
     56/**
     57 * \brief Group of files to read
     58 *
     59 * Each file contributes a readout, into which is read a chunk from that file
     60 */
    4061typedef struct {
    41     psArray *readouts;                  // Input readouts
    42     bool read;                          // Has the scan been read?
    43     bool busy;                          // Is the scan being processed?
    44     int firstScan;                      // First row of the chunk to be read for this group
    45     int lastScan;                       // Last row of the chunk to be read for this group
     62    psArray *readouts;                  ///< Input readouts
     63    bool read;                          ///< Has the scan been read?
     64    bool busy;                          ///< Is the scan being processed?
     65    int firstScan;                      ///< First row of the chunk to be read for this group
     66    int lastScan;                       ///< Last row of the chunk to be read for this group
    4667} ppMergeFileGroup;
    4768
    48 // Parse command-line arguments and recipe
    49 bool ppMergeArguments(int argc, char *argv[], // Command-line arguments
    50                       pmConfig *config  // Configuration
     69/**
     70 * Parse command-line arguments and recipe
     71 */
     72bool ppMergeArguments(int argc, char *argv[], ///< Command-line arguments
     73                      pmConfig *config  ///< Configuration
    5174    );
    5275
    53 // Set up camera files
    54 bool ppMergeCamera(pmConfig *config     // Configuration
     76/**
     77 * Set up camera files
     78 */
     79bool ppMergeCamera(pmConfig *config     ///< Configuration
    5580    );
    5681
    57 // Measure scale and zero-points
    58 bool ppMergeScaleZero(pmConfig *config  // Configuration
     82/**
     83 * Measure scale and zero-points
     84 */
     85bool ppMergeScaleZero(pmConfig *config  ///< Configuration
    5986    );
    6087
    61 // Main loop to do the merging
    62 bool ppMergeLoop(pmConfig *config       // Configuration
     88/**
     89 * Main loop to do the merging
     90 */
     91bool ppMergeLoop(pmConfig *config       ///< Configuration
    6392    );
    6493
    65 // Main loop for masks
    66 bool ppMergeMask(pmConfig *config       // Configuration
     94/**
     95 * Main loop for masks
     96 */
     97bool ppMergeMask(pmConfig *config       ///< Configuration
    6798    );
    6899
    69 // Read nominated input file
    70 bool ppMergeFileReadInput(pmConfig *config, // Configuration
    71                           pmReadout *readout, // Readout into which to read
    72                           int num,      // Number of file in sequence
    73                           int rows      // Number of rows to read at once
     100/**
     101 * Read nominated input file
     102 */
     103bool ppMergeFileReadInput(pmConfig *config, ///< Configuration
     104                          pmReadout *readout, ///< Readout into which to read
     105                          int num,      ///< Number of file in sequence
     106                          int rows      ///< Number of rows to read at once
    74107    );
    75108
    76 // Open nominated input file
    77 bool ppMergeFileOpenInput(pmConfig *config, // Configuration
    78                           const pmFPAview *view, // View to open
    79                           int num       // Number of file in sequence
     109/**
     110 * Open nominated input file
     111 */
     112bool ppMergeFileOpenInput(pmConfig *config, ///< Configuration
     113                          const pmFPAview *view, ///< View to open
     114                          int num       ///< Number of file in sequence
    80115    );
    81116
    82 // Set the data level for files specified by name; return an array of the files
    83 psArray *ppMergeFileDataLevel(const pmConfig *config, // Configuration
    84                               const char *name, // Name of files
    85                               pmFPALevel level // Level for file data level
     117/**
     118 * Set the data level for files specified by name; return an array of the files
     119 */
     120psArray *ppMergeFileDataLevel(const pmConfig *config, ///< Configuration
     121                              const char *name, ///< Name of files
     122                              pmFPALevel level ///< Level for file data level
    86123    );
    87124
    88 // Activate/deactivate a list of files
    89 bool ppMergeFileActivate(const pmConfig *config, // Configuration
    90                          ppMergeFiles files, // Files to turn on/off
    91                          bool state     // Activation state
     125/**
     126 * Activate/deactivate a list of files
     127 */
     128bool ppMergeFileActivate(const pmConfig *config, ///< Configuration
     129                         ppMergeFiles files, ///< Files to turn on/off
     130                         bool state     ///< Activation state
    92131    );
    93132
    94 // Activate/deactivate a single element for a list; return array of files
    95 psArray *ppMergeFileActivateSingle(const pmConfig *config, // Configuration
    96                                    ppMergeFiles files, // Files to turn on/off
    97                                    bool state,   // Activation state
    98                                    int num // Number of file in sequence
     133/**
     134 * Activate/deactivate a single element for a list; return array of files
     135 */
     136psArray *ppMergeFileActivateSingle(const pmConfig *config, ///< Configuration
     137                                   ppMergeFiles files, ///< Files to turn on/off
     138                                   bool state,   ///< Activation state
     139                                   int num ///< Number of file in sequence
    99140    );
    100141
    101 // Return name of output pmFPAfile
    102 psString ppMergeOutputFile(const pmConfig *config // Configuration
     142/**
     143 * Return name of output pmFPAfile
     144 */
     145psString ppMergeOutputFile(const pmConfig *config ///< Configuration
    103146    );
    104147
    105148
    106 // Allocator for group of files
     149/**
     150 * Allocator for group of files
     151 */
    107152ppMergeFileGroup *ppMergeFileGroupAlloc(void);
    108153
    109 // Read chunk into the first available file group
    110 ppMergeFileGroup *ppMergeReadChunk(bool *status, // Status of read
    111                                    psArray *fileGroups, // All groups
    112                                    pmConfig *config, // Configuration
    113                                    int numChunk // Chunk number (only for interest)
     154/**
     155 * Read chunk into the first available file group
     156 */
     157ppMergeFileGroup *ppMergeReadChunk(bool *status, ///< Status of read
     158                                   psArray *fileGroups, ///< All groups
     159                                   pmConfig *config, ///< Configuration
     160                                   int numChunk ///< Chunk number (only for interest)
    114161    );
    115162
    116 // Set up thread handling
     163/**
     164 * Set up thread handling
     165 */
    117166bool ppMergeSetThreads(void);
    118167
     168///@}
    119169#endif
  • branches/eam_branch_20081230/ppMerge/src/ppMergeArguments.c

    r21087 r21238  
     1/** @file ppMergeArguments.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.13.14.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    3 // Print usage information and die
    4 static void usage(const char *program,  // Name of the program
    5                   psMetadata *arguments // Command-line arguments
     15/**
     16 * Print usage information and die
     17 */
     18static void usage(const char *program,  ///< Name of the program
     19                  psMetadata *arguments ///< Command-line arguments
    620    )
    721{
     
    1832}
    1933
    20 // Get a float-point value from the command-line or recipe, and add it to the arguments
     34/**
     35 * Get a float-point value from the command-line or recipe, and add it to the arguments
     36 */
    2137#define VALUE_ARG_RECIPE_FLOAT(ARGNAME, RECIPENAME, TYPE) { \
    2238    ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
     
    3349}
    3450
    35 // Get an integer value from the command-line or recipe, and add it to the arguments
     51/**
     52 * Get an integer value from the command-line or recipe, and add it to the arguments
     53 */
    3654#define VALUE_ARG_RECIPE_INT(ARGNAME, RECIPENAME, TYPE, UNSET) { \
    3755    ps##TYPE value = psMetadataLookup##TYPE(NULL, arguments, ARGNAME); \
     
    4866}
    4967
    50 // Get a boolean from the command-line or recipe, and add it to the arguments if either is set
     68/**
     69 * Get a boolean from the command-line or recipe, and add it to the arguments if either is set
     70 */
    5171#define VALUE_ARG_RECIPE_BOOL(ARGNAME, RECIPENAME) { \
    5272    bool value = (psMetadataLookupBool(NULL, arguments, ARGNAME) || \
     
    5575}
    5676
    57 // Get a statistic name from the command-line or recipe, and add the enum to the arguments
     77/**
     78 * Get a statistic name from the command-line or recipe, and add the enum to the arguments
     79 */
    5880#define VALUE_ARG_RECIPE_STAT(ARGNAME, RECIPENAME) { \
    5981    const char *stat = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    6991}
    7092
    71 // Get a string from the command-line or recipe, and add to the arguments
     93/**
     94 * Get a string from the command-line or recipe, and add to the arguments
     95 */
    7296#define VALUE_ARG_RECIPE_STR(ARGNAME, RECIPENAME) { \
    7397    const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    83107}
    84108
    85 // Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
     109/**
     110 * Get a string from the command-line or recipe, and add the appropriate mask value to the arguments
     111 */
    86112#define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \
    87113    const char *str = psMetadataLookupStr(NULL, arguments, ARGNAME); \
     
    98124}
    99125
    100 // Get a string value from the command-line and add it to the target
    101 static bool valueArgStr(psMetadata *arguments, // Command-line arguments
    102                         const char *argName, // Argument name in the command-line arguments
    103                         const char *mdName, // Name for value in the metadata
    104                         psMetadata *target // Target metadata to which to add value
     126/**
     127 * Get a string value from the command-line and add it to the target
     128 */
     129static bool valueArgStr(psMetadata *arguments, ///< Command-line arguments
     130                        const char *argName, ///< Argument name in the command-line arguments
     131                        const char *mdName, ///< Name for value in the metadata
     132                        psMetadata *target ///< Target metadata to which to add value
    105133                        )
    106134{
    107     psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest
     135    psString value = psMetadataLookupStr(NULL, arguments, argName); ///< Value of interest
    108136    if (value && strlen(value) > 0) {
    109137        return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
     
    116144    assert(config);
    117145
    118     psMetadata *arguments = psMetadataAlloc(); // Command-line arguments
     146    psMetadata *arguments = psMetadataAlloc(); ///< Command-line arguments
    119147    psMetadataAddStr(arguments, PS_LIST_TAIL, "-type", 0, "Type of calibration frame", NULL);
    120148    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "MDC file to hold statistics ", NULL);
     
    136164    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stdev",    0, "Statistic to use to measure the stdev", NULL);
    137165
    138     // Fringe construction parameters
     166    /** Fringe construction parameters */
    139167    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-num",     0, "Number of fringe regions", 0);
    140168    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-size",    0, "Half-size of fringe regions", 0);
     
    142170    psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-ysmooth", 0, "Number of smoothing regions in y", 0);
    143171
    144     // Shutter construction parameters
     172    /** Shutter construction parameters */
    145173    psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-size", 0, "Size for shutter measurement regions", 0);
    146174    psMetadataAddS32(arguments, PS_LIST_TAIL, "-shutter-iter", 0, "Number of iterations for shutter", 0);
    147175    psMetadataAddF32(arguments, PS_LIST_TAIL, "-shutter-rej",  0, "Rejection limit for shutter", NAN);
    148176
    149     // Mask construction parameters
     177    /** Mask construction parameters */
    150178    psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-suspect",  0, "Threshold for suspect pixels (sigma)", NAN);
    151179    psMetadataAddF32(arguments, PS_LIST_TAIL, "-mask-bad",      0, "Threshold for bad pixels (sigma)", NAN);
     
    189217    }
    190218
    191     unsigned int numBad = 0;                     // Number of bad lines
    192     psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); // Information about inputs
     219    unsigned int numBad = 0;                     ///< Number of bad lines
     220    psMetadata *inputs = psMetadataConfigRead(NULL, &numBad, argv[1], false); ///< Information about inputs
    193221    if (!inputs || numBad > 0) {
    194222        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to cleanly read MDC file with inputs.");
     
    205233
    206234    // Set the type of calibration frame
    207     const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); // Type of calibration
    208     if (strlen(typeStr) <= 0) {
     235    const char *typeStr = psMetadataLookupStr(NULL, arguments, "-type"); ///<Type of calibration
     236    if (!typeStr || strlen(typeStr) <= 0) {
    209237      psError(PS_ERR_UNKNOWN, false, "No -type specified.");
    210238      goto ERROR;
    211239    }
    212     ppMergeType type = PPMERGE_TYPE_UNKNOWN; // Enumerated type for frame type
     240    ppMergeType type = PPMERGE_TYPE_UNKNOWN; ///< Enumerated type for frame type
    213241    if (strcasecmp(typeStr, "BIAS") == 0) {
    214242      type = PPMERGE_TYPE_BIAS;
     
    258286    }
    259287
    260     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); // Recipe for ppSim
     288    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPMERGE_RECIPE); ///< Recipe for ppSim
    261289    if (!recipe) {
    262290        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPMERGE_RECIPE);
     
    264292    }
    265293
    266     // Standard combination parameters
     294    /** Standard combination parameters */
    267295    VALUE_ARG_RECIPE_INT("-rows",       "ROWS",     S32, 0);
    268296    VALUE_ARG_RECIPE_INT("-sample",     "SAMPLE",   S32, 0);
     
    281309    VALUE_ARG_RECIPE_STAT("-stdev",     "STDEV");
    282310
    283     // Fringe construction parameters
     311    /** Fringe construction parameters */
    284312    VALUE_ARG_RECIPE_INT("-fringe-num",     "FRINGE.NUM",     S32, 0);
    285313    VALUE_ARG_RECIPE_INT("-fringe-size",    "FRINGE.SIZE",    S32, 0);
     
    287315    VALUE_ARG_RECIPE_INT("-fringe-ysmooth", "FRINGE.YSMOOTH", S32, 0);
    288316
    289     // Shutter construction parameters
     317    /** Shutter construction parameters */
    290318    VALUE_ARG_RECIPE_INT("-shutter-size",  "SHUTTER.SIZE", S32, 0);
    291319
    292     // Mask construction parameters
     320    /** Mask construction parameters */
    293321    VALUE_ARG_RECIPE_FLOAT("-mask-suspect", "MASK.SUSPECT", F32);
    294322    VALUE_ARG_RECIPE_FLOAT("-mask-bad",     "MASK.BAD",     F32);
     
    300328    VALUE_ARG_RECIPE_FLOAT("-mask-smooth-scale", "MASK.SMOOTH.SCALE", F32);
    301329
    302     const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); // Mode to identify bad pix
     330    const char *maskModeStr = psMetadataLookupStr(NULL, arguments, "-mask-mode"); ///< Mode to identify bad pix
    303331    if (!maskModeStr) {
    304332        maskModeStr = psMetadataLookupStr(NULL, recipe, "MASK.MODE");
     
    318346
    319347    if (type == PPMERGE_TYPE_DARK) {
    320         psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); // Ordinates info
    321         psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); // Translated version
    322 
    323         psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); // Iterator
    324         psMetadataItem *item;           // Item from iteration
     348        psMetadata *ordinates = psMetadataLookupMetadata(NULL, recipe, "DARK.ORDINATES"); ///< Ordinates info
     349        psArray *translated = psArrayAllocEmpty(psListLength(ordinates->list)); ///< Translated version
     350
     351        psMetadataIterator *iter = psMetadataIteratorAlloc(ordinates, PS_LIST_HEAD, NULL); ///< Iterator
     352        psMetadataItem *item;           ///< Item from iteration
    325353        while ((item = psMetadataGetAndIncrement(iter))) {
    326             int order = 0;              // Polynomial order
    327             bool scale = false;         // Scale values?
    328             float min = NAN, max = NAN; // Minimum and maximum values for scaling
     354            int order = 0;              ///< Polynomial order
     355            bool scale = false;         ///< Scale values?
     356            float min = NAN, max = NAN; ///< Minimum and maximum values for scaling
    329357            switch (item->type) {
    330358              case PS_TYPE_S32:
     
    333361              case PS_DATA_METADATA:
    334362                order = psMetadataLookupS32(NULL, item->data.md, "ORDER");
    335                 bool mdok;                  // Status of MD lookup
     363                bool mdok;                  ///< Status of MD lookup
    336364                scale = psMetadataLookupBool(&mdok, item->data.md, "SCALE");
    337365                min = psMetadataLookupF32(&mdok, item->data.md, "MIN");
     
    361389        psMetadataAddArray(config->arguments, PS_LIST_TAIL, "DARK.ORDINATES", 0,
    362390                           "Ordinates to fit for dark", translated);
    363         psFree(translated);             // Drop reference
    364 
    365         psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); // Normalisation concept
     391        psFree(translated);             ///< Drop reference
     392
     393        psString darkNorm = psMetadataLookupStr(NULL, recipe, "DARK.NORM"); ///<Normalisation concept
    366394        if (darkNorm && strcmp(darkNorm, "NONE") != 0) {
    367395            psMetadataAddStr(config->arguments, PS_LIST_TAIL, "DARK.NORM", 0,
  • branches/eam_branch_20081230/ppMerge/src/ppMergeCamera.c

    r21072 r21238  
     1/** @file ppMergeCamera.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.7.18.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    3 // Define an output file, with its own FPA
    4 bool outputFile(pmConfig *config,       // Configuration
    5                 const char *name,       // Name of output file
    6                 pmFPAfileType type,     // Type of file
    7                 const char *description, // Description of file
    8                 psMetadata *format,     // Camera format
    9                 pmFPAview *view         // View for PHU
     15/**
     16 * Define an output file, with its own FPA
     17 */
     18bool outputFile(pmConfig *config,       ///< Configuration
     19                const char *name,       ///< Name of output file
     20                pmFPAfileType type,     ///< Type of file
     21                const char *description, ///< Description of file
     22                psMetadata *format,     ///< Camera format
     23                pmFPAview *view         ///< View for PHU
    1024    )
    1125{
     
    1529
    1630    // Output image
    17     pmFPA *fpa = pmFPAConstruct(config->camera, config->cameraName); // FPA to contain the output
     31    pmFPA *fpa = pmFPAConstruct(config->camera, config->cameraName); ///< FPA to contain the output
    1832    if (!fpa) {
    1933        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to construct an FPA from camera configuration.");
     
    8498    bool haveWeights = false;           // Do we have weight maps?
    8599
    86     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
    87     psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); // The inputs info
    88     psMetadataIterator *iter = psMetadataIteratorAlloc(inputs, PS_LIST_HEAD, NULL); // Iterator
    89     psMetadataItem *item;               // Item from iteration
    90     int numFiles = 0;                   // Number of files
     100    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
     101    psMetadata *inputs = psMetadataLookupMetadata(NULL, config->arguments, "INPUTS"); ///< The inputs info
     102    psMetadataIterator *iter = psMetadataIteratorAlloc(inputs, PS_LIST_HEAD, NULL); ///< Iterator
     103    psMetadataItem *item;               ///< Item from iteration
     104    int numFiles = 0;                   ///< Number of files
    91105    while ((item = psMetadataGetAndIncrement(iter))) {
    92106        if (item->type != PS_DATA_METADATA) {
     
    97111        }
    98112
    99         psMetadata *input = item->data.md; // The input metadata of interest
    100 
    101         psString image = psMetadataLookupStr(NULL, input, "IMAGE"); // Name of image
     113        psMetadata *input = item->data.md; ///< The input metadata of interest
     114
     115        psString image = psMetadataLookupStr(NULL, input, "IMAGE"); ///< Name of image
    102116        if (!image || strlen(image) == 0) {
    103117            psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Component %s lacks IMAGE of type STR", item->name);
     
    107121
    108122        bool mdok;
    109         psString mask = psMetadataLookupStr(&mdok, input, "MASK"); // Name of mask
    110         psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); // Name of weight map
     123        psString mask = psMetadataLookupStr(&mdok, input, "MASK"); ///< Name of mask
     124        psString weight = psMetadataLookupStr(&mdok, input, "WEIGHT"); ///< Name of weight map
    111125
    112126        // Add the image file
    113         psArray *imageFiles = psArrayAlloc(1); // Array of filenames for this FPA
     127        psArray *imageFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
    114128        imageFiles->data[0] = psMemIncrRefCounter(image);
    115129        psMetadataAddArray(config->arguments, PS_LIST_TAIL, "IMAGE.FILENAMES", PS_META_REPLACE,
     
    130144        // Optionally add the mask file
    131145        if (mask && strlen(mask) > 0) {
    132             psArray *maskFiles = psArrayAlloc(1); // Array of filenames for this FPA
     146            psArray *maskFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
    133147            maskFiles->data[0] = psMemIncrRefCounter(mask);
    134148            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "MASK.FILENAMES", PS_META_REPLACE,
     
    153167        if (weight && strlen(weight) > 0) {
    154168            haveWeights = true;
    155             psArray *weightFiles = psArrayAlloc(1); // Array of filenames for this FPA
     169            psArray *weightFiles = psArrayAlloc(1); ///< Array of filenames for this FPA
    156170            weightFiles->data[0] = psMemIncrRefCounter(weight);
    157171            psMetadataAddArray(config->arguments, PS_LIST_TAIL, "WEIGHT.FILENAMES", PS_META_REPLACE,
     
    219233}
    220234
    221     psMetadata *format = NULL;          // Camera format
    222     pmFPAview *phuView = NULL;          // View to PHU
     235    psMetadata *format = NULL;          ///< Camera format
     236    pmFPAview *phuView = NULL;          ///< View to PHU
    223237    for (int i = 0; i < numFiles; i++) {
    224         pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // File of interest
    225         pmFPA *fpa = input->fpa;        // FPA of interest
     238        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< File of interest
     239        pmFPA *fpa = input->fpa;        ///< FPA of interest
    226240        CHECK_LEVEL(fpa->hdu, -1, -1);
    227         psArray *chips = fpa->chips;    // Array of chips
     241        psArray *chips = fpa->chips;    ///< Array of chips
    228242        for (int j = 0; j < chips->n; j++) {
    229             pmChip *chip = chips->data[j]; // Chip of interest
     243            pmChip *chip = chips->data[j]; ///< Chip of interest
    230244            CHECK_LEVEL(chip->hdu, j, -1);
    231             psArray *cells = chip->cells;   // Array of cells
     245            psArray *cells = chip->cells;   ///< Array of cells
    232246            for (int k = 0; k < cells->n; k++) {
    233                 pmCell *cell = cells->data[k]; // Cell of interest
     247                pmCell *cell = cells->data[k]; ///< Cell of interest
    234248                CHECK_LEVEL(cell->hdu, j, k);
    235249            }
     
    245259    // Otherwise the abundance of metadata in the concepts (esp. for GPC) can overload the memory
    246260    for (int i = 0; i < numFiles; i++) {
    247         pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // File of interest
    248         pmFPA *fpa = input->fpa;        // FPA of interest
    249         psArray *chips = fpa->chips; // Array of chips in output
     261        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< File of interest
     262        pmFPA *fpa = input->fpa;        ///< FPA of interest
     263        psArray *chips = fpa->chips; ///< Array of chips in output
    250264        for (int i = 0; i < chips->n; i++) {
    251             pmChip *chip = chips->data[i]; // Chip of interest
    252             psArray *cells = chip->cells; // Array of cells
    253             int culled = 0;             // Number of culled cells
     265            pmChip *chip = chips->data[i]; ///< Chip of interest
     266            psArray *cells = chip->cells; ///< Array of cells
     267            int culled = 0;             ///< Number of culled cells
    254268            for (int j = 0; j < cells->n; j++) {
    255269                pmCell *cell = cells->data[j];
    256                 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU for cell
     270                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); ///< HDU for cell
    257271                if (!hdu || hdu->blankPHU) {
    258272                    cell->data_exists = false;
     
    278292    // Count the cells
    279293    {
    280         int numCells = 0;               // Number of cells
    281         pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", 0); // Representative file
    282         pmFPA *fpa = input->fpa;        // FPA for file
    283         psArray *chips = fpa->chips; // Array of chips
     294        int numCells = 0;               ///< Number of cells
     295        pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", 0); ///< Representative file
     296        pmFPA *fpa = input->fpa;        ///< FPA for file
     297        psArray *chips = fpa->chips; ///< Array of chips
    284298        for (int i = 0; i < chips->n; i++) {
    285             pmChip *chip = chips->data[i]; // Chip of interest
    286             psArray *cells = chip->cells; // Array of cells
     299            pmChip *chip = chips->data[i]; ///< Chip of interest
     300            psArray *cells = chip->cells; ///< Array of cells
    287301            for (int j = 0; j < cells->n; j++) {
    288                 pmCell *cell = cells->data[j]; // Cell of interest
    289                 pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); // HDU that would have data
     302                pmCell *cell = cells->data[j]; ///< Cell of interest
     303                pmHDU *hdu = pmHDUGetLowest(fpa, chip, cell); ///< HDU that would have data
    290304                if (hdu && !hdu->blankPHU) {
    291305                    numCells++;
     
    298312    }
    299313
    300     psString outName = ppMergeOutputFile(config); // Name of output file
    301 
    302     pmFPAfileType fileType = PM_FPA_FILE_NONE; // Type of output file
     314    psString outName = ppMergeOutputFile(config); ///< Name of output file
     315
     316    pmFPAfileType fileType = PM_FPA_FILE_NONE; ///< Type of output file
    303317    switch (type) {
    304318      case PPMERGE_TYPE_BIAS:
  • branches/eam_branch_20081230/ppMerge/src/ppMergeErrorCodes.c.in

    r11259 r21238  
     1/** @file ppMergeErrorCodes.c.in
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.1.54.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
     13#include "pslib.h"
     14#include "ppMergeErrorCodes.h"
     15
    116/*
    217 * The line
     
    520 * will be replaced by values from errorCodes.dat
    621 */
    7 #include "pslib.h"
    8 #include "ppMergeErrorCodes.h"
    9 
    1022void ppMergeErrorRegister(void)
    1123{
     
    1426       { PPMERGE_ERR_${ErrorCode}, "${ErrorDescription}"},
    1527    };
    16     static int nerror = PPMERGE_ERR_NERROR - PPMERGE_ERR_BASE; // number of values in enum
     28    static int nerror = PPMERGE_ERR_NERROR - PPMERGE_ERR_BASE; ///< number of values in enum
    1729
    1830    for (int i = 0; i < nerror; i++) {
     
    2133       *tmp = errors[i];
    2234       psErrorRegister(tmp, 1);
    23        psFree(tmp);                     /* it's on the internal list */
     35       psFree(tmp);                     // it's on the internal list
    2436    }
    2537    nerror = 0;                                 // don't register more than once
  • branches/eam_branch_20081230/ppMerge/src/ppMergeErrorCodes.h.in

    r11260 r21238  
     1/** @file ppMergeErrorCodes.h.in
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.1.54.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#if !defined(PPMERGE_ERROR_CODES_H)
    214#define PPMERGE_ERROR_CODES_H
  • branches/eam_branch_20081230/ppMerge/src/ppMergeFileGroup.c

    r21072 r21238  
     1/** @file ppMergeFileGroup.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.2.18.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113# include "ppMerge.h"
    214
  • branches/eam_branch_20081230/ppMerge/src/ppMergeFiles.c

    r21072 r21238  
     1/** @file ppMergeFiles.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.6.6.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    315const char *allFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
    416                           "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
    5                            NULL };      // All files
     17                           NULL };      ///< All files
    618const char *inputFiles[] = { "PPMERGE.INPUT", "PPMERGE.INPUT.MASK", "PPMERGE.INPUT.WEIGHT",
    7                              NULL };    // Input files
     19                             NULL };    ///< Input files
    820const char *outputFiles[] = { "PPMERGE.OUTPUT", "PPMERGE.OUTPUT.COUNT", "PPMERGE.OUTPUT.SIGMA",
    9                               NULL };   // Output files
    10 
    11 // Select file list based on enum
     21                              NULL };   ///< Output files
     22
     23/**
     24 * Select file list based on enum
     25 */
    1226static const char **selectFiles(ppMergeFiles files)
    1327{
  • branches/eam_branch_20081230/ppMerge/src/ppMergeLoop.c

    r21087 r21238  
     1/** @file ppMergeLoop.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.11.24.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
     
    517    assert(config);
    618
    7     psMetadata *arguments = config->arguments; // Arguments
    8     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
    9     int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); // Number of input files
    10     bool mdok;                          // Status of MD lookup
    11     bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
    12     bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
    13 
    14     psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
    15     psArray *masks = NULL, *weights = NULL; // Input masks and weights
     19    psMetadata *arguments = config->arguments; ///< Arguments
     20    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
     21    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); ///< Number of input files
     22    bool mdok;                          ///< Status of MD lookup
     23    bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); ///< Do we have masks?
     24    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
     25
     26    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
     27    psArray *masks = NULL, *weights = NULL; ///< Input masks and weights
    1628    if (haveMasks) {
    1729        masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
     
    2133    }
    2234
    23     // General combination parameters
    24     int rows = psMetadataLookupS32(NULL, arguments, "ROWS"); // Number of rows to read per chunk
    25     int iter = psMetadataLookupS32(NULL, arguments, "ITER"); // Number of rejection iterations
    26     float rej = psMetadataLookupF32(NULL, arguments, "REJ"); // Rejection level
    27     float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); // Reject fraction of low pixels
    28     float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); // Reject fraction of hi pixels
    29     int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
    30     psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
    31     bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
    32 
    33     // Fringe parameters
    34     int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); // Number of fringe points
    35     int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); // Size of fringe regions
    36     int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
    37     int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
     35    /** General combination parameters */
     36    int rows = psMetadataLookupS32(NULL, arguments, "ROWS"); ///< Number of rows to read per chunk
     37    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); ///< Number of rejection iterations
     38    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); ///< Rejection level
     39    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); ///< Reject fraction of low pixels
     40    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); ///< Reject fraction of hi pixels
     41    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); ///< Minimum number of values to keep
     42    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); ///< Combination statistic
     43    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); ///< Use weights?
     44
     45    /** Fringe parameters */
     46    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); ///* Number of fringe points
     47    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); ///* Size of fringe regions
     48    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); ///< Smoothing regions in x
     49    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); ///< Smoothing regions in y
    3850
    3951    // set the mask and mark bit values based on the named masks
     
    4557    }
    4658
    47     pmCombineParams *combination = pmCombineParamsAlloc(combineStat); // Combination parameters
     59    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); ///< Combination parameters
    4860    combination->maskVal = maskVal;
    4961    combination->blank = pmConfigMaskGet("BLANK", config);
     
    5567    combination->weights = useWeights;
    5668
    57     psMetadata *stats = NULL;           // Statistics for output
     69    psMetadata *stats = NULL;           ///< Statistics for output
    5870    if (psMetadataLookup(config->arguments, "STATS.NAME")) {
    5971        stats = psMetadataAlloc();
     
    6173    }
    6274
    63     pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
     75    pmFPAview *view = pmFPAviewAlloc(0); ///< View to component of interest
    6476
    6577    // Retrieve data placed on analysis
    66     psVector *scales = NULL, *zeros = NULL; // Scale and zeroes for combination
    67     psArray *shutters = NULL;           // Shutter correction data
     78    psVector *scales = NULL, *zeros = NULL; ///< Scale and zeroes for combination
     79    psArray *shutters = NULL;           ///< Shutter correction data
    6880    switch (type) {
    6981      case PPMERGE_TYPE_FRINGE:
     
    97109
    98110    // Dark parameters
    99     psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); // Dark info
    100     psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); // Dark normalisation
     111    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); ///< Dark info
     112    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); ///< Dark normalisation
    101113
    102114
     
    105117        goto ERROR;
    106118    }
    107     psString outName = ppMergeOutputFile(config); // Name of output file
    108     pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
     119    psString outName = ppMergeOutputFile(config); ///< Name of output file
     120    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
    109121    psFree(outName);
    110122    assert(output && output->fpa);
    111     pmFPA *outFPA = output->fpa;        // Output FPA
    112     int cellNum = 0;                    // Index of cell
     123    pmFPA *outFPA = output->fpa;        ///< Output FPA
     124    int cellNum = 0;                    ///< Index of cell
    113125    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    114126        goto ERROR;
    115127    }
    116     pmChip *outChip;                    // Chip of interest
     128    pmChip *outChip;                    ///< Chip of interest
    117129    while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
    118130        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    119131            goto ERROR;
    120132        }
    121         pmCell *outCell;                // Cell of interest
     133        pmCell *outCell;                ///< Cell of interest
    122134        while ((outCell = pmFPAviewNextCell(view, outFPA, 1))) {
    123135            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     
    125137            }
    126138
    127             pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); // HDU for cell
     139            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); ///< HDU for cell
    128140            if (!hdu || hdu->blankPHU) {
    129141                // No data here
     
    133145            pmReadout *outRO = pmReadoutAlloc(outCell);
    134146
    135             psArray *readouts = psArrayAlloc(numFiles); // Input readouts
     147            psArray *readouts = psArrayAlloc(numFiles); ///< Input readouts
    136148            for (int i = 0; i < numFiles; i++) {
    137149                // We need to do some of the opening ourselves
     
    142154
    143155                pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i);
    144                 pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
     156                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
    145157                readouts->data[i] = pmReadoutAlloc(inCell);
    146158            }
    147159
    148             float shutterRef = NAN;     // Reference shutter correction
     160            float shutterRef = NAN;     ///< Reference shutter correction
    149161            if (type == PPMERGE_TYPE_SHUTTER) {
    150162                shutterRef = pmShutterCorrectionReference(shutters->data[cellNum]);
     
    156168                psTrace("ppStack", 2, "Initial stack of chunk %d....\n", numChunk);
    157169                for (int i = 0; i < numFiles; i++) {
    158                     pmReadout *inRO = readouts->data[i]; // Input readout
     170                    pmReadout *inRO = readouts->data[i]; ///< Input readout
    159171
    160172                    // Read a chunk from a file
     
    229241
    230242            // Get list of cells for concepts averaging
    231             psList *inCells = psListAlloc(NULL); // List of cells
     243            psList *inCells = psListAlloc(NULL); ///< List of cells
    232244            for (int i = 0; i < numFiles; i++) {
    233                 pmReadout *readout = readouts->data[i]; // Readout of interest
     245                pmReadout *readout = readouts->data[i]; ///< Readout of interest
    234246                psListAdd(inCells, PS_LIST_TAIL, readout->parent);
    235247            }
     
    247259            {
    248260                pmCell *countsCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.COUNT");
    249                 pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
     261                pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
    250262                psImage *counts = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_COUNT);
    251263                countsRO->image = psImageCopy(countsRO->image, counts, PS_TYPE_F32);
     
    254266                psFree(countsRO);
    255267
     268                // XXX EAM 2009.01.18 : sigmaCell and countsCell need to have their concepts copied from outCell.
     269                // This was causing segfaults for VYSOS5; Why did this ever work for SIMTEST?
     270                if (!pmConceptsCopyCell(countsCell, outCell)) {
     271                    psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     272                    psFree(outRO);
     273                    goto ERROR;
     274                }
     275
    256276                pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
    257                 pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
     277                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
    258278                psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
    259279                sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
     
    261281                sigmaRO->data_exists = sigmaCell->data_exists = sigmaCell->parent->data_exists = true;
    262282                psFree(sigmaRO);
     283
     284                if (!pmConceptsCopyCell(sigmaCell, outCell)) {
     285                    psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     286                    psFree(outRO);
     287                    goto ERROR;
     288                }
    263289            }
    264290
     
    283309                }
    284310
    285                 psArray *fringes = psArrayAlloc(1); // Array of fringes
     311                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
    286312                fringes->data[0] = fringe;
    287313
     
    322348
    323349    // Get list of FPAs for concepts averaging
    324     psList *inFPAs = psListAlloc(NULL); // List of FPAs
     350    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
    325351    for (int i = 0; i < numFiles; i++) {
    326         pmFPAfile *input = inputs->data[i]; // Input file
     352        pmFPAfile *input = inputs->data[i]; ///< Input file
    327353        psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
    328354    }
  • branches/eam_branch_20081230/ppMerge/src/ppMergeLoop_Threaded.c

    r21087 r21238  
     1/** @file ppMergeLoop_Threaded.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.5.18.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#ifdef HAVE_CONFIG_H
    214#include <config.h>
     
    1931    assert(config);
    2032
    21     psMetadata *arguments = config->arguments; // Arguments
    22     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
    23     int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); // Number of input files
    24     bool mdok;                          // Status of MD lookup
     33    psMetadata *arguments = config->arguments; ///< Arguments
     34    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
     35    int numFiles = psMetadataLookupS32(NULL, arguments, "INPUTS.NUM"); ///< Number of input files
     36    bool mdok;                          ///< Status of MD lookup
    2537    bool haveMasks = psMetadataLookupBool(&mdok, arguments, "INPUTS.MASKS"); // Do we have masks?
    26     bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); // Do we have weights?
    27 
    28     psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
    29     psArray *masks = NULL, *weights = NULL; // Input masks and weights
     38    bool haveWeights = psMetadataLookupBool(&mdok, arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
     39
     40    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
     41    psArray *masks = NULL, *weights = NULL; ///< Input masks and weights
    3042    if (haveMasks) {
    3143        masks = ppMergeFileDataLevel(config, "PPMERGE.INPUT.MASK", PM_FPA_LEVEL_READOUT);
     
    3850    if (!mdok) nThreads = 0;
    3951
    40     // General combination parameters
    41     int iter = psMetadataLookupS32(NULL, arguments, "ITER"); // Number of rejection iterations
    42     float rej = psMetadataLookupF32(NULL, arguments, "REJ"); // Rejection level
    43     float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); // Reject fraction of low pixels
    44     float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); // Reject fraction of hi pixels
    45     int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); // Minimum number of values to keep
    46     psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); // Combination statistic
    47     bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); // Use weights?
    48 
    49     // Fringe parameters
    50     int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); // Number of fringe points
    51     int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); // Size of fringe regions
    52     int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
    53     int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
     52    /** General combination parameters */
     53    int iter = psMetadataLookupS32(NULL, arguments, "ITER"); ///< Number of rejection iterations
     54    float rej = psMetadataLookupF32(NULL, arguments, "REJ"); ///< Rejection level
     55    float fraclow = psMetadataLookupF32(NULL, arguments, "FRACLOW"); ///< Reject fraction of low pixels
     56    float frachigh = psMetadataLookupF32(NULL, arguments, "FRACHIGH"); ///< Reject fraction of hi pixels
     57    int nKeep = psMetadataLookupS32(NULL, arguments, "NKEEP"); ///< Minimum number of values to keep
     58    psStatsOptions combineStat = psMetadataLookupS32(NULL, arguments, "COMBINE"); ///< Combination statistic
     59    bool useWeights = psMetadataLookupBool(NULL, arguments, "WEIGHTS"); ///< Use weights?
     60
     61    /** Fringe parameters */
     62    int fringeNum = psMetadataLookupS32(NULL, arguments, "FRINGE.NUM"); ///< Number of fringe points
     63    int fringeSize = psMetadataLookupS32(NULL, arguments, "FRINGE.SIZE"); ///< Size of fringe regions
     64    int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); ///< Smoothing regions in x
     65    int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); ///< Smoothing regions in y
    5466
    5567    // set the mask and mark bit values based on the named masks
     
    6173    }
    6274
    63     pmCombineParams *combination = pmCombineParamsAlloc(combineStat); // Combination parameters
     75    pmCombineParams *combination = pmCombineParamsAlloc(combineStat); ///< Combination parameters
    6476    combination->maskVal = maskVal;
    6577    combination->blank = pmConfigMaskGet("BLANK", config);
     
    7183    combination->weights = useWeights;
    7284
    73     psMetadata *stats = NULL;           // Statistics for output
     85    psMetadata *stats = NULL;           ///< Statistics for output
    7486    if (psMetadataLookup(config->arguments, "STATS.NAME")) {
    7587        stats = psMetadataAlloc();
     
    8092
    8193    // Retrieve data placed on analysis
    82     psVector *scales = NULL, *zeros = NULL; // Scale and zeroes for combination
    83     psArray *shutters = NULL;           // Shutter correction data
     94    psVector *scales = NULL, *zeros = NULL; ///< Scale and zeroes for combination
     95    psArray *shutters = NULL;           ///< Shutter correction data
    8496    switch (type) {
    8597      case PPMERGE_TYPE_FRINGE:
     
    113125
    114126    // Dark parameters
    115     psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); // Dark info
    116     psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); // Dark normalisation
     127    psArray *darkOrdinates = psMetadataLookupPtr(NULL, arguments, "DARK.ORDINATES"); ///< Dark info
     128    psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); ///< Dark normalisation
    117129
    118130
     
    121133        goto ERROR;
    122134    }
    123     psString outName = ppMergeOutputFile(config); // Name of output file
    124     pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
     135    psString outName = ppMergeOutputFile(config); ///< Name of output file
     136    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
    125137    psFree(outName);
    126138    assert(output && output->fpa);
    127     pmFPA *outFPA = output->fpa;        // Output FPA
    128     int cellNum = 0;                    // Index of cell
     139    pmFPA *outFPA = output->fpa;        ///< Output FPA
     140    int cellNum = 0;                    ///< Index of cell
    129141    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    130142        goto ERROR;
    131143    }
    132     pmChip *outChip;                    // Chip of interest
     144    pmChip *outChip;                    ///< Chip of interest
    133145    while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
    134146        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    135147            goto ERROR;
    136148        }
    137         pmCell *outCell;                // Cell of interest
     149        pmCell *outCell;                ///< Cell of interest
    138150        while ((outCell = pmFPAviewNextCell(view, outFPA, 1))) {
    139151            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     
    141153            }
    142154
    143             pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); // HDU for cell
     155            pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); ///< HDU for cell
    144156            if (!hdu || hdu->blankPHU) {
    145157                // No data here
     
    147159            }
    148160
    149             float shutterRef = NAN;     // Reference shutter correction
     161            float shutterRef = NAN;     ///< Reference shutter correction
    150162            pmReadout *pattern = NULL;
    151163            if (type == PPMERGE_TYPE_SHUTTER) {
     
    169181            // Generate readouts for each input file in each file group
    170182            for (int i = 0; i < fileGroups->n; i++) {
    171                 psArray *readouts = psArrayAlloc(numFiles); // Input readouts
     183                psArray *readouts = psArrayAlloc(numFiles); ///< Input readouts
    172184                for (int j = 0; j < numFiles; j++) {
    173185                    pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", j);
    174                     pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
     186                    pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
    175187                    readouts->data[j] = pmReadoutAlloc(inCell);
    176188                }
     
    234246                  case PPMERGE_TYPE_FLAT:
    235247                  case PPMERGE_TYPE_FRINGE: {
    236                       psThreadJob *job = psThreadJobAlloc("PPMERGE_READOUT_COMBINE"); // Job to start
     248                      psThreadJob *job = psThreadJobAlloc("PPMERGE_READOUT_COMBINE"); ///< Job to start
    237249
    238250                      // Construct the arguments for this job
     
    250262                  }
    251263                  case PPMERGE_TYPE_DARK: {
    252                       psThreadJob *job = psThreadJobAlloc ("PPMERGE_DARK_COMBINE"); // Job to start
     264                      psThreadJob *job = psThreadJobAlloc ("PPMERGE_DARK_COMBINE"); ///< Job to start
    253265
    254266                      // construct the arguments for this job
     
    311323            for (int i = 0; i < numFiles; i++) {
    312324                pmFPAfile *input = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i);
    313                 pmCell *inCell = pmFPAviewThisCell(view, input->fpa); // Input cell
     325                pmCell *inCell = pmFPAviewThisCell(view, input->fpa); ///< Input cell
    314326                psListAdd(inCells, PS_LIST_TAIL, inCell);
    315327            }
     
    325337            {
    326338                pmCell *countsCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.COUNT");
    327                 pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
     339                pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
    328340                psImage *counts = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_COUNT);
    329341                countsRO->image = psImageCopy(countsRO->image, counts, PS_TYPE_F32);
     
    332344                psFree(countsRO);
    333345
     346                // XXX EAM 2009.01.18 : sigmaCell and countsCell need to have their concepts copied from outCell.
     347                // This was causing segfaults for VYSOS5; Why did this ever work for SIMTEST?
     348                if (!pmConceptsCopyCell(countsCell, outCell)) {
     349                    psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     350                    psFree(outRO);
     351                    goto ERROR;
     352                }
     353
    334354                pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
    335                 pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
     355                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
    336356                psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
    337357                sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
     
    339359                sigmaRO->data_exists = sigmaCell->data_exists = sigmaCell->parent->data_exists = true;
    340360                psFree(sigmaRO);
     361
     362                if (!pmConceptsCopyCell(sigmaCell, outCell)) {
     363                    psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     364                    psFree(outRO);
     365                    goto ERROR;
     366                }
    341367            }
    342368
     
    361387                }
    362388
    363                 psArray *fringes = psArrayAlloc(1); // Array of fringes
     389                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
    364390                fringes->data[0] = fringe;
    365391
     
    400426
    401427    // Get list of FPAs for concepts averaging
    402     psList *inFPAs = psListAlloc(NULL); // List of FPAs
     428    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
    403429    for (int i = 0; i < numFiles; i++) {
    404         pmFPAfile *input = inputs->data[i]; // Input file
     430        pmFPAfile *input = inputs->data[i]; ///< Input file
    405431        psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
    406432    }
  • branches/eam_branch_20081230/ppMerge/src/ppMergeMask.c

    r21087 r21238  
     1/** @file ppMergeMask.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.15.24.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    3 static bool mergeMask(pmConfig *config, // Configuration
    4                       const pmFPAview *view, // View to chip
    5                       bool writeOut,     // Write output?
    6                       psRandom *rng,    // Random number generator
    7                       psMetadata *stats // Statistics output
     15static bool mergeMask(pmConfig *config, ///< Configuration
     16                      const pmFPAview *view, ///< View to chip
     17                      bool writeOut,     ///< Write output?
     18                      psRandom *rng,    ///< Random number generator
     19                      psMetadata *stats ///< Statistics output
    820    )
    921{
     
    1224    assert(view->chip != -1 && view->cell == -1 && view->readout == -1);
    1325
    14     bool mdok;                          // Status of MD lookup
    15     int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of input files
    16     psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); // Statistic for mean
    17     psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); // Statistic for stdev
    18     int sample = psMetadataLookupS32(NULL, config->arguments, "SAMPLE"); // Size of sample for statistics
    19     bool chipStats = psMetadataLookupBool(&mdok, config->arguments, "MASK.CHIPSTATS"); // Statistics on chip?
    20     float maskSuspect = psMetadataLookupF32(NULL, config->arguments, "MASK.SUSPECT"); // Threshold for suspect pixels
    21     float maskBad = psMetadataLookupF32(NULL, config->arguments, "MASK.BAD"); // Threshold for bad pixels
    22     pmMaskIdentifyMode maskMode = psMetadataLookupS32(NULL, config->arguments, "MASK.MODE"); // Mode for identifying bad pixels
    23     int maskGrow = psMetadataLookupS32(NULL, config->arguments, "MASK.GROW"); // Radius to grow mask
    24 
    25     bool smoothSuspect = psMetadataLookupBool(&mdok, config->arguments, "MASK.SMOOTH.SUSPECT"); // Radius to grow mask
    26     float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); // Radius to grow mask
     26    bool mdok;                          ///< Status of MD lookup
     27    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of input files
     28    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); ///< Statistic for mean
     29    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); ///< Statistic for stdev
     30    int sample = psMetadataLookupS32(NULL, config->arguments, "SAMPLE"); ///< Size of sample for statistics
     31    bool chipStats = psMetadataLookupBool(&mdok, config->arguments, "MASK.CHIPSTATS"); ///< Statistics on chip?
     32    float maskSuspect = psMetadataLookupF32(NULL, config->arguments, "MASK.SUSPECT"); ///< Threshold for suspect pixels
     33    float maskBad = psMetadataLookupF32(NULL, config->arguments, "MASK.BAD"); ///< Threshold for bad pixels
     34    pmMaskIdentifyMode maskMode = psMetadataLookupS32(NULL, config->arguments, "MASK.MODE"); ///< Mode for identifying bad pixels
     35    int maskGrow = psMetadataLookupS32(NULL, config->arguments, "MASK.GROW"); ///< Radius to grow mask
     36
     37    bool smoothSuspect = psMetadataLookupBool(&mdok, config->arguments, "MASK.SMOOTH.SUSPECT"); ///< Radius to grow mask
     38    float smoothScale = psMetadataLookupF32(&mdok, config->arguments, "MASK.SMOOTH.SCALE"); ///< Radius to grow mask
    2739
    2840    psImageMaskType markVal;
     
    4052    }
    4153   
    42     psStats *statistics = psStatsAlloc(meanStat | stdevStat); // Statistics for background
    43 
    44     psString outName = ppMergeOutputFile(config); // Name of output file
    45     pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); // Output chip
     54    psStats *statistics = psStatsAlloc(meanStat | stdevStat); ///< Statistics for background
     55
     56    psString outName = ppMergeOutputFile(config); ///< Name of output file
     57    pmChip *outChip = pmFPAfileThisChip(config->files, view, outName); ///< Output chip
    4658    psFree(outName);
    4759   
     
    5870
    5971    // For each input file, get the statistics, which can be calculated at the chip or cell levels
    60     psVector *values = psVectorAlloc(sample, PS_TYPE_F32); // Pixel values for statistics
    61     pmFPAview *inView = pmFPAviewAlloc(0); // View for input
     72    psVector *values = psVectorAlloc(sample, PS_TYPE_F32); ///< Pixel values for statistics
     73    pmFPAview *inView = pmFPAviewAlloc(0); ///< View for input
    6274    for (int i = 0; i < numFiles; i++) {
    6375        pmFPAfileActivate(config->files, false, NULL);
    64         psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Input files
    65         pmFPAfile *input = files->data[0]; // Input file
     76        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); ///< Input files
     77        pmFPAfile *input = files->data[0]; ///< Input file
    6678        psFree(files);
    67         pmFPA *inFPA = input->fpa;  // Input FPA
     79        pmFPA *inFPA = input->fpa;  ///< Input FPA
    6880        *inView = *view;
    6981
    70         int valueIndex = 0;             // Index for vector of pixel values
    71 
    72         pmCell *inCell;                 // Input cell
     82        int valueIndex = 0;             ///< Index for vector of pixel values
     83
     84        pmCell *inCell;                 ///< Input cell
    7385        while ((inCell = pmFPAviewNextCell(inView, inFPA, 1))) {
    7486
    7587            // the output FPA structure carries the information about which cells to process
    76             pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
     88            pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); ///< Output cell
    7789            if (!outCell->process) continue;
    7890
    79             pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
     91            pmHDU *hdu = pmHDUFromCell(inCell); ///< HDU for cell
    8092            if (!hdu || hdu->blankPHU) {
    8193                // No data here
     
    106118            pmReadout *readout;
    107119            if (inCell->readouts && inCell->readouts->n == 1) {
    108                 readout = psMemIncrRefCounter(inCell->readouts->data[0]); // Input readout
     120                readout = psMemIncrRefCounter(inCell->readouts->data[0]); ///< Input readout
    109121            } else {
    110122                readout = pmReadoutAlloc(inCell);
     
    118130            }
    119131
    120             pmReadout *outRO = NULL;    // Output readout
     132            pmReadout *outRO = NULL;    ///< Output readout
    121133            if (outCell->readouts && outCell->readouts->n == 1) {
    122134                outRO = psMemIncrRefCounter(outCell->readouts->data[0]);
     
    124136                outRO = pmReadoutAlloc(outCell);
    125137            }
    126             psImage *outMask = outRO->mask;    // Output mask image (for iterative generation of mask)
    127 
    128             psImage *image = readout->image, *mask = readout->mask; // Image and mask
    129             int numCols = readout->image->numCols, numRows = readout->image->numRows; // Image size
    130             int numPix = numCols * numRows; // Number of pixels
    131             int num = PS_MIN(numPix, sample / numCells); // Number of values to add
     138            psImage *outMask = outRO->mask;    ///< Output mask image (for iterative generation of mask)
     139
     140            psImage *image = readout->image, *mask = readout->mask; ///< Image and mask
     141            int numCols = readout->image->numCols, numRows = readout->image->numRows; ///< Image size
     142            int numPix = numCols * numRows; ///< Number of pixels
     143            int num = PS_MIN(numPix, sample / numCells); ///< Number of values to add
    132144            if (!chipStats) {
    133145                valueIndex = 0;
     
    187199
    188200                // the output FPA structure carries the information about which cells to process
    189                 pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); // Output cell
     201                pmCell *outCell = pmFPAfileThisCell(config->files, inView, "PPMERGE.OUTPUT.MASK"); ///< Output cell
    190202                if (!outCell->process) continue;
    191203
    192                 pmHDU *hdu = pmHDUFromCell(inCell); // HDU for cell
     204                pmHDU *hdu = pmHDUFromCell(inCell); ///< HDU for cell
    193205                if (!hdu || hdu->blankPHU) continue;
    194206
    195                 pmReadout *readout = inCell->readouts->data[0]; // Readout of interest
     207                pmReadout *readout = inCell->readouts->data[0]; ///< Readout of interest
    196208
    197209                inView->readout = 0;
     
    225237        ppMergeFileActivate(config, PPMERGE_FILES_OUTPUT, true);
    226238    }
    227     pmFPA *outFPA = outChip->parent;    // Output FPA
    228     pmCell *outCell;                    // Output cell
    229     pmFPAview *outView = pmFPAviewAlloc(0); // View into output FPA
     239    pmFPA *outFPA = outChip->parent;    ///< Output FPA
     240    pmCell *outCell;                    ///< Output cell
     241    pmFPAview *outView = pmFPAviewAlloc(0); ///< View into output FPA
    230242    *outView = *view;
    231243    while ((outCell = pmFPAviewNextCell(outView, outFPA, 1))) {
     
    234246        if (!outCell->process) continue;
    235247
    236         pmHDU *hdu = pmHDUFromCell(outCell); // HDU for cell
     248        pmHDU *hdu = pmHDUFromCell(outCell); ///< HDU for cell
    237249        if (!hdu || hdu->blankPHU) continue;
    238250
     
    240252
    241253        assert(outCell->readouts && outCell->readouts->n == 1);
    242         pmReadout *outRO = outCell->readouts->data[0]; // Output readout
     254        pmReadout *outRO = outCell->readouts->data[0]; ///< Output readout
    243255
    244256        if (smoothSuspect) {
    245257            // XXX test output of suspect pixel image
    246             psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); // Suspect img
     258            psImage *suspects = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT); ///< Suspect img
    247259            assert (suspects);
    248             psImageSmooth (suspects, smoothScale, 3); // extend smoothing region to 3-sigma
     260            psImageSmooth (suspects, smoothScale, 3); ///< extend smoothing region to 3-sigma
    249261        }
    250262
     
    259271            // The counts image is fairly useless, but it preserves the model
    260272            pmCell *countsCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.COUNT");
    261             pmReadout *countsRO = pmReadoutAlloc(countsCell); // Readout with count of inputs per pixel
     273            pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
    262274            countsRO->image = psImageAlloc(outRO->mask->numCols, outRO->mask->numRows, PS_TYPE_F32);
    263275            psImageInit(countsRO->image, numFiles);
     
    266278
    267279            pmCell *sigmaCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.SIGMA");
    268             pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with suspect image
     280            pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with suspect image
    269281            psImage *suspect = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT);
    270282            sigmaRO->image = psImageCopy(sigmaRO->image, suspect, PS_TYPE_F32);
     
    275287
    276288        if (maskGrow > 0) {
    277             psImage *grown = psImageGrowMask(NULL, outRO->mask, maskValOut, maskGrow, maskValOut); // Grown mask
     289            psImage *grown = psImageGrowMask(NULL, outRO->mask, maskValOut, maskGrow, maskValOut); ///< Grown mask
    278290            psFree(outRO->mask);
    279291            outRO->mask = grown;
     
    289301
    290302            // Average concepts
    291             psList *cells = psListAlloc(NULL); // List of cells, for concept averaging
     303            psList *cells = psListAlloc(NULL); ///< List of cells, for concept averaging
    292304            for (int i = 0; i < numFiles; i++) {
    293                 pmFPAfile *inFile = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
    294                 pmCell *inCell = pmFPAviewThisCell(outView, inFile->fpa); // Input cell
     305                pmFPAfile *inFile = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
     306                pmCell *inCell = pmFPAviewThisCell(outView, inFile->fpa); ///< Input cell
    295307                psListAdd(cells, PS_LIST_TAIL, inCell);
    296308            }
     
    340352    assert(config);
    341353
    342     bool mdok;                          // Status of MD lookup
    343     int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    344     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    345     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); // Do we have weights?
    346     int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Number of rejection iterations
     354    bool mdok;                          ///< Status of MD lookup
     355    int numFiles = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of inputs
     356    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); ///< Do we have masks?
     357    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS"); ///< Do we have weights?
     358    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); ///< Number of rejection iterations
    347359
    348360    PS_ASSERT_INT_POSITIVE(iter, false);
    349361
    350     pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
    351     psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator
    352 
    353     psMetadata *stats = NULL;           // Statistics for output
     362    pmFPAview *view = pmFPAviewAlloc(0); ///< View to component of interest
     363    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); ///< Random number generator
     364
     365    psMetadata *stats = NULL;           ///< Statistics for output
    354366    if (psMetadataLookup(config->arguments, "STATS.NAME")) {
    355367        stats = psMetadataAlloc();
     
    357369    }
    358370
    359     psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); // Input images
     371    psArray *inputs = ppMergeFileDataLevel(config, "PPMERGE.INPUT", PM_FPA_LEVEL_READOUT); ///< Input images
    360372    psFree(inputs);
    361373    if (haveMasks) {
     
    380392    // for the input masks.
    381393
    382     psString outName = ppMergeOutputFile(config); // Name of output file
    383     pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); // Output file
     394    psString outName = ppMergeOutputFile(config); ///< Name of output file
     395    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, outName); ///< Output file
    384396    psFree(outName);
    385397    assert(output && output->fpa);
    386     pmFPA *outFPA = output->fpa;        // Output FPA
     398    pmFPA *outFPA = output->fpa;        ///< Output FPA
    387399
    388400    if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    389401        goto PPMERGE_MASK_ERROR;
    390402    }
    391     pmChip *outChip;                    // Chip of interest
     403    pmChip *outChip;                    ///< Chip of interest
    392404    while ((outChip = pmFPAviewNextChip(view, outFPA, 1))) {
    393405
     
    408420            psList *inChips = psListAlloc(NULL);
    409421            for (int i=0; i < numFiles; i++) {
    410                 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
     422                pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
    411423                pmChip *chip = pmFPAviewThisChip(view, file->fpa);
    412424                psListAdd(inChips, PS_LIST_TAIL, chip);
     
    427439    }
    428440
    429     psList *fpaList = psListAlloc(NULL);// List of FPAs for concept averaging
     441    psList *fpaList = psListAlloc(NULL);///< List of FPAs for concept averaging
    430442    for (int i = 0; i < numFiles; i++) {
    431         pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); // Input file
     443        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", i); ///< Input file
    432444        psListAdd(fpaList, PS_LIST_TAIL, file->fpa);
    433445    }
  • branches/eam_branch_20081230/ppMerge/src/ppMergeReadChunk.c

    r21072 r21238  
     1/** @file ppMergeReadChunk.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.4.18.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113# include "ppMerge.h"
    214
    3 #define THREAD_WAIT 10000               // Microseconds to wait if thread is not available
     15#define THREAD_WAIT 10000               ///< Microseconds to wait if thread is not available
    416
    517ppMergeFileGroup *ppMergeReadChunk(bool *status, psArray *fileGroups, pmConfig *config, int numChunk)
     
    820
    921    bool mdok;
    10     bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); // Do we have masks?
    11     bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");// Do we have weights?
    12     int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of rows to read per chunk
     22    bool haveMasks = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS"); ///< Do we have masks?
     23    bool haveWeights = psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS");///< Do we have weights?
     24    int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); ///< Number of rows to read per chunk
    1325
    1426    // select an available fileGroup
     
    3648            psTrace("ppStack", 2, "Reading data for chunk %d into fileGroup %d....n", numChunk, j);
    3749            for (int i = 0; i < readouts->n; i++) {
    38                 pmReadout *inRO = readouts->data[i]; // Input readout
     50                pmReadout *inRO = readouts->data[i]; ///< Input readout
    3951
    4052                // override the recorded last scan
  • branches/eam_branch_20081230/ppMerge/src/ppMergeScaleZero.c

    r21087 r21238  
     1/** @file ppMergeScaleZero.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.27.18.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#include "ppMerge.h"
    214
    3 // Get the scale and zero for each chip of each input
     15/**
     16 * Get the scale and zero for each chip of each input
     17 */
    418bool ppMergeScaleZero(pmConfig *config)
    519{
    620    assert(config);
    721
    8     ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of frame
    9     int numInputs = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    10     int numCells = psMetadataLookupS32(NULL, config->arguments, "INPUTS.CELLS"); // Number of cells
    11     psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); // Statistic for mean
    12     psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); // Statistic for stdev
    13     int shutterSize = psMetadataLookupS32(NULL, config->arguments, "SHUTTER.SIZE"); // Size of shutter region
    14 
    15     psVector *gains = NULL;             // Gains for each cell
    16     psArray *shutters = NULL;           // Shutter data for each cell
    17     psStats *stats = NULL;              // Statistics for background
    18     psImage *background = NULL;         // Background measurements per cell per file
     22    ppMergeType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); ///< Type of frame
     23    int numInputs = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); ///< Number of inputs
     24    int numCells = psMetadataLookupS32(NULL, config->arguments, "INPUTS.CELLS"); ///< Number of cells
     25    psStatsOptions meanStat = psMetadataLookupS32(NULL, config->arguments, "MEAN"); ///< Statistic for mean
     26    psStatsOptions stdevStat = psMetadataLookupS32(NULL, config->arguments, "STDEV"); ///< Statistic for stdev
     27    int shutterSize = psMetadataLookupS32(NULL, config->arguments, "SHUTTER.SIZE"); ///< Size of shutter region
     28
     29    psVector *gains = NULL;             ///< Gains for each cell
     30    psArray *shutters = NULL;           ///< Shutter data for each cell
     31    psStats *stats = NULL;              ///< Statistics for background
     32    psImage *background = NULL;         ///< Background measurements per cell per file
    1933
    2034    switch (type) {
     
    3751        break;
    3852    }
    39     psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator
    40     pmFPAview *view = NULL;             // View into FPA
     53    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); ///< Random number generator
     54    pmFPAview *view = NULL;             ///< View into FPA
    4155
    4256    for (int i = 0; i < numInputs; i++) {
    4357        pmFPAfileActivate(config->files, false, NULL);
    44         psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); // Activated files
    45         pmFPAfile *input = files->data[0]; // Representative file; should be the image (not mask or weight)
    46         pmFPA *fpa = input->fpa;        // FPA of interest
    47         view = pmFPAviewAlloc(0);       // View to component of interest
    48         int cellNum = 0;                // Index for cell
     58        psArray *files = ppMergeFileActivateSingle(config, PPMERGE_FILES_INPUT, true, i); ///< Activated files
     59        pmFPAfile *input = files->data[0]; ///< Representative file; should be the image (not mask or weight)
     60        pmFPA *fpa = input->fpa;        ///< FPA of interest
     61        view = pmFPAviewAlloc(0);       ///< View to component of interest
     62        int cellNum = 0;                ///< Index for cell
    4963        if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    5064            goto ERROR;
    5165        }
    52         pmChip *chip;                   // Chip of interest
     66        pmChip *chip;                   ///< Chip of interest
    5367        while ((chip = pmFPAviewNextChip(view, fpa, 1))) {
    5468            if (!chip->file_exists) {
     
    5973            }
    6074
    61             pmCell *cell;               // Cell of interest
     75            pmCell *cell;               ///< Cell of interest
    6276            while ((cell = pmFPAviewNextCell(view, fpa, 1))) {
    6377                if (!cell->file_exists) {
     
    7892                    goto ERROR;
    7993                }
    80                 pmReadout *readout = cell->readouts->data[0]; // Readout of interest
    81 
    82                 psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); // Value to mask
     94                pmReadout *readout = cell->readouts->data[0]; ///< Readout of interest
     95
     96                psImageMaskType maskVal = pmConfigMaskGet("MASK.VALUE", config); ///< Value to mask
    8397
    8498                switch (type) {
     
    86100                  case PPMERGE_TYPE_FRINGE: {
    87101                      // Extract the gain
    88                       float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // Cell gain
     102                      float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); ///< Cell gain
    89103                      if (!isfinite(gain)) {
    90104                        // psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     
    110124                  }
    111125                  case PPMERGE_TYPE_SHUTTER: {
    112                       pmShutterCorrectionData *shutter = shutters->data[cellNum]; // Shutter correction data
     126                      pmShutterCorrectionData *shutter = shutters->data[cellNum]; ///< Shutter correction data
    113127                      if (!shutter) {
    114128                          shutter = pmShutterCorrectionDataAlloc(readout->image->numCols,
     
    174188              }
    175189          }
    176           psVector *fluxes = NULL;        // Solution to fluxes
     190          psVector *fluxes = NULL;        ///< Solution to fluxes
    177191          if (!pmFlatNormalize(&fluxes, &gains, background)) {
    178192              psError(PS_ERR_UNKNOWN, false, "Normalisation failed to converge --- continuing anyway.");
  • branches/eam_branch_20081230/ppMerge/src/ppMergeScaleZero.h

    r13873 r21238  
     1/** @file ppMergeScaleZero.h
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.3.48.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#ifndef PP_MERGE_SCALE_ZERO_H
    214#define PP_MERGE_SCALE_ZERO_H
     
    820#include "ppMergeOptions.h"
    921
    10 // Get the scale and zero for each chip of each input
    11 bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell
    12                       psImage **zeros, // The zeroes for each integration/cell
    13                       psArray **shutter,// The shutter correction data for each cell
    14                       ppMergeData *data,// The data
    15                       const ppMergeOptions *options, // The options
    16                       const pmConfig *config // The configuration
     22/**
     23 * Get the scale and zero for each chip of each input
     24 */
     25bool ppMergeScaleZero(psImage **scales, ///< The scales for each integration/cell
     26                      psImage **zeros, ///< The zeroes for each integration/cell
     27                      psArray **shutter,///< The shutter correction data for each cell
     28                      ppMergeData *data,///< The data
     29                      const ppMergeOptions *options, ///< The options
     30                      const pmConfig *config ///< The configuration
    1731    );
    1832
  • branches/eam_branch_20081230/ppMerge/src/ppMergeSetThreads.c

    r21087 r21238  
     1/** @file ppMergeSetThreads.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.5.16.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113# include "ppMerge.h"
    214
  • branches/eam_branch_20081230/ppMerge/src/ppMergeThreadLauncher.c

    r21087 r21238  
     1/** @file ppMergeThreadLauncher.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.2.20.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113# include "ppMerge.h"
    214
    3 // each thread runs this function, starting a new job when it finished with an old one
    4 // it is called with a (void *) pointer to its own thread pointer
     15/**
     16 * each thread runs this function, starting a new job when it finished with an old one
     17 * it is called with a (void *) pointer to its own thread pointer
     18 */
    519void *ppMergeThreadLauncher (void *data) {
    620
  • branches/eam_branch_20081230/ppMerge/src/ppMergeVersion.c

    r10294 r21238  
     1/** @file ppMergeVersion.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.1.54.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#ifdef HAVE_CONFIG_H
    214#include <config.h>
     
    1022#include "ppMergeVersion.h"
    1123
    12 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
     24static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name
    1325
    1426psString ppMergeVersion(void)
    1527{
    16     psString version = NULL;            // Version, to return
     28    psString version = NULL;            ///< Version, to return
    1729    psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    1830    return version;
     
    2133psString ppMergeVersionLong(void)
    2234{
    23     psString version = ppMergeVersion(); // Version, to return
    24     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
     35    psString version = ppMergeVersion(); ///< Version, to return
     36    psString tag = psStringStripCVS(cvsTag, "Name"); ///< CVS tag
    2537    psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
    2638    psFree(tag);
     
    3345    PS_ASSERT_METADATA_NON_NULL(metadata,);
    3446
    35     psString pslib = psLibVersionLong();// psLib version
    36     psString psmodules = psModulesVersionLong(); // psModules version
    37     psString ppStats = ppStatsVersionLong(); // ppStats version
    38     psString ppMerge = ppMergeVersionLong(); // ppMerge version
     47    psString pslib = psLibVersionLong();///< psLib version
     48    psString psmodules = psModulesVersionLong(); ///< psModules version
     49    psString ppStats = ppStatsVersionLong(); ///< ppStats version
     50    psString ppMerge = ppMergeVersionLong(); ///< ppMerge version
    3951
    40     psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now
    41     psString timeString = psTimeToISO(time); // The time in an ISO string
     52    psTime *time = psTimeGetNow(PS_TIME_TAI); ///< The time now
     53    psString timeString = psTimeToISO(time); ///< The time in an ISO string
    4254    psFree(time);
    43     psString head = NULL;               // Head string
     55    psString head = NULL;               ///< Head string
    4456    psStringAppend(&head, "ppMerge processing at %s. Component information:", timeString);
    4557    psFree(timeString);
  • branches/eam_branch_20081230/ppMerge/src/ppMergeVersion.h

    r10294 r21238  
     1/** @file ppMergeVersion.h
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.1.54.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-30 22:00:00 $
     10 *  Copyright 2009 Institute for Astronomy, University of Hawaii
     11 */
     12
    113#ifndef PP_MERGE_VERSION_H
    214#define PP_MERGE_VERSION_H
    315
    4 /// Return short version information
     16/**
     17 * Return short version information
     18 */
    519psString ppMergeVersion(void);
    620
    7 /// Return long version information
     21/**
     22 * Return long version information
     23 */
    824psString ppMergeVersionLong(void);
    925
    10 /// Update the metadata with version information for all dependencies
     26/**
     27 * Update the metadata with version information for all dependencies
     28 */
    1129void ppMergeVersionMetadata(psMetadata *metadata ///< Metadata to update with version information
    1230    );
Note: See TracChangeset for help on using the changeset viewer.