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
a5945932
Commit
a5945932
authored
Apr 15, 2024
by
Yan Zhaojun
Browse files
debug
parent
2e0af30e
Pipeline
#4076
passed with stage
in 0 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_mci_sim/CTI/__pycache__/CTI.cpython-311.pyc
View file @
a5945932
No preview for this file type
csst_mci_sim/__pycache__/csst_mci_sim.cpython-311.pyc
View file @
a5945932
No preview for this file type
csst_mci_sim/csst_mci_sim.py
View file @
a5945932
...
...
@@ -397,44 +397,7 @@ class StrayLight(object):
return
max
(
band_earth_e1
,
band_earth_e2
)
###############################################################################
####################################################################################
def
processArgs
(
printHelp
=
False
):
"""
Processes command line arguments.
"""
parser
=
OptionParser
()
parser
.
add_option
(
'-c'
,
'--configfile'
,
dest
=
'configfile'
,
help
=
"Name of the configuration file"
,
metavar
=
"string"
)
parser
.
add_option
(
'-s'
,
'--section'
,
dest
=
'section'
,
help
=
"Name of the section of the config file [SCIENCE]"
,
metavar
=
"string"
)
parser
.
add_option
(
'-q'
,
'--quadrant'
,
dest
=
'quadrant'
,
help
=
'CCD quadrant to simulate [0, 1, 2, 3]'
,
metavar
=
'int'
)
parser
.
add_option
(
'-x'
,
'--xCCD'
,
dest
=
'xCCD'
,
help
=
'CCD number in X-direction within the FPA matrix'
,
metavar
=
'int'
)
parser
.
add_option
(
'-y'
,
'--yCCD'
,
dest
=
'yCCD'
,
help
=
'CCD number in Y-direction within the FPA matrix'
,
metavar
=
'int'
)
parser
.
add_option
(
'-d'
,
'--debug'
,
dest
=
'debug'
,
action
=
'store_true'
,
help
=
'Debugging mode on'
)
parser
.
add_option
(
'-t'
,
'--test'
,
dest
=
'test'
,
action
=
'store_true'
,
help
=
'Run unittest'
)
parser
.
add_option
(
'-f'
,
'--fixed'
,
dest
=
'fixed'
,
help
=
'Use a fixed seed for the random number generators'
,
metavar
=
'int'
)
if
printHelp
:
parser
.
print_help
()
else
:
return
parser
.
parse_args
()
###############################################################################
###############################################################################
def
make_c_coor
(
fov
,
step
):
...
...
@@ -1447,7 +1410,7 @@ class MCIsimulator():
if
home_path
==
'/home/yan'
:
self
.
result_path
=
'../MCI_sim
Data
/'
+
self
.
source
+
ss
+
result_day
self
.
result_path
=
'../MCI_sim
Result
/'
+
self
.
source
+
"_"
+
result_day
else
:
self
.
result_path
=
'/data/mcisimdata/'
+
result_day
...
...
@@ -1713,32 +1676,33 @@ class MCIsimulator():
theta
=
rotTelPos
-
rotSkyPos
############ load star data catlog #####################
##
starcat='selection_20230517_concat.csv'
starcat
=
'selection_
MACSJ0744.9 3927_
20230517_concat.csv'
starcat
=
'selection_20230517_concat.fits'
##starcat='GaiaSource_675688-675713.csv'
##starcat='selection_20230517_concat.fits'
###################################################
self
.
log
.
info
(
'Stat catlog file name is %s'
%
(
starcat
))
da
=
fits
.
open
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/star_input/'
+
starcat
)
####da=fits.open(starcat)
df2
=
da
[
1
].
data
#
###
######################################################################
#
da=fits.open(self.information['dir_path']+'MCI_inputData/star_input/'+starcat)
#df2
.index = range(len(df2))
#
# limit the filed of view to 600*600 arcsec^2 square zone;
#
df2
=da[1].data
#
del da
##########################################
df2
=
pandas
.
read_csv
(
self
.
information
[
'dir_path'
]
+
'MCI_inputData/star_input/'
+
starcat
)
df3
=
df2
[
(
abs
(
df2
[
'ra_gaia'
]
-
df2
[
'ra_gaia'
].
mean
())
<
400
/
3600.0
)
&
(
abs
(
df2
[
'dec_gaia'
]
-
df2
[
'dec_gaia'
].
mean
())
<
400
/
3600.0
)
]
df3
.
index
=
range
(
len
(
df3
))
###################################################
# np.save('umag.npy', df3['umag'] )
self
.
star
=
df3
del
da
,
df2
,
df3
del
df2
,
df3
self
.
information
[
'ra_obj'
]
=
self
.
star
[
'ra_gaia'
].
mean
()
self
.
information
[
'dec_obj'
]
=
self
.
star
[
'dec_gaia'
].
mean
()
...
...
@@ -2218,7 +2182,7 @@ class MCIsimulator():
st_magz
.
append
(
zmag
)
self
.
log
.
info
(
'begin cal PSF'
)
##
self.log.info('begin cal PSF')
######################################################################
psf
=
dict
()
...
...
@@ -2252,11 +2216,11 @@ class MCIsimulator():
stamp_img
.
setOrigin
(
0
,
0
)
stamp_img
.
scale
=
0.025
self
.
log
.
info
(
'begining galsim.PhotonArray.makeFromImage'
)
#
self.log.info('begining galsim.PhotonArray.makeFromImage')
self
.
log
.
info
(
'stamp_img.array.max()= %i'
%
(
stamp_img
.
array
.
max
()))
#
self.log.info('stamp_img.array.max()= %i' % (stamp_img.array.max()))
print
(
'stamp_img.array.max(): '
,
stamp_img
.
array
.
max
()
)
###
print('stamp_img.array.max(): ', stamp_img.array.max() )
#################################################
...
...
@@ -5438,11 +5402,11 @@ class MCIsimulator():
print
(
'applyPRNUeffect'
)
####################################################################
#
if self.source in sourcelist:
#
if self.cosmicRays:
#
# if self.debug == False:
#
self.addCosmicRays()
#
print('addCosmicRays finisth')
if
self
.
source
in
sourcelist
:
if
self
.
cosmicRays
:
# if self.debug == False:
self
.
addCosmicRays
()
print
(
'addCosmicRays finisth'
)
##################################################
if
self
.
skyback
:
...
...
@@ -5463,23 +5427,20 @@ class MCIsimulator():
#################################################
#
if self.bleeding:
#
# if self.debug== False:
#
self.image_g=self.applyBleeding(self.image_g.copy())
#
self.image_r=self.applyBleeding(self.image_r.copy())
#
self.image_i=self.applyBleeding(self.image_i.copy())
#
print('apply bleeding effect finisth')
if
self
.
bleeding
:
# if self.debug== False:
self
.
image_g
=
self
.
applyBleeding
(
self
.
image_g
.
copy
())
self
.
image_r
=
self
.
applyBleeding
(
self
.
image_r
.
copy
())
self
.
image_i
=
self
.
applyBleeding
(
self
.
image_i
.
copy
())
print
(
'apply bleeding effect finisth'
)
#
################################################
################################################
#
if self.nonlinearity:
#
self.applyNonlinearity()
#
print('applyNonlinearity')
if
self
.
nonlinearity
:
self
.
applyNonlinearity
()
print
(
'applyNonlinearity'
)
# ################################################
#### read CCD image to output matrix as defined
...
...
csst_mci_sim/mci_so/__pycache__/__init__.cpython-311.pyc
0 → 100644
View file @
a5945932
File added
csst_mci_sim/support/MCIinstrumentModel.py
View file @
a5945932
...
...
@@ -64,5 +64,5 @@ def CCDnonLinearityModel(data, beta=6e-7):
return
out
###################################################################
if
__name__
==
'__main__'
:
print
()
#
if __name__ == '__main__':
#
print()
csst_mci_sim/support/__pycache__/cosmicrays.cpython-311.pyc
View file @
a5945932
No preview for this file type
csst_mci_sim/support/__pycache__/sed.cpython-311.pyc
View file @
a5945932
No preview for this file type
csst_mci_sim/support/__pycache__/shao.cpython-311.pyc
View file @
a5945932
No preview for this file type
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