Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
e0945d4e
Commit
e0945d4e
authored
3 years ago
by
Fang Yuedong
Browse files
Options
Download
Email Patches
Plain Diff
enable output of run metadata file (run date, run time, and software version).
parent
255d9883
release_v3.0
11-csst
29-darktime-exptime-shtopen-shtstat-t
current_stable_for_tests
develop
master
milky_way_extinction
new_sim
release_v1.0
release_v2.0
revert-914004c1
sim_scheduler
sls_psf_pca_convolve
wcs_test_gridGalaxy
v3.3.0
v3.2.1
v3.2.0
v3.1.0
v3.0.0
v2.1.0
v2.0.0
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
config/config_NGP.yaml
+2
-2
config/config_NGP.yaml
config/config_NGP_dev.yaml
+1
-1
config/config_NGP_dev.yaml
run_sim.py
+20
-0
run_sim.py
with
23 additions
and
3 deletions
+23
-3
config/config_NGP.yaml
+
2
-
2
View file @
e0945d4e
...
...
@@ -12,7 +12,7 @@
# work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/"
work_dir
:
"
/public/home/fangyuedong/test/CSST/workplace/"
data_dir
:
"
/data/simudata/CSSOSDataProductsSims/data/"
run_name
:
"
TEST_
LIMITING_MAG
"
run_name
:
"
TEST_
Speed
"
# (Optional) a file of point list
# if you just want to run default pointing:
...
...
@@ -79,7 +79,7 @@ obs_setting:
# - give a list of indexes of chips: [ip_1, ip_2...]
# - run all chips: null
# Note: for all pointings
run_chips
:
[
24
,
19
,
14
,
9
]
run_chips
:
[
24
]
# Whether to enable astrometric modeling
# astrometric_lib: "libshao.so"
...
...
This diff is collapsed.
Click to expand it.
config/config_NGP_dev.yaml
+
1
-
1
View file @
e0945d4e
...
...
@@ -2,7 +2,7 @@
###############################################
#
# Configuration file for CSST simulation
# CSST-Sim Group, 2021/10/07
, version 0.3
# CSST-Sim Group, 2021/10/07
#
###############################################
...
...
This diff is collapsed.
Click to expand it.
run_sim.py
+
20
-
0
View file @
e0945d4e
from
ObservationSim.ObservationSim
import
Observation
from
ObservationSim._util
import
parse_args
,
make_run_dirs
,
generate_pointing_list
from
pkg_resources
import
get_distribution
import
os
import
yaml
import
shutil
import
datetime
import
gc
gc
.
enable
()
...
...
@@ -20,6 +22,12 @@ def run_sim(Catalog):
----------
None
"""
# Get version of CSSTSim Package
__version__
=
get_distribution
(
"CSSTSim"
).
version
# Get run datetime
now
=
datetime
.
datetime
.
now
()
args
=
parse_args
()
if
args
.
config_dir
is
None
:
args
.
config_dir
=
''
...
...
@@ -55,7 +63,19 @@ def run_sim(Catalog):
# Make the main output directories
run_dir
=
make_run_dirs
(
work_dir
=
config
[
'work_dir'
],
run_name
=
config
[
'run_name'
],
pointing_list
=
pointing_list
)
# Copy the config file to output directory & Write Run metadata
shutil
.
copy
(
args
.
config_file
,
run_dir
)
run_meta
=
os
.
path
.
join
(
run_dir
,
"run_metadata.yaml"
)
with
open
(
run_meta
,
"w"
)
as
config_out
:
config_out
.
write
(
"
\n
"
)
config_out
.
write
(
"###############################################
\n
"
)
config_out
.
write
(
"CSSTSim_version:
\"
%s
\"\n
"
%
__version__
)
date_str
=
datetime
.
datetime
.
strftime
(
now
,
'%m/%d/%Y'
)
time_str
=
datetime
.
datetime
.
strftime
(
now
,
'%H:%M:%S'
)
config_out
.
write
(
"Run_date:
\"
%s
\"\n
"
%
date_str
)
config_out
.
write
(
"Run_time:
\"
%s
\"\n
"
%
time_str
)
config_out
.
write
(
"###############################################
\n
"
)
# Initialize the simulation
obs
=
Observation
(
config
=
config
,
Catalog
=
Catalog
,
work_dir
=
config
[
'work_dir'
],
data_dir
=
config
[
'data_dir'
])
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets