IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7064


Ignore:
Timestamp:
May 3, 2006, 6:12:17 PM (20 years ago)
Author:
Paul Price
Message:

Fixes for compilation

Location:
trunk/ppMerge/src
Files:
9 edited

Legend:

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

    r7061 r7064  
    44
    55#include "ppMerge.h"
    6 #include "ppMem.h"
     6#include "ppMergeConfig.h"
     7#include "ppMergeData.h"
     8#include "ppMergeOptions.h"
     9#include "ppMergeCheckInputs.h"
     10#include "ppMergeBackground.h"
     11#include "ppMergeCombine.h"
     12
     13//#include "ppMem.h"
    714
    815int main(int argc, char **argv)
    916{
    10     ppMergeOptions *options = ppMergeOptionsAlloc();
    11     ppConfig *config = ppConfigAlloc();
    12 
    1317    psTimerStart(TIMERNAME);
    1418
     
    2529    ppMergeData *data = ppMergeCheckInputs(options, config);
    2630    if (!data) {
    27         psError("Not enough valid input files.\n");
     31        psError(PS_ERR_IO, false, "Not enough valid input files.\n");
    2832        exit(EXIT_FAILURE);
    2933    }
     
    5054    pmConfigDone();
    5155
    52     ppMemCheck();
     56//    ppMemCheck();
    5357
    5458    return EXIT_SUCCESS;
  • trunk/ppMerge/src/ppMerge.h

    r7061 r7064  
    22#define PP_MERGE_H
    33
    4 #include <stdio.h>
    5 #include <pslib.h>
    6 #include <psmodules.h>
     4#define TIMERNAME "ppMerge"
    75
    8 #define RECIPE "PPMERGE"                // Name of the recipe to use
    9 
     6#endif
  • trunk/ppMerge/src/ppMergeBackground.c

    r7061 r7064  
    3434
    3535// Get the scale and zero for each chip of each input
    36 bool ppMergeScaleZero(ppImage **scales, // The scales for each integration/cell
    37                       ppImage **zeros, // The zeroes for each integration/cell
     36bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell
     37                      psImage **zeros, // The zeroes for each integration/cell
    3838                      ppMergeData *data,// The data
    3939                      const ppMergeOptions *options, // The options
     
    7676        psFits *inFile = psFitsOpen(filenames->data[i], "r"); // The FITS file to read
    7777        if (!inFile) {
    78             psErrorPrint(PS_ERR_IO, false, "Unable to open input file %s --- ignored.\n", name);
     78            psLogMsg(__func__, PS_LOG_WARN, "Unable to open input file %s --- ignored.\n", name);
    7979            status = false;
    8080            continue;
    8181        }
    8282
    83         pmFPA *fpa = in->data[i];      // The FPA for this input
     83        pmFPA *fpa = data->in->data[i]; // The FPA for this input
    8484        int cellNum = -1;               // Number of the cell
    8585        psArray *chips = fpa->chips;    // Array of chips
     
    106106                if (options->exptime) {
    107107                    bool mdok = true;   // Status of MD lookup
    108                     exptime->data.F64[i][cellNum] = psMetadataLookup(&mdok, cell->concepts, "CELL.EXPOSURE");
     108                    exptime->data.F64[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,
     109                                                                        "CELL.EXPOSURE");
    109110                    if (!mdok || isnan(exptime->data.F64[i][cellNum])) {
    110111                        psLogMsg(__func__, PS_LOG_WARN, "CELL.EXPOSURE for file %s chip %d cell %d is not "
     
    139140                    if (options->scale) {
    140141                        bool mdok = true;   // Status of MD lookup
    141                         gain->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
    142                         if (!mdok || isnan(gain->data.F32[cellNum])) {
     142                        gains->data.F32[cellNum] = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN");
     143                        if (!mdok || isnan(gains->data.F32[cellNum])) {
    143144                            psLogMsg(__func__, PS_LOG_WARN, "CELL.GAIN for file %s chip %d cell %d is not "
    144145                                     "set.\n", name, j, k);
    145                             gain->data.F32[cellNum] = NAN;
     146                            gains->data.F32[cellNum] = NAN;
    146147                            status = false;
    147148                        }
     
    150151                    // Get the background
    151152                    psImageStats(bgStats, image, readout->mask, options->maskVal);
    152                     background[i][cellNum] = getStat(bgStats, options->background);
    153                 }
    154 
    155                 psCellFreeData(cell);
     153                    background->data.F64[i][cellNum] = getStat(bgStats, options->background);
     154                }
     155
     156                pmCellFreeData(cell);
    156157            }
    157             psChipFreeData(chip);
    158         }
    159         psFPAFreeData(fpa);
     158            pmChipFreeData(chip);
     159        }
     160        pmFPAFreeData(fpa);
    160161        psFitsClose(inFile);
    161162    }
  • trunk/ppMerge/src/ppMergeBackground.h

    r7061 r7064  
    22#define PP_MERGE_BACKGROUND_H
    33
     4#include <pslib.h>
     5#include <psmodules.h>
     6
     7#include "ppMergeData.h"
     8#include "ppMergeOptions.h"
     9
    410// Get the scale and zero for each chip of each input
    5 bool ppMergeScaleZero(ppImage **scales, // The scales for each integration/cell
    6                       ppImage **zeros, // The zeroes for each integration/cell
     11bool ppMergeScaleZero(psImage **scales, // The scales for each integration/cell
     12                      psImage **zeros, // The zeroes for each integration/cell
    713                      ppMergeData *data,// The data
    814                      const ppMergeOptions *options, // The options
  • trunk/ppMerge/src/ppMergeCheckInputs.h

    r7061 r7064  
    22#define PP_MERGE_CHECK_INPUTS_H
    33
     4#include <psmodules.h>
     5#include "ppMergeOptions.h"
     6#include "ppMergeData.h"
     7
    48// Check input files to make sure everything's consistent
    5 bool ppMergeCheckInputs(ppMergeOptions *options, // Options
    6                         const pmConfig *config // Configuration
     9ppMergeData *ppMergeCheckInputs(ppMergeOptions *options, // Options
     10                                const pmConfig *config // Configuration
    711    );
    812
  • trunk/ppMerge/src/ppMergeCombine.h

    r7061 r7064  
    44#include <pslib.h>
    55#include <psmodules.h>
     6
     7#include "ppMergeData.h"
     8#include "ppMergeOptions.h"
    69
    710// Combine readouts
  • trunk/ppMerge/src/ppMergeConfig.h

    r6998 r7064  
    11#ifndef PP_MERGE_CONFIG_H
    22#define PP_MERGE_CONFIG_H
     3
     4#include <psmodules.h>
    35
    46// Get the configuration information
  • trunk/ppMerge/src/ppMergeData.h

    r7061 r7064  
    11#ifndef PP_MERGE_DATA_H
    22#define PP_MERGE_DATA_H
     3
     4#include <pslib.h>
     5#include <psmodules.h>
    36
    47// Container for the data
  • trunk/ppMerge/src/ppMergeOptions.h

    r6998 r7064  
    22#define PP_MERGE_OPTIONS_H
    33
    4 #include <psModules.h>
     4#include <pslib.h>
     5#include <psmodules.h>
    56
    67// Mode of on/off pairs; the value corresponds to how many images are in each set
Note: See TracChangeset for help on using the changeset viewer.