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

update

parent 42f74827
Pipeline #7769 failed with stage
in 0 seconds
......@@ -30,6 +30,8 @@ from scipy.interpolate import interp1d
import astropy.coordinates as coord
import ctypes
import sys
from . import __version__
# sys.path.append('./csst_ifs_sim')
conf.auto_max_age = None
......@@ -313,21 +315,6 @@ def IFSinformation():
'st': 5.0e-6, 'sfwc': 730000., 'svg': 1.0e-10})
return out
def CCDnonLinearityModel(data, beta=6e-7):
"""
The non-linearity is modelled based on the results presented.
:param data: data to which the non-linearity model is being applied to
:type data: ndarray
:return: input data after conversion with the non-linearity model
:rtype: float or ndarray
"""
out = data-beta*data**2
return out
#
#
#############################################################################
......@@ -504,7 +491,7 @@ class cosmicrays():
return crImage
def _drawEventsToCoveringFactor(self, coveringFraction=3.0, limit=1000, verbose=False):
def _drawEventsToCoveringFactor(self, coveringFraction=0.5, limit=1000, verbose=False):
"""
Generate cosmic ray events up to a covering fraction and include it to a cosmic ray map (self.cosmicrayMap).
......@@ -2587,18 +2574,31 @@ class IFSsimulator():
"""
self.log.debug('Starting to apply non-linearity model...')
self.image_b = CCDnonLinearityModel(
self.image_b = self.CCDnonLinearityModel(
self.image_b.copy())
self.log.info('Non-linearity effects included.')
self.log.debug('Starting to apply non-linearity model...')
self.image_r = CCDnonLinearityModel(
self.image_r = self.CCDnonLinearityModel(
self.image_r.copy())
self.log.info('Non-linearity effects included.')
######################################################################
######################################################################
def CCDnonLinearityModel(self, data, beta=6e-7):
"""
The non-linearity is modelled based on the results presented.
:param data: data to which the non-linearity model is being applied to
:type data: ndarray
:return: input data after conversion with the non-linearity model
:rtype: float or ndarray
"""
val = self.information['fullwellcapacity']
data[data < val] = data[data < val]-beta*data[data < val]**2
return data
##########################################################################
def applyReadoutNoise(self):
"""
......@@ -3454,7 +3454,7 @@ class IFSsimulator():
'ICRS', 'coordinate system of the object')
ofd_b.header['EQUINOX'] = (float(2000.0), '')
ofd_b.header['FITSSWV'] = (
'csst_ifs_sim_3.0.1', 'FITS creating software version')
__version__, 'FITS creating software version')
# ######## Object information #############
if self.source == 'SCI' or self.source == 'COMP':
ofd_b.header['OBJECT'] = (
......@@ -3821,7 +3821,7 @@ class IFSsimulator():
ofd_r.header['EQUINOX'] = (float(2000.0), '')
ofd_r.header['FITSSWV'] = (
'csst_ifs_sim_3.0.1', 'FITS creating software version')
__version__, 'FITS creating software version')
# ######## Object information #############
if self.source == 'SCI' or self.source == 'COMP':
......@@ -5936,15 +5936,15 @@ class IFSsimulator():
if self.radiationDamage:
self.applyRadiationDamage()
print('Applying radiationDamage finished.......')
print('Applying radiationDamage finished.......')
if self.readoutNoise:
self.applyReadoutNoise()
print('Applying readoutNoise finished.......')
print('Applying readoutNoise finished.......')
if self.information['exptime'] > 0.09216:
self.appFrameTransferEffect()
print('Applying Frame Transfer Effect finished.......')
print('Applying Frame Transfer Effect finished.......')
self.electrons2ADU()
......
[TEST]
#qudrant [0,1,2,3], CCDx/y [0,1,2,3,4,5], and CCDxgap/ygap in mm
quadrant = 0
CCDx = 0
CCDy = 0
CCDxgap = 1.643
CCDygap = 8.116
sky_fitsin =IFS_inputdata/FengshuaiData/NGC6397_S6102.fits
debug =yes
### simulation software version
sim_ver=90
#size of the output image array
bluesize = 4000
redsize = 6000
prescan =50
overscan =320
#CCD properties
fullwellcapacity = 90000
#dark noise in electrons per second
dark = 0.0008333
dark1_b=0.0008
dark2_b=0.00085
dark3_b=0.00088
dark4_b=0.00083
dark1_r=0.00081
dark2_r=0.00084
dark3_r=0.00086
dark4_r=0.00085
#readout noise in electrons [default=4.5]
readout = 4.0
rn1_b=4.0
rn2_b=3.5
rn3_b=4.5
rn4_b=4.8
rn1_r=4.0
rn2_r=3.9
rn3_r=4.8
rn4_r=4.9
#bias level to add in electrons [default=1000]
bias = 500.0
bias1_b=500
bias2_b=525
bias3_b=485
bias4_b=515
bias1_r=510
bias2_r=515
bias3_r=495
bias4_r=512
#background in photoelectrons per second
background = yes
#electron/ADU conversion factor
gain1_b=1.51
gain2_b=1.58
gain3_b=1.48
gain4_b=1.55
gain1_r=1.52
gain2_r=1.55
gain3_r=1.49
gain4_r=1.53
#exposure to simulate, exposure time and position on the sky (in degrees)
exptime = 1200.0
exposuretimes=3
##############################################
#radiation dosage at end of mission for CTI (at 10MeV protons)
rdose = 8.0e9
#charge trap information file
parallelTrapfile =IFS_inputdata/cdm_euclid_parallel.dat
serialTrapfile =IFS_inputdata/cdm_euclid_serial.dat
#cosmetic defects input file
cosmeticsFile_b =IFS_inputdata/Cosmetics_b.txt
cosmeticsFile_r =IFS_inputdata/Cosmetics_r.txt
###comicray information file
cosmicraylengths=IFS_inputdata/cdf_cr_length.dat
cosmicraydistance=IFS_inputdata/cdf_cr_total.dat
#apply multiplicative flatfield (to emulate pixel-to-pixel non-uniformity)?
flatfieldM = yes
sigma=0.01
#Control flags (can be yes/no, true/false, 1/0)
#add noise?
darknoise = yes
#add sky noise?
sky_noise=yes
#apply cosmetic defects?
cosmetics = yes
#apply radiation damage model?
radiationDamage = yes
#add cosmic rays?
cosmicRays = yes
coveringFraction=0.1
#apply bleeding effect?
bleeding = yes
#apply non-linearity model?
nonlinearity = yes
#readout Noise
readoutnoise=yes
#save cosmicrays map
save_cosmicrays=no
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