diff --git a/ObservationSim/Instrument/Chip/Effects.py b/ObservationSim/Instrument/Chip/Effects.py index c289abc0e6da213b703e9363997f195ef2bbc15f..7a6b7a667c15e5ff8bf5d740e63476cd597531d0 100644 --- a/ObservationSim/Instrument/Chip/Effects.py +++ b/ObservationSim/Instrument/Chip/Effects.py @@ -613,11 +613,11 @@ def selectCosmicRayCollection(attachedSizes, xLen, yLen,cr_pixelRatio,CR_max_siz return CRs[0:cr_event_num]; -def defineEnergyForCR(cr_event_size): +def defineEnergyForCR(cr_event_size,seed = 12345): import random sigma = 0.6 / 2.355; mean = 3.3; - + random.seed(seed) energys = np.zeros(cr_event_size); for i in np.arange(cr_event_size): energy_index = random.normalvariate(mean,sigma); @@ -677,7 +677,7 @@ def produceCR_Map(xLen, yLen, exTime, cr_pixelRatio, gain, attachedSizes, seed=2 cr_size = selectCosmicRayCollection(attachedSizes, xLen, yLen, cr_pixelRatio, CR_max_size); cr_event_size = cr_size.shape[0]; - cr_energys = defineEnergyForCR(cr_event_size); + cr_energys = defineEnergyForCR(cr_event_size,seed = seed); CRmap = np.zeros([yLen, xLen]); diff --git a/requirements.txt b/requirements.txt index 12b61a25ad92dc287b5f8d10e1a44370689e6895..6128cf4f1b8656da6e29ef0bd3de57c6268cadf8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ astropy==6.0.1 scipy==1.11.4 GalSim==2.5.2 PyYAML==6.0.1 -mpi4py==3.1.6 sep==1.2.1 healpy==1.16.6 h5py==3.11.0