Changeset 14463 for trunk/ppSim/src/ppSim.h
- Timestamp:
- Aug 9, 2007, 6:03:19 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSim.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSim.h
r12996 r14463 1 1 #ifndef PP_SIM_H 2 2 #define PP_SIM_H 3 4 #ifdef HAVE_CONFIG_H 5 #include <config.h> 6 #endif 7 8 #include <stdio.h> 9 #include <strings.h> 10 #include <pslib.h> 11 #include <psmodules.h> 12 #include <psastro.h> 3 13 4 14 #define PPSIM_RECIPE "PPSIM" 5 15 #define OUTPUT_FILE "PPSIM.OUTPUT" 6 16 17 // Compare a value with minimum and maximum values, replacing where required. 18 #define COMPARE(VALUE,MIN,MAX) { \ 19 if (VALUE < MIN) { MIN = VALUE; } \ 20 if (VALUE > MAX) { MAX = VALUE; } \ 21 } 22 23 // Return cell position, given an FPA position; calculations are all done in pixel units 24 #define PPSIM_FPA_TO_CELL(pos, cell0, cellParity, binning, chip0, chipParity) \ 25 (((pos) - (chip0))*(chipParity) - (cell0))*(cellParity) / (binning) 7 26 8 27 28 // Return FPA position, given a cell position; calculations are all done in pixel units 29 #define PPSIM_CELL_TO_FPA(pos, cell0, cellParity, binning, chip0, chipParity) \ 30 ((chip0) + (binning)*(chipParity)*((cell0) + (cellParity)*(pos))) 9 31 10 32 // Type of image to simulate … … 16 38 } ppSimType; 17 39 40 typedef struct { 41 double ra; 42 double dec; 43 float mag; 44 float x; 45 float y; 46 float flux; 47 float peak; 48 } ppSimStar; 49 50 51 ppSimStar *ppSimStarAlloc (); 18 52 19 53 /// Parse command-line arguments 20 54 void ppSimArguments(int argc, char *argv[], ///< Command-line arguments 21 pmConfig *config ///< Configuration22 );55 pmConfig *config ///< Configuration 56 ); 23 57 24 58 /// Create output file … … 26 60 /// Returns a borrowed pointer to the FPA file. 27 61 pmFPAfile *ppSimCreate(pmConfig *config ///< Configuration 28 ); 62 ); 63 64 // Return bounds of a chip, based on the concepts 65 psRegion *ppSimChipBounds(const pmChip *chip, // Chip for which to determine size 66 pmFPAview *view // View for chip 67 ); 68 69 // Return bounds of an FPA, based on the concepts 70 psRegion *ppSimFPABounds(const pmFPA *fpa // FPA for which to determine size 71 ); 29 72 30 73 /// Loop over the output file, generating simulated data 31 74 psExit ppSimLoop(pmConfig *config ///< Configuration 32 );75 ); 33 76 77 // Add a star into the signal and variance images 78 bool ppSimInsertStar(psImage *signal, // Signal image, to which to add star 79 psImage *variance, // Variance image, to which to add star 80 float x0, float y0, // Position of star 81 float peak, // Peak flux of star 82 float noise, // Rough noise estimate 83 float seeing, // Seeing for star 84 const psImage *correction // Exposure correction as a function of position 85 ); 34 86 87 psArray *ppSimLoadStars (pmFPA *fpa, pmConfig *config); 88 bool ppSimMakeStars(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng); 89 90 psVector *ppSimMakeBiassec (pmCell *cell, pmConfig *config); 91 psVector *ppSimMakeBias (psImage *signal, psImage *variance, pmCell *cell, pmConfig *config, const psRandom *rng) ; 92 bool ppSimMakeDark (psImage *signal, psImage *variance, pmConfig *config); 93 bool ppSimMakeSky (psImage *signal, psImage *variance, psImage *expCorr, ppSimType type, pmConfig *config, pmFPA *fpa, pmChip *chip, pmCell *cell); 94 bool ppSimInsertStars (psImage *signal, psImage *variance, psImage *expCorr, psArray *stars, pmConfig *config, pmChip *chip, pmCell *cell); 95 96 bool ppSimInitHeader(pmConfig *config, 97 pmFPA *fpa, 98 pmChip *chip, 99 pmCell *cell); 100 101 bool ppSimSaturate(psImage *image, // Image to apply saturation 102 const pmConfig *config, 103 const pmCell *cell); // Saturation level 104 105 bool ppSimUpdateConceptsFPA (pmFPA *fpa, pmConfig *config); 106 bool ppSimUpdateConceptsCell (pmCell *cell, pmConfig *config); 107 108 bool ppSimAddOverscan (pmReadout *readout, pmConfig *config, psVector *biasCols, psVector *biasRows, psRandom *rng); 109 110 psImage *ppSimAddNoise(psImage *signal, // Signal image, modified and returned 111 const psImage *variance, // Variance image 112 const pmConfig *config, 113 const pmCell *cell, 114 const psRandom *rng // Random number generator 115 ); 35 116 36 117 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
