IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6260


Ignore:
Timestamp:
Jan 30, 2006, 6:00:06 PM (20 years ago)
Author:
Paul Price
Message:

Rearranging header files

Location:
trunk/ppImage/src
Files:
10 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/Makefile.am

    r6079 r6260  
    1 bin_PROGRAMS = ppImage
     1bin_PROGRAMS = ppImage ppTest
     2
     3ppTest_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(ppImage_CFLAGS)
     4ppTest_LDADD = $(PSLIB_LIBS) $(PSMODULE_LIBS)
     5ppTest_SOURCES = \
     6        ppTest.c \
     7        ppMem.c
    28
    39ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(ppImage_CFLAGS)
    410ppImage_LDADD = $(PSLIB_LIBS) $(PSMODULE_LIBS)
    511ppImage_SOURCES = \
    6         ppDetrendBias.c \
    7         ppDetrendCell.c \
    8         ppDetrendMask.c \
    9         ppDetrendNonLinear.c \
    10         ppDetrendPedestal.c \
     12        ppConfig.c \
    1113        ppFile.c \
     14        ppMem.c \
    1215        ppImage.c \
    1316        ppImageConfig.c \
     17        ppImageData.c \
     18        ppImageDetrendBias.c \
     19        ppImageDetrendCell.c \
     20        ppImageDetrendMask.c \
     21        ppImageDetrendNonLinear.c \
    1422        ppImageLoop.c \
    1523        ppImageOptions.c \
    1624        ppImageParseCamera.c \
    1725        ppImageParseDetrend.c \
    18         ppImageWeights.c \
    19         ppImageOutput.c \
    20         ppImagePhot.c
     26        ppImageWeights.c
    2127#       ppImageLoadPixels.c
    2228#       ppDetrendFlat.c
    2329#       ppImageOutput.c
     30#       ppImageDetrendPedestal.c
     31#       ppImageOutput.c
     32#       ppImagePhot.c
     33
    2434
    2535noinst_HEADERS = \
    26         ppImage.h
     36        ppConfig.h \
     37        ppFile.h \
     38        ppMem.h \
     39        ppImage.h \
     40        ppImageData.h \
     41        ppImageDetrend.h \
     42        ppImageOptions.h
    2743
    2844clean-local:
  • trunk/ppImage/src/ppFile.c

    r6125 r6260  
    1 #include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "ppFile.h"
    24
    35// Free a ppFile
    4 static void ppFileFree(ppFile *file)
     6static void fileFree(ppFile *file)
    57{
    68    psFree(file->filename);
     
    1719
    1820    ppFile *file = psAlloc(sizeof(ppFile));
    19     psMemSetDeallocator(file, (psFreeFunc)ppFileFree);
     21    psMemSetDeallocator(file, (psFreeFunc)fileFree);
    2022
    2123    file->filename = NULL;
  • trunk/ppImage/src/ppImage.c

    r6148 r6260  
     1#include <stdio.h>
     2#include "pslib.h"
    13#include "ppImage.h"
    2 
    3 psMemId ppMemAlloc(const psMemBlock *ptr)
    4 {
    5     psLogMsg(__func__, PS_LOG_INFO,
    6              "Allocated memory block %d: %ld references\n"
    7              "\tFile %s, line %d, size %d\n"
    8              "\tPosts: %lx %lx %lx\n"
    9              "\tLast operation: %s:%d\n",
    10              ptr->id, ptr->refCounter, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
    11              ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize),
    12              ptr->lastopFile, ptr->lastopLine);
    13     return 0;
    14 }
    15 
    16 psMemId ppMemFree(const psMemBlock *ptr)
    17 {
    18     psLogMsg(__func__, PS_LOG_INFO,
    19              "Freed memory block %d: %ld references\n"
    20              "\tFile %s, line %d, size %d\n"
    21              "\tPosts: %lx %lx %lx\n"
    22              "\tLast operation: %s:%d\n",
    23              ptr->id, ptr->refCounter-1, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
    24              ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize),
    25              ptr->lastopFile, ptr->lastopLine);
    26     return 0;
    27 }
     4#include "ppMem.h"
    285
    296
    307int main(int argc, char **argv)
    318{
    32 #if 0
    33     psMemAllocCallbackSet(ppMemAlloc);
    34     psMemFreeCallbackSet(ppMemFree);
    35 //    psMemAllocCallbackSetID(6967);
    36 //    psMemFreeCallbackSetID(6967);
    37     psMemAllocCallbackSetID(51804);
    38     psMemFreeCallbackSetID(51804);
    39 #endif
     9//    psErrorRegister(NULL, -1);
    4010
    41     ppData data;
    42     ppConfig config;
    43     ppOptions options;
     11    ppImageData *data = ppImageDataAlloc();
     12    ppImageOptions *options = ppImageOptionsAlloc();
     13    ppConfig *config = ppConfigAlloc();
    4414
    4515    psTimerStart(TIMERNAME);
    4616
    4717    // Parse the configuration and arguments
    48     ppImageConfig(&config, argc, argv);
     18    ppImageConfig(config, argc, argv);
    4919
    5020    // Open the input image, output image, output mask
    5121    // Get camera configuration from header if not already defined
    5222    // Construct camera in preparation for reading
    53     ppImageParseCamera(&data, &config);
     23    ppImageParseCamera(data, config);
     24
     25    // Cleaning up
     26    psFree(data);
     27    psFree(options);
     28    psFree(config);
     29    psTimerStop();
     30    ppMemCheck();
     31#if 0
    5432
    5533    // Set various tasks (define optional operations)
    56     ppImageOptions(&data, &options, &config);
     34    ppImageOptionsParse(data, options, config);
    5735
    5836    // open detrend images, load headers, optionally load pixels
    59     ppImageParseDetrend(&data, &options, &config);
     37    ppImageParseDetrend(data, options, config);
    6038
    6139    // Image Arithmetic Loop
    62     ppImageLoop(&data, &options, &config);
    63 
    64 #if 0
    65     // Output image
    66     ppImageOutput(&data, &config);
    67 
    68     // Do photometry
    69     ppImagePhot(&data, &options, &config);
     40    ppImageLoop(data, options, config);
    7041#endif
    7142
  • trunk/ppImage/src/ppImage.h

    r6125 r6260  
    22#define PP_IMAGE_H
    33
    4 #include <stdio.h>
     4#include "pslib.h"
     5#include "pmFPA.h"
     6#include "ppConfig.h"
     7#include "ppFile.h"
     8#include "ppImageData.h"
     9#include "ppImageOptions.h"
     10
     11
     12#if 0
    513#include <strings.h>
    6 
    7 #include "pslib.h"
    8 
    914#include "psAdditionals.h"
    10 
    1115#include "pmFPA.h"
    1216#include "pmFPAConstruct.h"
     
    1519#include "pmReadout.h"
    1620#include "pmConfig.h"
    17 
    1821#include "pmFlatField.h"
    1922#include "pmMaskBadPixels.h"
    2023#include "pmNonLinear.h"
     24#include "pmChipMosaic.h"
    2125#include "pmSubtractBias.h"
    22 #include "pmChipMosaic.h"
    23 //#include "pmFPAMorph.h"
    24 #include "pmSubtractBias.h"
     26#endif
     27
    2528
    2629#define RECIPE "PHASE2"                 // Name of the recipe to use
    2730#define TIMERNAME "ppImage"             // Name of timer
    2831
    29 // How much of the FPA to load at a time
    30 typedef enum {
    31     PP_LOAD_NONE,                       // Don't load anything
    32     PP_LOAD_FPA,                        // Load the entire FPA at once
    33     PP_LOAD_CHIP,                       // Load by chip
    34     PP_LOAD_CELL,                       // Load by cell
    35 } ppImageLoadDepth;
    36 
    37 // Configuration data
    38 typedef struct {
    39     psMetadata *site;                   // The site configuration
    40     psMetadata *camera;                 // The camera configuration
    41     psMetadata *recipe;                 // The recipe (i.e., specific setups)
    42     psMetadata *arguments;              // The command-line arguments
    43     psDB       *database;               // Database handle
    44 } ppConfig;
    45 
    46 // Options
    47 typedef struct {
    48     bool doMask;                        // Mask bad pixels
    49     bool doBias;                        // Bias subtraction
    50     bool doDark;                        // Dark subtraction
    51     bool doFlat;                        // Flat-field normalisation
    52     bool doFringe;                      // Fringe subtraction
    53     bool doSource;                      // Source identification and photometry
    54     bool doAstrom;                      // Astrometry
    55     bool doOverscan;                    // Overscan subtraction
    56     pmOverscanOptions *overscan;        // Overscan options
    57     bool doNonLin;                      // Non-linearity correction
    58     psDataType nonLinearType;
    59     psMetadataItem *nonLinearData;
    60     void *nonLinearSource;
    61     ppImageLoadDepth imageLoadDepth;    // How much of the FPA to load at once
    62 } ppOptions;
    63 
    64 // A file to process
    65 typedef struct {
    66     char *filename;                     // File name
    67     psFits *fits;                       // The FITS file handle
    68     psMetadata *phu;                    // The FITS header
    69     pmFPA *fpa;                         // The FPA, with pixels and extensions
    70 } ppFile;
    71 
    72 // The data to be processed
    73 typedef struct {
    74     ppFile *input;                      // The input, to be operated upon
    75     ppFile *mask;                       // The bad pixel mask image
    76     ppFile *bias;                       // The bias correction image
    77     ppFile *dark;                       // The dark correction image
    78     ppFile *flat;                       // The flat-field correction image
    79     ppFile *fringe;                     // The fringe correction image
    80     psFits *output;                     // The output file
    81 #if 0
    82     ppFile *process;                    // A dummy file pointing out what needs to be processed
    83 #endif
    84 } ppData;
    85 
    86 // Cells to be used in the detrend
    87 typedef struct {
    88     pmCell *input;                      // The input cell, to be operated upon
    89     pmCell *mask;                       // The bad pixel mask
    90     pmCell *bias;                       // The bias correction
    91     pmCell *dark;                       // The dark correction
    92     pmCell *flat;                       // The flat-field correction
    93 } ppDetrend;
    94 
    95 
    96 // Allocators
    97 ppFile *ppFileAlloc(void);
    98 
    99 
    100 
    101 // Parse the site configuration (and camera and recipe if specified); read the command-line arguments
    102 bool ppImageConfig(ppConfig *config,   // The configuration(output)
    103                    int argc, char **argv // Command-line arguments
    104                    );
     32// Get the configuration
     33bool ppImageConfig(ppConfig *config, int argc, char **argv);
    10534
    10635// Determine what type of camera, and initialise
    107 bool ppImageParseCamera(ppData *data,   // The data to be processed
     36bool ppImageParseCamera(ppImageData *data,   // The data to be processed
    10837                        ppConfig *config // Configuration
    10938                        );
    11039
    111 // Determine the procession options
    112 bool ppImageOptions(ppData *data,       // The data to be processed
    113                     ppOptions *options, // Processing options
    114                     ppConfig *config    // Configuration
    115                     );
    11640
    117 
    118 // Loop over the
    119 bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config);
     41// Loop over the input
     42bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config);
    12043
    12144// Load the pixels for the given file
     
    12649                       );
    12750
    128 bool ppImageParseDetrend(ppData *data, ppOptions *options, ppConfig *config);
     51bool ppImageParseDetrend(ppImageData *data, ppImageOptions *options, ppConfig *config);
    12952
    13053bool ppReadoutWeights(pmReadout *readout);
    13154
    132 bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config);
    133 
    134 bool ppDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask);
    135 bool ppDetrendNonLinear(pmCell *cell, pmReadout *input, ppOptions *options);
    136 bool ppDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem);
    137 bool ppDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem);
    138 bool ppDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options);
    13955#if 0
    140 pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppOptions *options);
    141 #endif
    142 pmReadout* ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis);
    143 
    144 #if 0
     56// These functions are not implemented, or not needed
     57pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppImageOptions *options);
     58bool ppImageOutput(ppImageData *data, ppConfig *config);
     59bool ppImagePhot(ppImageData *data, ppImageOptions *options, ppConfig *config);
    14560bool ppFileOpen(ppFile *fpa, psMetadata *camera, char *name, bool doThis);
    14661#endif
    14762
    148 bool ppImageOutput(ppData *data, ppConfig *config);
    149 bool ppImagePhot(ppData *data, ppOptions *options, ppConfig *config);
    150 
    15163#endif // Pau.
  • trunk/ppImage/src/ppImageConfig.c

    r5976 r6260  
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmConfig.h"
     4#include "ppConfig.h"
    15#include "ppImage.h"
    26
    37bool ppImageConfig(ppConfig *config, int argc, char **argv)
    48{
    5     // Initialise the configuration
    6     config->site = NULL;                // Site configuration
    7     config->camera = NULL;              // Camera configuration
    8     config->recipe = NULL;              // Recipe configuration
    9     config->arguments = NULL;           // The command-line arguments
    10     config->database = NULL;            // Database handle
    11 
    129    // XXX - this should be split into a function to parse argc,argv
    1310    //       and a second to read the config files.
  • trunk/ppImage/src/ppImageDetrendBias.c

    r6125 r6260  
    1 #include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmFPA.h"
     4#include "ppImageOptions.h"
     5#include "ppImageDetrend.h"
    26
    3 bool ppDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options)
     7bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options)
    48{
    59    psTrace(__func__, 1, "Commencing bias processing....\n");
  • trunk/ppImage/src/ppImageDetrendCell.c

    r6125 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
    23#include "pmFPA.h"
     4#include "pmFlatField.h"
     5#include "ppImageDetrend.h"
    36
    47// mask, bias, dark, flat are defined per Cell
    58
    6 pmReadout *ppDetrendSelectFirst(pmCell *cell, char *name, bool doThis)
     9pmReadout *ppImageDetrendSelectFirst(pmCell *cell, char *name, bool doThis)
    710{
    811    if (!doThis) {
     
    1922}
    2023
    21 bool ppDetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config)
     24bool ppImageDetrendCell(ppImageDetrend *detrend, ppImageOptions *options, ppConfig *config)
    2225{
    2326    pmCellSetWeights(detrend->input);
    2427
    25     pmReadout *mask = ppDetrendSelectFirst(detrend->mask, "mask", options->doMask);
    26     pmReadout *bias = ppDetrendSelectFirst(detrend->bias, "bias", options->doBias);
    27     pmReadout *dark = ppDetrendSelectFirst(detrend->dark, "dark", options->doDark);
    28     pmReadout *flat = ppDetrendSelectFirst(detrend->flat, "flat", options->doFlat);
     28    pmReadout *mask = ppImageDetrendSelectFirst(detrend->mask, "mask", options->doMask);
     29    pmReadout *bias = ppImageDetrendSelectFirst(detrend->bias, "bias", options->doBias);
     30    pmReadout *dark = ppImageDetrendSelectFirst(detrend->dark, "dark", options->doDark);
     31    pmReadout *flat = ppImageDetrendSelectFirst(detrend->flat, "flat", options->doFlat);
    2932
    3033#if 0
     
    3942        // Mask bad pixels
    4043        if (options->doMask) {
    41             ppDetrendMask(detrend->input, input, mask);
     44            ppImageDetrendMask(detrend->input, input, mask);
    4245        }
    4346
    4447        // Non-linearity correction
    4548        if (options->doNonLin) {
    46             ppDetrendNonLinear(detrend->input, input, options);
     49            ppImageDetrendNonLinear(detrend->input, input, options);
    4750        }
    4851
    4952        // Bias, dark and overscan subtraction are all merged.
    50         ppDetrendBias(input, bias, dark, options);
     53        ppImageDetrendBias(input, bias, dark, options);
    5154
    5255        // Flat-field correction (no options used?)
  • trunk/ppImage/src/ppImageDetrendMask.c

    r5858 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pmFPA.h"
     3#include "pmMaskBadPixels.h"
     4#include "ppImageDetrend.h"
    25
    36# define MASK_MODE (PM_MASK_TRAP | PM_MASK_BADCOL | PM_MASK_SAT)
     
    58// XXX pass 'concepts' not 'cell' to this function?
    69
    7 bool ppDetrendMask (pmCell *cell, pmReadout *input, pmReadout *mask) {
     10bool ppImageDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask) {
    811
    912    float saturation = psMetadataLookupF32(NULL, cell->concepts, "CELL.SATURATION");
  • trunk/ppImage/src/ppImageDetrendNonLinear.c

    r5976 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmFPA.h"
     4#include "pmNonLinear.h"
     5#include "ppImageDetrend.h"
    26
    3 bool ppDetrendNonLinearPolynomial (pmReadout *input, psMetadataItem *dataItem) {
     7bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem) {
    48
    59    // These are the polynomial coefficients
     
    1923}
    2024
    21 bool ppDetrendNonLinearLookup (pmReadout *input, psMetadataItem *dataItem) {
     25bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem) {
    2226
    2327    // This is a filename: lookup table
     
    4044}
    4145
    42 bool ppDetrendNonLinear (pmCell *cell, pmReadout *input, ppOptions *options) {
     46bool ppImageDetrendNonLinear(pmCell *cell, pmReadout *input, ppImageOptions *options) {
    4347
    4448    psMetadataItem *concept;
     
    4650    switch (options->nonLinearType) {
    4751      case PS_DATA_VECTOR:
    48         ppDetrendNonLinearPolynomial (input, options->nonLinearData);
     52        ppImageDetrendNonLinearPolynomial (input, options->nonLinearData);
    4953        return true;
    5054
    5155      case PS_DATA_STRING:
    52         ppDetrendNonLinearLookup (input, options->nonLinearData);
     56        ppImageDetrendNonLinearLookup (input, options->nonLinearData);
    5357        return true;
    5458
     
    9195        switch (optionItem->type) {
    9296          case PS_DATA_VECTOR:
    93             ppDetrendNonLinearPolynomial (input, optionItem);
     97            ppImageDetrendNonLinearPolynomial (input, optionItem);
    9498            return true;
    9599          case PS_DATA_STRING:
    96             ppDetrendNonLinearLookup (input, optionItem);
     100            ppImageDetrendNonLinearLookup (input, optionItem);
    97101            return true;
    98102          default:
  • trunk/ppImage/src/ppImageLoop.c

    r6148 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmFPA.h"
     4#include "pmFPARead.h"
     5#include "pmChipMosaic.h"
     6#include "pmFPAWrite.h"
     7#include "ppImageDetrend.h"
     8#include "ppImage.h"
    29
    310#define MEM_LEAKS 1
    4 
    5 psMemId ppMemPrint(const psMemBlock *ptr)
    6 {
    7     psLogMsg(__func__, PS_LOG_INFO,
    8              "Memory block %d (%ld):\n"
    9              "\tFile %s, line %d, size %d\n"
    10              "\tPosts: %lx %lx %lx\n",
    11              ptr->id, ptr->refCounter, ptr->file, ptr->lineno, ptr->userMemorySize, ptr->startblock,
    12              ptr->endblock, *(void**)((int8_t *)(ptr + 1) + ptr->userMemorySize));
    13     return 0;
    14 }
    1511
    1612// Read the entire FPA
     
    4642
    4743
    48 bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config)
     44bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config)
    4945{
    50     ppDetrend detrend;
     46    ppImageDetrend detrend;
    5147
    5248    int processChip = psMetadataLookupS32(NULL, config->arguments, "-chip"); // Chip number to process or -1
     
    8379        pmChip *flatChip  = data->flat->fpa->chips->data[i];
    8480
    85         ppMemPrint((psMemBlock*)inputChip-1);
    86 
    8781        psArray *cells = inputChip->cells;
    8882        for (int j = 0; j < cells->n; j++) {
     
    10498            }
    10599
    106             ppDetrendCell(&detrend, options, config);
     100            ppImageDetrendCell(&detrend, options, config);
    107101
    108102            // Need to free detrend cells here so we have enough memory to do other stuff
     
    130124#ifndef MEM_LEAKS
    131125        pmChipFreeCells(inputChip);
    132         ppMemPrint((psMemBlock*)chips->data[i]-1);
    133126#endif
    134127    }
  • trunk/ppImage/src/ppImageOptions.c

    r6064 r6260  
    1 #include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "ppConfig.h"
     4#include "ppImageData.h"
     5#include "ppImageOptions.h"
     6
     7static void imageOptionsFree(ppImageOptions *options)
     8{
     9    psFree(options->overscan);
     10    psFree(options->nonLinearData);
     11    psFree(options->nonLinearSource);
     12}
     13
     14ppImageOptions *ppImageOptionsAlloc(void)
     15{
     16    ppImageOptions *options = psAlloc(sizeof(ppImageOptions));
     17    psMemSetDeallocator(options, (psFreeFunc)imageOptionsFree);
     18
     19    // Initialise options
     20    options->overscan = NULL;
     21    options->nonLinearData = NULL;
     22    options->nonLinearSource = NULL;
     23
     24    return options;
     25}
     26
    227
    328// XXX EAM : this needs signficant work to choose the detrend images based on the detrend database
    429
    5 bool ppImageOptions(ppData *data, ppOptions *options, ppConfig *config)
     30bool ppImageOptionsParse(ppImageData *data, ppImageOptions *options, ppConfig *config)
    631{
    732
  • trunk/ppImage/src/ppImageParseCamera.c

    r6125 r6260  
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmFPA.h"
     4#include "pmFPAConstruct.h"
     5#include "pmConfig.h"
    16#include "ppImage.h"
    27
    3 bool ppImageParseCamera(ppData *data, ppConfig *config)
     8bool ppImageParseCamera(ppImageData *data, ppConfig *config)
    49{
    510    // Initialise the containers where the files will go
     
    1015    data->flat    = ppFileAlloc();
    1116    data->fringe  = ppFileAlloc();
    12 #if 0
    13     data->process = ppFileAlloc();
    14 #endif
    1517
    1618    data->input->filename = psMemIncrRefCounter(psMetadataLookupStr(NULL, config->arguments, "-input"));
  • trunk/ppImage/src/ppImageParseDetrend.c

    r5976 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmConfig.h"
     4#include "ppFile.h"
     5#include "ppImageData.h"
     6#include "ppImageOptions.h"
     7#include "ppImage.h"
    28
    39// open all needed detrend files
     
    2531}
    2632
    27 bool ppImageParseDetrend (ppData *data, ppOptions *options, ppConfig *config) {
     33bool ppImageParseDetrend(ppImageData *data, ppImageOptions *options, ppConfig *config) {
    2834
    2935    ppFileOpen(data->mask, config->camera, "mask", options->doMask);
  • trunk/ppImage/src/ppImageWeights.c

    r5858 r6260  
    1 # include "ppImage.h"
     1#include <stdio.h>
     2#include "pslib.h"
     3#include "pmFPA.h"
     4#include "ppImage.h"
    25
    36bool ppReadoutWeights (pmReadout *readout) {
     
    1013    float rdnoise = 5.0;  // in electrons
    1114    float gain = 2.0;     // in e/ADU
    12    
     15
    1316    float rgain = 1.0 / gain;
    1417    float rnoise = PS_SQR (rdnoise / gain);
     
    1922
    2023    for (int j = 0; j < image->numRows; j++) {
    21         for (int i = 0; i < image->numCols; i++) {
    22             vM[j][i] = 0;
    23             vW[j][i] = PS_MAX (rgain * vI[j][i] + rnoise, 0.0);
    24         }
     24        for (int i = 0; i < image->numCols; i++) {
     25            vM[j][i] = 0;
     26            vW[j][i] = PS_MAX (rgain * vI[j][i] + rnoise, 0.0);
     27        }
    2528    }
    2629    return true;
Note: See TracChangeset for help on using the changeset viewer.