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_Threaded.c

    r21183 r21244  
     1/** @file ppMergeLoop_Threaded.c
     2 *
     3 *  @brief
     4 *
     5 *  @ingroup ppMerge
     6 *
     7 *  @author IfA
     8 *  @version $Revision: 1.8 $ $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#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);
     
    341353
    342354                pmCell *sigmaCell = pmFPAfileThisCell(config->files, view, "PPMERGE.OUTPUT.SIGMA");
    343                 pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); // Readout with stdev per pixel
     355                pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with stdev per pixel
    344356                psImage *sigma = psMetadataLookupPtr(NULL, outRO->analysis, PM_READOUT_STACK_ANALYSIS_SIGMA);
    345357                sigmaRO->image = psImageCopy(sigmaRO->image, sigma, PS_TYPE_F32);
     
    375387                }
    376388
    377                 psArray *fringes = psArrayAlloc(1); // Array of fringes
     389                psArray *fringes = psArrayAlloc(1); ///< Array of fringes
    378390                fringes->data[0] = fringe;
    379391
     
    414426
    415427    // Get list of FPAs for concepts averaging
    416     psList *inFPAs = psListAlloc(NULL); // List of FPAs
     428    psList *inFPAs = psListAlloc(NULL); ///< List of FPAs
    417429    for (int i = 0; i < numFiles; i++) {
    418         pmFPAfile *input = inputs->data[i]; // Input file
     430        pmFPAfile *input = inputs->data[i]; ///< Input file
    419431        psListAdd(inFPAs, PS_LIST_TAIL, input->fpa);
    420432    }
Note: See TracChangeset for help on using the changeset viewer.