Changeset 23594 for branches/cnb_branches/cnb_branch_20090301/ppSim/src
- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 8 edited
- 1 copied
-
. (modified) (1 prop)
-
ppSim/src/Makefile.am (modified) (1 diff)
-
ppSim/src/ppSim.h (modified) (3 diffs)
-
ppSim/src/ppSimBadCTE.c (copied) (copied from trunk/ppSim/src/ppSimBadCTE.c )
-
ppSim/src/ppSimLoadSpots.c (modified) (1 diff)
-
ppSim/src/ppSimLoadStars.c (modified) (1 diff)
-
ppSim/src/ppSimLoop.c (modified) (1 diff)
-
ppSim/src/ppSimRandomGaussian.c (modified) (6 diffs)
-
ppSim/src/ppSimStars.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/ppSim/src/Makefile.am
r23352 r23594 45 45 ppSimRandomGaussian.c \ 46 46 ppSimBadPixels.c \ 47 ppSimBadCTE.c \ 47 48 ppSimVersion.c 48 49 -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSim.h
r23352 r23594 67 67 } ppSimGalaxy; 68 68 69 ppSimStar *ppSimStarAlloc ();70 ppSimGalaxy *ppSimGalaxyAlloc ();69 ppSimStar *ppSimStarAlloc(void); 70 ppSimGalaxy *ppSimGalaxyAlloc(void); 71 71 72 72 /// Parse command-line arguments … … 135 135 136 136 137 // add a bad CTE region 138 bool ppSimBadCTE(psImage *image, // Signal image, modified and returned 139 const pmConfig *config // configuration 140 ); 141 137 142 /// Add bad pixels to an image 138 143 bool ppSimBadPixels(pmReadout *readout, ///< Readout for which to generate bad pixels … … 184 189 double ppSimRandomGaussian (const psRandom *rnd, double mean, double sigma); 185 190 double ppSimRandomGaussianNorm (const psRandom *rnd); 186 void ppSimRandomGaussianFree( );191 void ppSimRandomGaussianFree(void); 187 192 188 193 bool ppSimPhotomFiles (pmConfig *config, pmFPAfile *fakeFile, pmFPAfile *forceFile); -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoadSpots.c
r18047 r23594 57 57 58 58 // load refstars from the catalog 59 psArray *spots = psastroLoadRefstars(config );59 psArray *spots = psastroLoadRefstars(config, "PSASTRO.INPUT"); 60 60 if (!spots || spots->n == 0) { 61 61 psError(PS_ERR_UNKNOWN, false, "Unable to find reference stars."); -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoadStars.c
r20040 r23594 41 41 psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MIN", PS_DATA_F32 | PS_META_REPLACE, "", dec0 - radius); 42 42 psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MAX", PS_DATA_F32 | PS_META_REPLACE, "", dec0 + radius); 43 psArray *refStars = psastroLoadRefstars(config );43 psArray *refStars = psastroLoadRefstars(config, "PSASTRO.INPUT"); 44 44 if (!refStars) { 45 45 psError(PS_ERR_UNKNOWN, false, "Unable to find reference stars."); -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimLoop.c
r23352 r23594 154 154 done: 155 155 if (!ppSimAddNoise(readout->image, readout->variance, cell, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "problem adding noise"); 156 157 if (!ppSimBadCTE(readout->image, config)) ESCAPE (PS_ERR_UNKNOWN, "problem inducing bad cte"); 158 156 159 if (!ppSimSaturate(readout, config)) ESCAPE (PS_ERR_UNKNOWN, "problem setting saturation levels"); 157 160 -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimRandomGaussian.c
r18011 r23594 29 29 30 30 /* integrate a gaussian from -5 sigma to +5 sigma */ 31 void p_ppSimRandomGaussianInit ( ) {32 31 void p_ppSimRandomGaussianInit (void) { 32 33 33 int i; 34 34 long A, B; 35 35 double val, x, dx, dx1, dx2, dx3, df; 36 36 double mean, sigma; 37 37 38 38 /* no need to generate this if it already exists */ 39 39 if (gaussint) return; … … 42 42 for (B = 0; A == time(NULL); B++); 43 43 srand48(B); 44 44 45 45 Ngaussint = 0x1000; 46 46 ppSimRandomGaussianAlloc (Ngaussint + 1); … … 53 53 mean = 0.0; 54 54 sigma = 1.0; 55 55 56 56 for (i = 0, x = -7.0; (i < Ngaussint) && (x < 7.0); x += dx) { 57 df = (3.0*p_ppSimGaussian(x , mean, sigma) + 57 df = (3.0*p_ppSimGaussian(x , mean, sigma) + 58 58 9.0*p_ppSimGaussian(x+dx1, mean, sigma) + 59 9.0*p_ppSimGaussian(x+dx2, mean, sigma) + 59 9.0*p_ppSimGaussian(x+dx2, mean, sigma) + 60 60 3.0*p_ppSimGaussian(x+dx3, mean, sigma)) * (dx1/8.0); 61 61 val += df; … … 67 67 } 68 68 69 // XXX we are using drand48() rather than the random var supplied by rnd 69 // XXX we are using drand48() rather than the random var supplied by rnd 70 70 double ppSimRandomGaussian (const psRandom *rnd, double mean, double sigma) { 71 71 72 72 int i; 73 73 double y; 74 74 75 75 if (gaussint == NULL) { 76 76 p_ppSimRandomGaussianInit (); … … 80 80 i = Ngaussint*y; 81 81 y = gaussint[i]*sigma + mean; 82 82 83 83 return (y); 84 84 85 85 } 86 87 // XXX we are using drand48() rather than the random var supplied by rnd 86 87 // XXX we are using drand48() rather than the random var supplied by rnd 88 88 double ppSimRandomGaussianNorm (const psRandom *rnd) { 89 89 90 90 int i; 91 91 double y; 92 92 93 93 if (gaussint == NULL) { 94 94 p_ppSimRandomGaussianInit (); … … 98 98 i = Ngaussint*y; 99 99 y = gaussint[i]; 100 100 101 101 return (y); 102 102 } -
branches/cnb_branches/cnb_branch_20090301/ppSim/src/ppSimStars.c
r17557 r23594 6 6 } 7 7 8 ppSimStar *ppSimStarAlloc () {8 ppSimStar *ppSimStarAlloc(void) { 9 9 10 10 ppSimStar *star = (ppSimStar *) psAlloc(sizeof(ppSimStar)); … … 19 19 } 20 20 21 ppSimGalaxy *ppSimGalaxyAlloc () {21 ppSimGalaxy *ppSimGalaxyAlloc(void) { 22 22 23 23 ppSimGalaxy *galaxy = (ppSimGalaxy *) psAlloc(sizeof(ppSimGalaxy));
Note:
See TracChangeset
for help on using the changeset viewer.
