Changeset 26900
- Timestamp:
- Feb 10, 2010, 7:42:33 PM (16 years ago)
- Location:
- trunk/ppSim/src
- Files:
-
- 10 edited
- 1 copied
-
Makefile.am (modified) (3 diffs)
-
ppSim.h (modified) (1 diff)
-
ppSimAddNoise.c (modified) (1 diff)
-
ppSimInsertStars.c (modified) (2 diffs)
-
ppSimLoop.c (modified) (1 diff)
-
ppSimMakeStarGrid.c (copied) (copied from branches/eam_branches/20091201/ppSim/src/ppSimMakeStarGrid.c )
-
ppSimPhotom.c (modified) (2 diffs)
-
ppSimPhotomReadout.c (modified) (3 diffs)
-
ppSimPhotomReadoutFake.c (modified) (5 diffs)
-
ppSimPhotomReadoutForce.c (modified) (3 diffs)
-
ppSimSetPSF.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/Makefile.am
r23808 r26900 30 30 ppSimLoadStars.c \ 31 31 ppSimMakeStars.c \ 32 ppSimMakeStarGrid.c \ 32 33 ppSimMakeGalaxies.c \ 33 34 ppSimMakeBiassec.c \ … … 47 48 ppSimLoadSpots.c \ 48 49 ppSimPhotom.c \ 49 ppSimPhotomReadoutFake.c \50 ppSimPhotomReadoutForce.c \51 50 ppSimPhotomFiles.c \ 52 51 ppSimLoadForceSources.c \ … … 59 58 ppSimBadCTE.c \ 60 59 ppSimVersion.c 60 61 # these functions have been broken by the API change in psphot (Jan 2010) 62 # ppSimPhotomReadoutFake.c 63 # ppSimPhotomReadoutForce.c 61 64 62 65 ppSimSequence_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS) -
trunk/ppSim/src/ppSim.h
r23836 r26900 103 103 bool ppSimLoadStars (psArray *stars, pmFPA *fpa, pmConfig *config); 104 104 bool ppSimMakeStars(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng); 105 bool ppSimMakeStarGrid(psArray *stars, pmFPA *fpa, pmConfig *config, const psRandom *rng); 105 106 bool ppSimInsertStars (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config); 106 107 -
trunk/ppSim/src/ppSimAddNoise.c
r18011 r26900 16 16 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe 17 17 18 float gain = psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); // CCD gain, e/ADU 18 // the recipe should set GAIN to NAN, and only modify to override the concept value 19 float gain = psMetadataLookupF32(&mdok, recipe, "GAIN"); // CCD gain, e/ADU 19 20 if (isnan(gain)) { 20 psWarning("CELL.GAIN is not set; reverting to recipe value GAIN."); 21 gain = psMetadataLookupF32(&mdok, recipe, "GAIN"); 21 gain = psMetadataLookupF32(&mdok, cell->concepts, "CELL.GAIN"); 22 22 if (!mdok) { 23 ps Error(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find GAIN in recipe.");24 return false;23 psWarning("CELL.GAIN is not set; assuming gain of 1.0."); 24 gain = 1.0; 25 25 } 26 26 } -
trunk/ppSim/src/ppSimInsertStars.c
r21365 r26900 26 26 float expTime = psMetadataLookupF32(NULL, recipe, "EXPTIME"); // Exposure time 27 27 float darkRate = psMetadataLookupF32(NULL, recipe, "DARK.RATE"); // Dark rate 28 float nSigmaLim = psMetadataLookupF32(NULL, recipe, "STARS.SIGMA.LIM"); // significance of faintest stars 28 29 29 30 float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e … … 106 107 pmModelSetFlux (model, flux); 107 108 108 // XXX let the flux limit be a user-defined number of sky sigmas (not just 1.0) 109 float radius = model->modelRadius (model->params, roughNoise); 109 float radius = model->modelRadius (model->params, nSigmaLim * roughNoise); 110 110 radius = PS_MAX (radius, 1.0); 111 111 -
trunk/ppSim/src/ppSimLoop.c
r25760 r26900 47 47 // Add random stars 48 48 if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars"); 49 50 // Add random stars 51 if (!ppSimMakeStarGrid (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars"); 49 52 50 53 // Add random galaxies -
trunk/ppSim/src/ppSimPhotom.c
r21183 r26900 46 46 if (! readout->data_exists) { continue; } 47 47 48 // these are broken by the Jan 2010 API changes to psphot 49 #if 0 48 50 // run the actual photometry analysis 49 51 if (!ppSimPhotomReadoutFake (config, view)) { … … 56 58 } 57 59 // ppSimDetectionLimits (config, view); 60 #endif 58 61 } 59 62 } -
trunk/ppSim/src/ppSimPhotomReadout.c
r21183 r26900 39 39 # if 0 40 40 // set the photcode for this image 41 if (!psphotAddPhotcode (recipe, config, view, "PPSIM.CHIP")) {41 if (!psphotAddPhotcodeReadout (recipe, config, view, "PPSIM.CHIP", 0)) { 42 42 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 43 43 return false; … … 74 74 75 75 // Generate the mask and weight images, including the user-defined analysis region of interest 76 psphotSetMaskAndWeight (config, readout, recipe);76 psphotSetMaskAndWeight (config, view, recipe); 77 77 78 78 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved in the recipe … … 85 85 86 86 // generate a background model (median, smoothed image) 87 if (!psphotModelBackground (config, view, "PPSIM.CHIP")) {87 if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.CHIP", 0)) { 88 88 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 89 89 } 90 if (!psphotSubtractBackground (config, view, "PPSIM.CHIP")) {90 if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.CHIP", 0)) { 91 91 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 92 92 } -
trunk/ppSim/src/ppSimPhotomReadoutFake.c
r21365 r26900 1 1 # include "ppSim.h" 2 2 3 // XXX this function is currently disabled -- need to update code below to distinguish the fake 4 // and force positions, etc 3 5 bool ppSimPhotomReadoutFake(pmConfig *config, const pmFPAview *view) { 4 6 … … 11 13 return false; 12 14 } 13 14 # if 015 // set the photcode for this image16 if (!psphotAddPhotcode (recipe, config, view, "PPSIM.FAKE.CHIP")) {17 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");18 return false;19 }20 # endif21 15 22 16 // *** in this section, perform the photometry for real + fake sources on PPSIM.FAKE.CHIP *** … … 36 30 37 31 // Generate the mask and variance images, including the user-defined analysis region of interest 38 psphotSetMaskAndVariance (config, readout, recipe);32 psphotSetMaskAndVariance (config, view); 39 33 40 34 // XXX need to define the source pixels … … 58 52 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved in the recipe 59 53 // this function uses PSPHOT.PSF.LOAD as the pmFPAfile 60 pmPSF *psf = psphotLoadPSF (config, view, recipe); 61 assert (psf); 54 psphotLoadPSF (config, view); 62 55 63 56 // remove all sources … … 65 58 66 59 // generate a background model (median, smoothed image) 67 if (!psphotModelBackground (config, view, "PPSIM.FAKE.CHIP")) {60 if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.FAKE.CHIP", 0)) { 68 61 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 69 62 } 70 if (!psphotSubtractBackground (config, view, "PPSIM.FAKE.CHIP")) {63 if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.FAKE.CHIP", 0, recipe)) { 71 64 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 72 65 } -
trunk/ppSim/src/ppSimPhotomReadoutForce.c
r21365 r26900 14 14 # if 0 15 15 // set the photcode for this image 16 if (!psphotAddPhotcode (recipe, config, view, "PPSIM.FAKE.CHIP")) {16 if (!psphotAddPhotcodeReadout (recipe, config, view, "PPSIM.FAKE.CHIP", 0)) { 17 17 psError (PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 18 18 return false; … … 36 36 37 37 // Generate the mask and variance images, including the user-defined analysis region of interest 38 psphotSetMaskAndVariance (config, readout, recipe);38 psphotSetMaskAndVariance (config, view, recipe); 39 39 40 40 // XXX need to define the source pixels … … 58 58 59 59 // generate a background model (median, smoothed image) 60 if (!psphotModelBackground (config, view, "PPSIM.FORCE.CHIP")) {60 if (!psphotModelBackgroundReadoutFileIndex (config, view, "PPSIM.FORCE.CHIP", 0)) { 61 61 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 62 62 } 63 if (!psphotSubtractBackground (config, view, "PPSIM.FORCE.CHIP")) {63 if (!psphotSubtractBackgroundReadout (config, view, "PPSIM.FORCE.CHIP", 0)) { 64 64 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL); 65 65 } -
trunk/ppSim/src/ppSimSetPSF.c
r18011 r26900 20 20 // ppSimArguments) 21 21 float seeing = psMetadataLookupF32(&status, recipe, "SEEING"); // Seeing SIGMA (pixels) 22 float aRatio = psMetadataLookupF32(&status, recipe, "PSF.ARATIO"); // Seeing SIGMA (pixels) 23 float theta = psMetadataLookupF32(&status, recipe, "PSF.THETA"); // Seeing SIGMA (pixels) 22 24 23 25 char *psfModelName = psMetadataLookupStr(&status, recipe, "PSF.MODEL"); // Name of PSF model … … 55 57 // supply the semi-major axis (these are SIGMA values in PIXELS) 56 58 axes.major = seeing; 57 axes.minor = seeing;58 axes.theta = 0.0;59 axes.minor = aRatio * seeing; 60 axes.theta = theta * PS_RAD_DEG; 59 61 60 62 pol = psEllipseAxesToPol (axes);
Note:
See TracChangeset
for help on using the changeset viewer.
