Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_mci_sim
Commits
90aa4e17
Commit
90aa4e17
authored
Apr 13, 2024
by
Yan Zhaojun
Browse files
test
parent
60202b16
Pipeline
#4009
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
90aa4e17
...
@@ -1252,79 +1252,8 @@ class MCIsimulator():
...
@@ -1252,79 +1252,8 @@ class MCIsimulator():
"""
"""
self
.
configfile
=
configfile
self
.
configfile
=
configfile
self
.
section
=
'TEST'
#####simulation section;
self
.
section
=
'TEST'
#####simulation section;
#load instrument model, these values are also stored in the FITS header
self
.
information
=
MCIinstrumentModel
.
MCIinformation
()
self
.
information
[
'G_filters'
]
=
[
"F275W"
,
"F280N"
,
"NUV"
,
"WU"
,
"CBU"
,
"F343N"
,
"u"
,
"F373N"
,
"F395N"
,
"F336W"
]
self
.
information
[
'R_filters'
]
=
[
"F487N"
,
"F502N"
,
"CBV"
,
"r"
,
"F656N"
,
"F658N"
,
"F467M"
,
"F555W"
,
"F606W"
,
"F673N"
]
self
.
information
[
'I_filters'
]
=
[
"z"
,
"y"
,
"F815N"
,
"CBI"
,
"F925N"
,
"F960M"
,
"F968N"
,
"F845M"
,
"F850LP"
,
"F814W"
]
#### load telescope efficiency data
print
(
self
.
information
[
'dir_path'
])
self
.
tel_eff
=
np
.
load
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/tel_eff/tel_eff.npy'
,
allow_pickle
=
True
).
item
()
#### load MCI filter data
self
.
filterP
=
np
.
load
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/MCI_filters/mci_filterPWTC.npy'
,
allow_pickle
=
True
).
item
()
###########################################################################
now
=
datetime
.
utcnow
()
#data_time=now.strftime("%Y-%m-%d-%H-%M-%S")
result_day
=
now
.
strftime
(
"%Y-%m-%d"
)
#self.result_path='../MCI_simData_'+result_day
# if os.getcwd() =='/home/zjyan/work/MCI/simulator':
# self.result_path='/data/mci_simData/'+result_day ### CSST1
# else:
# self.result_path='/home/yan/MCI/simData/'+result_day ### my PC
if
self
.
information
[
'dir_path'
]
==
'/nfsdata/share/simulation-unittest/mci_sim/'
:
self
.
result_path
=
self
.
information
[
'dir_path'
]
+
\
'mci_sim_result/'
+
result_day
else
:
home_path
=
os
.
environ
[
'HOME'
]
if
home_path
==
'/home/yan'
:
self
.
result_path
=
'../MCI_simData/'
+
self
.
source
+
ss
+
result_day
else
:
self
.
result_path
=
'/data/mcisimdata/'
+
result_day
if
os
.
path
.
isdir
(
self
.
result_path
)
==
False
:
os
.
mkdir
(
self
.
result_path
)
os
.
mkdir
(
self
.
result_path
+
'/cali_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/log_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/ori_Cali'
)
os
.
mkdir
(
self
.
result_path
+
'/ori_Sky'
)
os
.
mkdir
(
self
.
result_path
+
'/sky_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/PSF_Data'
)
#update settings with defaults
self
.
information
.
update
(
dict
(
quadrant
=
int
(
0
),
ccdx
=
int
(
0
),
ccdy
=
int
(
0
),
ccdxgap
=
1.643
,
ccdygap
=
8.116
,
xsize
=
2000
,
ysize
=
2000
,
fullwellcapacity
=
90000
,
pixel_size
=
0.05
,
dark
=
0.001
,
exptime
=
300.0
,
readouttime
=
4.
,
rdose
=
8.0e9
,
ghostCutoff
=
22.0
,
ghostRatio
=
5.e-5
,
coveringfraction
=
0.1
,
#CR:
cosmicraylengths
=
FOLDER
+
'MCI_inputData/data/cdf_cr_length.dat'
,
cosmicraydistance
=
FOLDER
+
'MCI_inputData/data/cdf_cr_total.dat'
,
parallelTrapfile
=
FOLDER
+
'MCI_inputData/data/cdm_euclid_parallel.dat'
,
serialTrapfile
=
FOLDER
+
'MCI_inputData/data/cdm_euclid_serial.dat'
,
mode
=
'same'
))
###############################################################################
###############################################################################
def
readConfigs
(
self
,
simnumber
,
source
):
def
readConfigs
(
self
,
simnumber
,
source
):
"""
"""
...
@@ -1339,21 +1268,7 @@ class MCIsimulator():
...
@@ -1339,21 +1268,7 @@ class MCIsimulator():
#self.config.readfp(open(self.configfile))
#self.config.readfp(open(self.configfile))
self
.
config
.
read_file
(
open
(
self
.
configfile
))
self
.
config
.
read_file
(
open
(
self
.
configfile
))
now
=
datetime
.
utcnow
()
data_time
=
now
.
strftime
(
"%Y-%m-%d-%H-%M-%S"
)
print
(
'simnumber'
,
simnumber
)
self
.
log
=
lg
.
setUpLogger
(
self
.
result_path
+
'/log_Data/MCIsim_'
+
source
+
'_'
+
data_time
+
'_Num_'
+
str
(
simnumber
)
+
'.log'
)
#print('logger.handlers=', self.log.handlers)
self
.
log
.
info
(
'-------STARTING A NEW SIMULATION------------'
)
self
.
log
.
info
(
'The exposure order is %i '
%
simnumber
)
#self.log.info(self.information)
################################################################################################3
################################################################################################3
...
@@ -1549,6 +1464,95 @@ class MCIsimulator():
...
@@ -1549,6 +1464,95 @@ class MCIsimulator():
self
.
_createEmpty
()
self
.
_createEmpty
()
now
=
datetime
.
utcnow
()
data_time
=
now
.
strftime
(
"%Y-%m-%d-%H-%M-%S"
)
print
(
'simnumber'
,
simnumber
)
self
.
log
=
lg
.
setUpLogger
(
self
.
result_path
+
'/log_Data/MCIsim_'
+
source
+
'_'
+
data_time
+
'_Num_'
+
str
(
simnumber
)
+
'.log'
)
#print('logger.handlers=', self.log.handlers)
self
.
log
.
info
(
'-------STARTING A NEW SIMULATION------------'
)
self
.
log
.
info
(
'The exposure order is %i '
%
simnumber
)
#load instrument model, these values are also stored in the FITS header
self
.
information
=
MCIinstrumentModel
.
MCIinformation
()
self
.
information
[
'G_filters'
]
=
[
"F275W"
,
"F280N"
,
"NUV"
,
"WU"
,
"CBU"
,
"F343N"
,
"u"
,
"F373N"
,
"F395N"
,
"F336W"
]
self
.
information
[
'R_filters'
]
=
[
"F487N"
,
"F502N"
,
"CBV"
,
"r"
,
"F656N"
,
"F658N"
,
"F467M"
,
"F555W"
,
"F606W"
,
"F673N"
]
self
.
information
[
'I_filters'
]
=
[
"z"
,
"y"
,
"F815N"
,
"CBI"
,
"F925N"
,
"F960M"
,
"F968N"
,
"F845M"
,
"F850LP"
,
"F814W"
]
#### load telescope efficiency data
print
(
self
.
information
[
'dir_path'
])
self
.
tel_eff
=
np
.
load
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/tel_eff/tel_eff.npy'
,
allow_pickle
=
True
).
item
()
#### load MCI filter data
self
.
filterP
=
np
.
load
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/MCI_filters/mci_filterPWTC.npy'
,
allow_pickle
=
True
).
item
()
###########################################################################
now
=
datetime
.
utcnow
()
#data_time=now.strftime("%Y-%m-%d-%H-%M-%S")
result_day
=
now
.
strftime
(
"%Y-%m-%d"
)
#self.result_path='../MCI_simData_'+result_day
# if os.getcwd() =='/home/zjyan/work/MCI/simulator':
# self.result_path='/data/mci_simData/'+result_day ### CSST1
# else:
# self.result_path='/home/yan/MCI/simData/'+result_day ### my PC
if
self
.
information
[
'dir_path'
]
==
'/nfsdata/share/simulation-unittest/mci_sim/'
:
self
.
result_path
=
self
.
information
[
'dir_path'
]
+
\
'mci_sim_result/'
+
result_day
else
:
home_path
=
os
.
environ
[
'HOME'
]
if
home_path
==
'/home/yan'
:
self
.
result_path
=
'../MCI_simData/'
+
self
.
source
+
ss
+
result_day
else
:
self
.
result_path
=
'/data/mcisimdata/'
+
result_day
if
os
.
path
.
isdir
(
self
.
result_path
)
==
False
:
os
.
mkdir
(
self
.
result_path
)
os
.
mkdir
(
self
.
result_path
+
'/cali_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/log_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/ori_Cali'
)
os
.
mkdir
(
self
.
result_path
+
'/ori_Sky'
)
os
.
mkdir
(
self
.
result_path
+
'/sky_Data'
)
os
.
mkdir
(
self
.
result_path
+
'/PSF_Data'
)
#update settings with defaults
self
.
information
.
update
(
dict
(
quadrant
=
int
(
0
),
ccdx
=
int
(
0
),
ccdy
=
int
(
0
),
ccdxgap
=
1.643
,
ccdygap
=
8.116
,
xsize
=
2000
,
ysize
=
2000
,
fullwellcapacity
=
90000
,
pixel_size
=
0.05
,
dark
=
0.001
,
exptime
=
300.0
,
readouttime
=
4.
,
rdose
=
8.0e9
,
ghostCutoff
=
22.0
,
ghostRatio
=
5.e-5
,
coveringfraction
=
0.1
,
#CR:
cosmicraylengths
=
FOLDER
+
'MCI_inputData/data/cdf_cr_length.dat'
,
cosmicraydistance
=
FOLDER
+
'MCI_inputData/data/cdf_cr_total.dat'
,
parallelTrapfile
=
FOLDER
+
'MCI_inputData/data/cdm_euclid_parallel.dat'
,
serialTrapfile
=
FOLDER
+
'MCI_inputData/data/cdm_euclid_serial.dat'
,
mode
=
'same'
))
self
.
log
.
info
(
'Read in the configuration files and created an empty array'
)
self
.
log
.
info
(
'Read in the configuration files and created an empty array'
)
return
return
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment