Commit 9bcac26c authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

test

parent 0b0310c4
Pipeline #4069 running with stage
in 0 seconds
......@@ -3138,15 +3138,16 @@ class MCIsimulator():
For details, see the documentation for the cosmicrays class in the support package.
"""
self.readCosmicRayInformation()
self.cr['exptime'] = self.information['exptime'] #to scale the number of cosmics with exposure time
#cosmic ray image
crImage = np.zeros((self.information['ysize'], self.information['xsize']), dtype=float)
#cosmic ray instance
cosmics_g = cosmicrays.cosmicrays(self.log, crImage, crInfo=self.cr)
cosmics_r = cosmicrays.cosmicrays(self.log, crImage, crInfo=self.cr)
cosmics_i = cosmicrays.cosmicrays(self.log, crImage, crInfo=self.cr)
cosmics_g = cosmicrays.cosmicrays(self.log, crImage, self.information['exptime'], crInfo=self.cr)
cosmics_r = cosmicrays.cosmicrays(self.log, crImage, self.information['exptime'], crInfo=self.cr)
cosmics_i = cosmicrays.cosmicrays(self.log, crImage, self.information['exptime'], crInfo=self.cr)
#add cosmic rays up to the covering fraction
#CCD_cr = cosmics.addUpToFraction(self.information['coveringFraction'], limit=None)
......
......@@ -14,22 +14,24 @@ prescan = 27
overscan = 320
#charge trap information file
parallelTrapfile=MCI_inputdata/data/cdm_euclid_parallel.dat
serialTrapfile=MCI_inputdata/data/cdm_euclid_serial.dat
parallelTrapfile=MCI_inputData/data/cdm_euclid_parallel.dat
serialTrapfile=MCI_inputData/data/cdm_euclid_serial.dat
#cosmetic defects input file
cosmeticsFile_g =MCI_inputdata/data/Cosmetics_g.txt
cosmeticsFile_g =MCI_inputData/data/Cosmetics_g.txt
cosmeticsFile_r =MCI_inputdata/data/Cosmetics_r.txt
cosmeticsFile_r =MCI_inputData/data/Cosmetics_r.txt
cosmeticsFile_i =MCI_inputdata/data/Cosmetics_i.txt
cosmeticsFile_i =MCI_inputData/data/Cosmetics_i.txt
###comicray information file
cosmicraylengths=MCI_inputdata/data/cdf_cr_length.dat
cosmicraylengths=MCI_inputData/data/cdf_cr_length.dat
cosmicraydistance=MCI_inputdata/data/cdf_cr_total.dat
cosmicraydistance=MCI_inputData/data/cdf_cr_total.dat
......
......@@ -31,7 +31,7 @@ class cosmicrays():
:param information: cosmic ray track information (file containing track length and energy information) and
exposure time.
"""
def __init__(self, log, image, crInfo=None, information=None):
def __init__(self, log, image, exptime, crInfo=None, information=None):
"""
Cosmic ray generation class. Can either draw events from distributions or
set the energy of the events to a constant.
......@@ -43,6 +43,9 @@ class cosmicrays():
exposure time.
"""
#setup logger
self.exptime=exptime
self.log = log
#image and size
......@@ -53,8 +56,8 @@ class cosmicrays():
# self.information = (dict(cosmicraylengths='/home/yan/csst-master/data/cdf_cr_length.dat',
# cosmicraydistance='/home/yan/csst-master/data/cdf_cr_total.dat',
# exptime=565))
if information is not None:
self.information.update(information)
# if information is not None:
# self.information.update(information)
if crInfo is not None:
self.cr = crInfo
......@@ -321,7 +324,7 @@ class cosmicrays():
self.cosmicrayMap = np.zeros((self.ysize, self.xsize))
#how many events to draw at once, too large number leads to exceeding the covering fraction
cr_n = int(295 * self.information['exptime'] / 565. * coveringFraction / 1.4)
cr_n = int(295 * self.exptime / 565. * coveringFraction / 1.4)
covering = 0.0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment