IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 1, 2009, 11:43:05 AM (17 years ago)
Author:
eugene
Message:

merging Doxygen templates added by Bill G

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeLoop.c

    r21183 r21244  
     1/** @file ppMergeLoop.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-01 21:43:05 $
     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);
     
    263275
    264276                pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
    265                 pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
     277                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
    266278                psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
    267279                sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
     
    297309                }
    298310
    299                 psArray *fringes = psArrayAlloc(1); // Array of fringes
     311                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
    300312                fringes->data[0] = fringe;
    301313
     
    336348
    337349    // Get list of FPAs for concepts averaging
    338     psList *inFPAs = psListAlloc(NULL); // List of FPAs
     350    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
    339351    for (int i = 0; i < numFiles; i++) {
    340         pmFPAfile *input = inputs->data[i]; // Input file
     352        pmFPAfile *input = inputs->data[i]; ///< Input file
    341353        psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
    342354    }
Note: See TracChangeset for help on using the changeset viewer.