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_msc_sim
Commits
cf825da1
Commit
cf825da1
authored
Dec 09, 2025
by
Fang Yuedong
Browse files
Merge branch 'master' into 'release_v3.0'
release_v3.3.1 See merge request
!37
parents
31c306af
53dc436c
Changes
9
Hide whitespace changes
Inline
Side-by-side
catalog/C10_Catalog.py
View file @
cf825da1
...
...
@@ -311,7 +311,8 @@ class Catalog(CatalogBase):
param
[
'bulgemass'
]
=
gals
[
'bulgemass'
][
igals
]
param
[
'diskmass'
]
=
gals
[
'diskmass'
][
igals
]
param
[
'size'
]
=
gals
[
'size'
][
igals
]
np
.
random
.
seed
(
int
(
pix_id
)
+
cat_id
+
igals
)
param
[
'size'
]
=
(
gals
[
'size'
][
igals
]
*
((
1.
+
gals
[
'redshift'
][
igals
])
**
(
0.4
)))
*
np
.
random
.
uniform
(
0.7
,
1.3
)
if
param
[
'size'
]
>
self
.
max_size
:
self
.
max_size
=
param
[
'size'
]
...
...
observation_sim/config/ChipOutput.py
View file @
cf825da1
...
...
@@ -73,7 +73,7 @@ class ChipOutput(object):
self
.
hdr
+=
additional_column_names
def
create_output_file
(
self
):
if
self
.
pointing_type
==
'WIDE'
or
self
.
pointing_type
==
'DEEP'
:
if
self
.
pointing_type
==
'WIDE'
or
self
.
pointing_type
==
'DEEP'
or
self
.
pointing_type
==
'CALF'
or
self
.
pointing_type
==
'CALSP'
or
self
.
pointing_type
==
'CALSS'
:
self
.
cat
=
open
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
),
"w"
)
self
.
logger
.
info
(
"Creating catalog file %s ...
\n
"
%
(
os
.
path
.
join
(
self
.
subdir
,
self
.
cat_name
)))
...
...
observation_sim/config/header/ImageHeader.py
View file @
cf825da1
...
...
@@ -556,6 +556,10 @@ def generateExtensionHeader(chip, xlen=9216, ylen=9232, ra=60, dec=-40, pa=-23.4
h_ext
[
'GAIN14'
]
=
chip
.
gain_channel
[
13
]
h_ext
[
'GAIN15'
]
=
chip
.
gain_channel
[
14
]
h_ext
[
'GAIN16'
]
=
chip
.
gain_channel
[
15
]
h_ext
[
'PSCAN1'
]
=
chip
.
prescan_x
h_ext
[
'PSCAN2'
]
=
chip
.
prescan_y
h_ext
[
'OSCAN1'
]
=
chip
.
overscan_x
h_ext
[
'OSCAN2'
]
=
chip
.
overscan_y
h_ext
[
'RON01'
]
=
readout
h_ext
[
'RON02'
]
=
readout
h_ext
[
'RON03'
]
=
readout
...
...
observation_sim/instruments/data/sls_conf/CSST_GU2.conf
View file @
cf825da1
...
...
@@ -36,7 +36,7 @@ MMAG_MARK_B 30
# Trace description
#
DYDX_ORDER_B
0
DYDX_B_0
82
.
917
82550095
61
6
-
0
.
01745
0074030956903
-
0
.
00034211980919903514
-
5
.
2
29479577962483
e
-
10
6
.
618188334096981
e
-
10
4
.
5712407536340074
e
-
11
DYDX_B_0
82
.
917
42083784
61
1
-
0
.
01745
12487471819
-
0
.
00034120894910458606
-
1
.
2
98330068637783
e
-
10
4
.
340249496308753
e
-
10
1
.
0373044457577981
e
-
11
#
# X and Y Offsets
#
...
...
@@ -46,8 +46,8 @@ YOFF_B 0.0
# Dispersion solution
#
DISP_ORDER_B
1
DLDP_B_0
7763276
.
642055119
-
20266
.
736198394356
1255
.
309384604854
5
.
066171367500259
1
.
2647000472616756
-
0
.
25632575767112603
DLDP_B_1
-
143465
.
8971715863
684
.
9306681233783
-
157
.
3534822656011
-
0
.
2303808137854618
0
.
03539958163679847
0
.
005924035996712881
DLDP_B_0
448897
.
8581289202
-
69
.
05924554341267
-
200
.
37444114671905
0
.
04003968509481386
-
0
.
027512617424472103
5
.
068370683947331
e
-
05
DLDP_B_1
10160
.
6234805349
4
.
430359702933667
0
.
09374704569926708
-
0
.
000854410958383644
-
2
.
8642365418529523
e
-
05
-
2
.
659603621537505
e
-
06
#
SENSITIVITY_B
GU2
.
Throughput
.
0
st
.
fits
#
...
...
observation_sim/instruments/data/sls_conf/CSST_GU4.conf
View file @
cf825da1
...
...
@@ -36,7 +36,7 @@ MMAG_MARK_B 30
# Trace description
#
DYDX_ORDER_B
0
DYDX_B_0
80
.
9
1986075321823
-
0
.
01744761042150647
-
0
.
0003580191107231064
-
2
.
627009138987314
e
-
10
-
6
.
375179298238856
e
-
10
2
.
763897714355112
e
-
09
DYDX_B_0
80
.
9
3796454255751
-
0
.
017461724678154614
-
0
.
00035745607061872265
1
.
586088715327381
e
-
09
2
.
83632657494108
e
-
10
2
.
4337528594084163
e
-
09
#
# X and Y Offsets
#
...
...
@@ -46,8 +46,8 @@ YOFF_B 0.0
# Dispersion solution
#
DISP_ORDER_B
1
DLDP_B_0
5
2318605
.
038736925
-
49905
.
61041920374
-
325
.
3071290800653
11
.
683982888283492
-
0
.
734011022951611
0
.
0798352458204433
DLDP_B_1
-
1489154
.
0375472226
1428
.
4941310271706
32
.
346965719777806
-
0
.
3034273708620226
-
0
.
01153922199462758
-
0
.
0009324181582693394
DLDP_B_0
5
60974
.
2568255321
4
.
836837898676734
-
270
.
2027083117478
0
.
00017749467347293046
-
3
.
42705736301515
e
-
05
-
2
.
4253188230594427
e
-
06
DLDP_B_1
15499
.
999999924863
8
.
661894315733124
e
-
11
5
.
382306809541636
e
-
12
-
1
.
7061292984259495
e
-
14
-
6
.
679353210055169
e
-
15
1
.
0401633823282333
e
-
15
#
SENSITIVITY_B
GU4
.
Throughput
.
0
st
.
fits
#
...
...
observation_sim/sim_steps/readout_output.py
View file @
cf825da1
...
...
@@ -20,7 +20,7 @@ def add_prescan_overscan(self, chip, filt, tel, pointing, catalog, obs_param):
if
obs_param
[
"add_dark"
]
is
True
:
ny
=
int
(
chip
.
npix_y
/
2
)
base_dark
=
(
ny
-
1
)
*
(
chip
.
readout_time
/
ny
)
*
chip
.
dark_noise
chip
.
img
.
array
[(
chip
.
prescan_y
+
ny
):
-
(
chip
.
prescan_y
+
ny
),
:]
=
base_dark
chip
.
img
.
array
[(
chip
.
prescan_y
+
ny
):
-
(
chip
.
prescan_y
+
ny
),
:]
+
=
base_dark
return
chip
,
filt
,
tel
,
pointing
...
...
setup.py
View file @
cf825da1
...
...
@@ -76,7 +76,7 @@ with open("requirements.txt", "r") as f:
]
setup
(
name
=
'csst_msc_sim'
,
version
=
'3.3.
0
'
,
version
=
'3.3.
1
'
,
packages
=
find_packages
(),
# install_requires=[
# # 'numpy>=1.18.5',
...
...
tools/get_pointing_accuracy.py
View file @
cf825da1
...
...
@@ -130,7 +130,7 @@ def cal_FoVcenter_1P_ecliptic(lon_ecl_FieldCenter, lat_ecl_FieldCenter, chipID=1
return
ra_PointCenter
,
dec_PointCenter
,
lon_ecl_PointCenter
,
lat_ecl_PointCenter
def
getChipCenterRaDec
(
chipID
=
1
,
p_ra
=
60.
,
p_dec
=-
40.
):
def
getChipCenterRaDec
(
chipID
=
1
,
p_ra
=
60.
,
p_dec
=-
40.
,
pa
=
23.5
):
chip
=
Chip
(
chipID
)
h_ext
=
ImageHeader
.
generateExtensionHeader
(
...
...
tools/imgCropping.py
0 → 100644
View file @
cf825da1
import
os
import
sys
import
numpy
as
np
from
astropy.io
import
fits
PRESCAN_X
,
IMAGE_X
,
OVERSCAN_X
=
27
,
1152
,
71
PRESCAN_Y
,
IMAGE_Y
,
OVERSCAN_Y
=
0
,
4616
,
84
BLOCK_WIDTH
=
PRESCAN_X
+
IMAGE_X
+
OVERSCAN_X
def
process_single_file
(
filename
):
with
fits
.
open
(
filename
)
as
hdul
:
data
=
hdul
[
1
].
data
data
=
data
[
PRESCAN_Y
:
PRESCAN_Y
+
IMAGE_Y
,
:]
blocks
=
[
data
[:,
i
*
BLOCK_WIDTH
+
PRESCAN_X
:(
i
+
1
)
*
BLOCK_WIDTH
-
OVERSCAN_X
]
for
i
in
range
(
16
)]
blocks_a
=
np
.
concatenate
(
blocks
[:
4
],
axis
=
1
)
blocks_b
=
np
.
concatenate
([
np
.
fliplr
(
b
)
for
b
in
blocks
[
4
:
8
]],
axis
=
1
)
blocks_c
=
np
.
concatenate
([
np
.
flipud
(
np
.
fliplr
(
b
))
for
b
in
blocks
[
11
:
7
:
-
1
]],
axis
=
1
)
blocks_d
=
np
.
concatenate
([
np
.
flipud
(
b
)
for
b
in
blocks
[
15
:
11
:
-
1
]],
axis
=
1
)
blocks_dc
=
np
.
concatenate
([
blocks_d
,
blocks_c
],
axis
=
1
)
blocks_ab
=
np
.
concatenate
([
blocks_a
,
blocks_b
],
axis
=
1
)
blocks_final
=
np
.
concatenate
([
blocks_ab
,
blocks_dc
],
axis
=
0
)
output_path
=
os
.
path
.
splitext
(
fn
)[
0
]
+
'_cropping.fits'
fits
.
writeto
(
output_path
,
blocks_final
,
overwrite
=
True
)
print
(
f
"OK:
{
output_path
}
"
)
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
>
1
:
fn
=
sys
.
argv
[
1
]
else
:
fn
=
'CSST_MSC_MS_WIDE_20281024132057_20281024132327_10100484833_08_L0_V01.fits'
process_single_file
(
fn
)
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