Changeset 6260
- Timestamp:
- Jan 30, 2006, 6:00:06 PM (20 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 10 added
- 14 edited
-
Makefile.am (modified) (1 diff)
-
ppConfig.c (added)
-
ppConfig.h (added)
-
ppFile.c (modified) (2 diffs)
-
ppFile.h (added)
-
ppImage.c (modified) (1 diff)
-
ppImage.h (modified) (3 diffs)
-
ppImageConfig.c (modified) (1 diff)
-
ppImageData.c (added)
-
ppImageData.h (added)
-
ppImageDetrend.h (added)
-
ppImageDetrendBias.c (modified) (1 diff)
-
ppImageDetrendCell.c (modified) (3 diffs)
-
ppImageDetrendMask.c (modified) (2 diffs)
-
ppImageDetrendNonLinear.c (modified) (5 diffs)
-
ppImageLoop.c (modified) (5 diffs)
-
ppImageOptions.c (modified) (1 diff)
-
ppImageOptions.h (added)
-
ppImageParseCamera.c (modified) (2 diffs)
-
ppImageParseDetrend.c (modified) (2 diffs)
-
ppImageWeights.c (modified) (3 diffs)
-
ppMem.c (added)
-
ppMem.h (added)
-
ppTest.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/Makefile.am
r6079 r6260 1 bin_PROGRAMS = ppImage 1 bin_PROGRAMS = ppImage ppTest 2 3 ppTest_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(ppImage_CFLAGS) 4 ppTest_LDADD = $(PSLIB_LIBS) $(PSMODULE_LIBS) 5 ppTest_SOURCES = \ 6 ppTest.c \ 7 ppMem.c 2 8 3 9 ppImage_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(ppImage_CFLAGS) 4 10 ppImage_LDADD = $(PSLIB_LIBS) $(PSMODULE_LIBS) 5 11 ppImage_SOURCES = \ 6 ppDetrendBias.c \ 7 ppDetrendCell.c \ 8 ppDetrendMask.c \ 9 ppDetrendNonLinear.c \ 10 ppDetrendPedestal.c \ 12 ppConfig.c \ 11 13 ppFile.c \ 14 ppMem.c \ 12 15 ppImage.c \ 13 16 ppImageConfig.c \ 17 ppImageData.c \ 18 ppImageDetrendBias.c \ 19 ppImageDetrendCell.c \ 20 ppImageDetrendMask.c \ 21 ppImageDetrendNonLinear.c \ 14 22 ppImageLoop.c \ 15 23 ppImageOptions.c \ 16 24 ppImageParseCamera.c \ 17 25 ppImageParseDetrend.c \ 18 ppImageWeights.c \ 19 ppImageOutput.c \ 20 ppImagePhot.c 26 ppImageWeights.c 21 27 # ppImageLoadPixels.c 22 28 # ppDetrendFlat.c 23 29 # ppImageOutput.c 30 # ppImageDetrendPedestal.c 31 # ppImageOutput.c 32 # ppImagePhot.c 33 24 34 25 35 noinst_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 27 43 28 44 clean-local: -
trunk/ppImage/src/ppFile.c
r6125 r6260 1 #include "ppImage.h" 1 #include <stdio.h> 2 #include "pslib.h" 3 #include "ppFile.h" 2 4 3 5 // Free a ppFile 4 static void ppFileFree(ppFile *file)6 static void fileFree(ppFile *file) 5 7 { 6 8 psFree(file->filename); … … 17 19 18 20 ppFile *file = psAlloc(sizeof(ppFile)); 19 psMemSetDeallocator(file, (psFreeFunc) ppFileFree);21 psMemSetDeallocator(file, (psFreeFunc)fileFree); 20 22 21 23 file->filename = NULL; -
trunk/ppImage/src/ppImage.c
r6148 r6260 1 #include <stdio.h> 2 #include "pslib.h" 1 3 #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" 28 5 29 6 30 7 int main(int argc, char **argv) 31 8 { 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); 40 10 41 pp Data data;42 pp Config config;43 pp Options options;11 ppImageData *data = ppImageDataAlloc(); 12 ppImageOptions *options = ppImageOptionsAlloc(); 13 ppConfig *config = ppConfigAlloc(); 44 14 45 15 psTimerStart(TIMERNAME); 46 16 47 17 // Parse the configuration and arguments 48 ppImageConfig( &config, argc, argv);18 ppImageConfig(config, argc, argv); 49 19 50 20 // Open the input image, output image, output mask 51 21 // Get camera configuration from header if not already defined 52 22 // 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 54 32 55 33 // Set various tasks (define optional operations) 56 ppImageOptions (&data, &options, &config);34 ppImageOptionsParse(data, options, config); 57 35 58 36 // open detrend images, load headers, optionally load pixels 59 ppImageParseDetrend( &data, &options, &config);37 ppImageParseDetrend(data, options, config); 60 38 61 39 // 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); 70 41 #endif 71 42 -
trunk/ppImage/src/ppImage.h
r6125 r6260 2 2 #define PP_IMAGE_H 3 3 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 5 13 #include <strings.h> 6 7 #include "pslib.h"8 9 14 #include "psAdditionals.h" 10 11 15 #include "pmFPA.h" 12 16 #include "pmFPAConstruct.h" … … 15 19 #include "pmReadout.h" 16 20 #include "pmConfig.h" 17 18 21 #include "pmFlatField.h" 19 22 #include "pmMaskBadPixels.h" 20 23 #include "pmNonLinear.h" 24 #include "pmChipMosaic.h" 21 25 #include "pmSubtractBias.h" 22 #include "pmChipMosaic.h" 23 //#include "pmFPAMorph.h" 24 #include "pmSubtractBias.h" 26 #endif 27 25 28 26 29 #define RECIPE "PHASE2" // Name of the recipe to use 27 30 #define TIMERNAME "ppImage" // Name of timer 28 31 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 33 bool ppImageConfig(ppConfig *config, int argc, char **argv); 105 34 106 35 // Determine what type of camera, and initialise 107 bool ppImageParseCamera(pp Data *data, // The data to be processed36 bool ppImageParseCamera(ppImageData *data, // The data to be processed 108 37 ppConfig *config // Configuration 109 38 ); 110 39 111 // Determine the procession options112 bool ppImageOptions(ppData *data, // The data to be processed113 ppOptions *options, // Processing options114 ppConfig *config // Configuration115 );116 40 117 118 // Loop over the 119 bool ppImageLoop(ppData *data, ppOptions *options, ppConfig *config); 41 // Loop over the input 42 bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config); 120 43 121 44 // Load the pixels for the given file … … 126 49 ); 127 50 128 bool ppImageParseDetrend(pp Data *data, ppOptions *options, ppConfig *config);51 bool ppImageParseDetrend(ppImageData *data, ppImageOptions *options, ppConfig *config); 129 52 130 53 bool ppReadoutWeights(pmReadout *readout); 131 54 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);139 55 #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 57 pmReadout* ppDetrendPedestal(pmReadout *pedestal, pmCell *input, pmReadout *bias, pmReadout *dark, float darkTime, ppImageOptions *options); 58 bool ppImageOutput(ppImageData *data, ppConfig *config); 59 bool ppImagePhot(ppImageData *data, ppImageOptions *options, ppConfig *config); 145 60 bool ppFileOpen(ppFile *fpa, psMetadata *camera, char *name, bool doThis); 146 61 #endif 147 62 148 bool ppImageOutput(ppData *data, ppConfig *config);149 bool ppImagePhot(ppData *data, ppOptions *options, ppConfig *config);150 151 63 #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" 1 5 #include "ppImage.h" 2 6 3 7 bool ppImageConfig(ppConfig *config, int argc, char **argv) 4 8 { 5 // Initialise the configuration6 config->site = NULL; // Site configuration7 config->camera = NULL; // Camera configuration8 config->recipe = NULL; // Recipe configuration9 config->arguments = NULL; // The command-line arguments10 config->database = NULL; // Database handle11 12 9 // XXX - this should be split into a function to parse argc,argv 13 10 // 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" 2 6 3 bool pp DetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppOptions *options)7 bool ppImageDetrendBias(pmReadout *inputReadout, pmReadout *bias, pmReadout *dark, ppImageOptions *options) 4 8 { 5 9 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" 2 3 #include "pmFPA.h" 4 #include "pmFlatField.h" 5 #include "ppImageDetrend.h" 3 6 4 7 // mask, bias, dark, flat are defined per Cell 5 8 6 pmReadout *pp DetrendSelectFirst(pmCell *cell, char *name, bool doThis)9 pmReadout *ppImageDetrendSelectFirst(pmCell *cell, char *name, bool doThis) 7 10 { 8 11 if (!doThis) { … … 19 22 } 20 23 21 bool pp DetrendCell(ppDetrend *detrend, ppOptions *options, ppConfig *config)24 bool ppImageDetrendCell(ppImageDetrend *detrend, ppImageOptions *options, ppConfig *config) 22 25 { 23 26 pmCellSetWeights(detrend->input); 24 27 25 pmReadout *mask = pp DetrendSelectFirst(detrend->mask, "mask", options->doMask);26 pmReadout *bias = pp DetrendSelectFirst(detrend->bias, "bias", options->doBias);27 pmReadout *dark = pp DetrendSelectFirst(detrend->dark, "dark", options->doDark);28 pmReadout *flat = pp DetrendSelectFirst(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); 29 32 30 33 #if 0 … … 39 42 // Mask bad pixels 40 43 if (options->doMask) { 41 pp DetrendMask(detrend->input, input, mask);44 ppImageDetrendMask(detrend->input, input, mask); 42 45 } 43 46 44 47 // Non-linearity correction 45 48 if (options->doNonLin) { 46 pp DetrendNonLinear(detrend->input, input, options);49 ppImageDetrendNonLinear(detrend->input, input, options); 47 50 } 48 51 49 52 // Bias, dark and overscan subtraction are all merged. 50 pp DetrendBias(input, bias, dark, options);53 ppImageDetrendBias(input, bias, dark, options); 51 54 52 55 // 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" 2 5 3 6 # define MASK_MODE (PM_MASK_TRAP | PM_MASK_BADCOL | PM_MASK_SAT) … … 5 8 // XXX pass 'concepts' not 'cell' to this function? 6 9 7 bool pp DetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask) {10 bool ppImageDetrendMask(pmCell *cell, pmReadout *input, pmReadout *mask) { 8 11 9 12 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" 2 6 3 bool pp DetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem) {7 bool ppImageDetrendNonLinearPolynomial(pmReadout *input, psMetadataItem *dataItem) { 4 8 5 9 // These are the polynomial coefficients … … 19 23 } 20 24 21 bool pp DetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem) {25 bool ppImageDetrendNonLinearLookup(pmReadout *input, psMetadataItem *dataItem) { 22 26 23 27 // This is a filename: lookup table … … 40 44 } 41 45 42 bool pp DetrendNonLinear (pmCell *cell, pmReadout *input, ppOptions *options) {46 bool ppImageDetrendNonLinear(pmCell *cell, pmReadout *input, ppImageOptions *options) { 43 47 44 48 psMetadataItem *concept; … … 46 50 switch (options->nonLinearType) { 47 51 case PS_DATA_VECTOR: 48 pp DetrendNonLinearPolynomial (input, options->nonLinearData);52 ppImageDetrendNonLinearPolynomial (input, options->nonLinearData); 49 53 return true; 50 54 51 55 case PS_DATA_STRING: 52 pp DetrendNonLinearLookup (input, options->nonLinearData);56 ppImageDetrendNonLinearLookup (input, options->nonLinearData); 53 57 return true; 54 58 … … 91 95 switch (optionItem->type) { 92 96 case PS_DATA_VECTOR: 93 pp DetrendNonLinearPolynomial (input, optionItem);97 ppImageDetrendNonLinearPolynomial (input, optionItem); 94 98 return true; 95 99 case PS_DATA_STRING: 96 pp DetrendNonLinearLookup (input, optionItem);100 ppImageDetrendNonLinearLookup (input, optionItem); 97 101 return true; 98 102 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" 2 9 3 10 #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 }15 11 16 12 // Read the entire FPA … … 46 42 47 43 48 bool ppImageLoop(pp Data *data, ppOptions *options, ppConfig *config)44 bool ppImageLoop(ppImageData *data, ppImageOptions *options, ppConfig *config) 49 45 { 50 pp Detrend detrend;46 ppImageDetrend detrend; 51 47 52 48 int processChip = psMetadataLookupS32(NULL, config->arguments, "-chip"); // Chip number to process or -1 … … 83 79 pmChip *flatChip = data->flat->fpa->chips->data[i]; 84 80 85 ppMemPrint((psMemBlock*)inputChip-1);86 87 81 psArray *cells = inputChip->cells; 88 82 for (int j = 0; j < cells->n; j++) { … … 104 98 } 105 99 106 pp DetrendCell(&detrend, options, config);100 ppImageDetrendCell(&detrend, options, config); 107 101 108 102 // Need to free detrend cells here so we have enough memory to do other stuff … … 130 124 #ifndef MEM_LEAKS 131 125 pmChipFreeCells(inputChip); 132 ppMemPrint((psMemBlock*)chips->data[i]-1);133 126 #endif 134 127 } -
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 7 static void imageOptionsFree(ppImageOptions *options) 8 { 9 psFree(options->overscan); 10 psFree(options->nonLinearData); 11 psFree(options->nonLinearSource); 12 } 13 14 ppImageOptions *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 2 27 3 28 // XXX EAM : this needs signficant work to choose the detrend images based on the detrend database 4 29 5 bool ppImageOptions (ppData *data, ppOptions *options, ppConfig *config)30 bool ppImageOptionsParse(ppImageData *data, ppImageOptions *options, ppConfig *config) 6 31 { 7 32 -
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" 1 6 #include "ppImage.h" 2 7 3 bool ppImageParseCamera(pp Data *data, ppConfig *config)8 bool ppImageParseCamera(ppImageData *data, ppConfig *config) 4 9 { 5 10 // Initialise the containers where the files will go … … 10 15 data->flat = ppFileAlloc(); 11 16 data->fringe = ppFileAlloc(); 12 #if 013 data->process = ppFileAlloc();14 #endif15 17 16 18 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" 2 8 3 9 // open all needed detrend files … … 25 31 } 26 32 27 bool ppImageParseDetrend (ppData *data, ppOptions *options, ppConfig *config) {33 bool ppImageParseDetrend(ppImageData *data, ppImageOptions *options, ppConfig *config) { 28 34 29 35 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" 2 5 3 6 bool ppReadoutWeights (pmReadout *readout) { … … 10 13 float rdnoise = 5.0; // in electrons 11 14 float gain = 2.0; // in e/ADU 12 15 13 16 float rgain = 1.0 / gain; 14 17 float rnoise = PS_SQR (rdnoise / gain); … … 19 22 20 23 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 } 25 28 } 26 29 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
