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
Liu Dezi
csst_msc_sim
Commits
d15cfcc8
Commit
d15cfcc8
authored
Apr 03, 2022
by
Fang Yuedong
Browse files
add try-except block when reading healpix
parent
7d24b403
Changes
2
Show whitespace changes
Inline
Side-by-side
Catalog/NGPCatalog.py
View file @
d15cfcc8
...
@@ -257,15 +257,23 @@ class NGPCatalog(CatalogBase):
...
@@ -257,15 +257,23 @@ class NGPCatalog(CatalogBase):
if
"star_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"star_cat"
]
and
not
self
.
config
[
"run_option"
][
"galaxy_only"
]:
if
"star_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"star_cat"
]
and
not
self
.
config
[
"run_option"
][
"galaxy_only"
]:
star_cat
=
h5
.
File
(
self
.
star_path
,
'r'
)[
'catalog'
]
star_cat
=
h5
.
File
(
self
.
star_path
,
'r'
)[
'catalog'
]
for
pix
in
self
.
pix_list
:
for
pix
in
self
.
pix_list
:
try
:
stars
=
star_cat
[
str
(
pix
)]
stars
=
star_cat
[
str
(
pix
)]
self
.
_load_stars
(
stars
,
pix_id
=
pix
)
self
.
_load_stars
(
stars
,
pix_id
=
pix
)
del
stars
del
stars
except
Exception
as
e
:
self
.
logger
.
error
(
str
(
e
))
print
(
e
)
if
"galaxy_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"galaxy_cat"
]
and
not
self
.
config
[
"run_option"
][
"star_only"
]:
if
"galaxy_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"galaxy_cat"
]
and
not
self
.
config
[
"run_option"
][
"star_only"
]:
gals_cat
=
h5
.
File
(
self
.
galaxy_path
,
'r'
)[
'galaxies'
]
gals_cat
=
h5
.
File
(
self
.
galaxy_path
,
'r'
)[
'galaxies'
]
for
pix
in
self
.
pix_list
:
for
pix
in
self
.
pix_list
:
try
:
gals
=
gals_cat
[
str
(
pix
)]
gals
=
gals_cat
[
str
(
pix
)]
self
.
_load_gals
(
gals
,
pix_id
=
pix
)
self
.
_load_gals
(
gals
,
pix_id
=
pix
)
del
gals
del
gals
except
Exception
as
e
:
self
.
logger
.
error
(
str
(
e
))
print
(
e
)
if
self
.
logger
is
not
None
:
if
self
.
logger
is
not
None
:
self
.
logger
.
info
(
"number of objects in catalog: %d"
%
(
len
(
self
.
objs
)))
self
.
logger
.
info
(
"number of objects in catalog: %d"
%
(
len
(
self
.
objs
)))
else
:
else
:
...
...
config/config_NGP.yaml
View file @
d15cfcc8
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
# work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/"
# work_dir: "/public/home/fangyuedong/sim_code_release/CSST/test/"
work_dir
:
"
/public/home/fangyuedong/temp/CSST/workplace/"
work_dir
:
"
/public/home/fangyuedong/temp/CSST/workplace/"
data_dir
:
"
/data/simudata/CSSOSDataProductsSims/data/"
data_dir
:
"
/data/simudata/CSSOSDataProductsSims/data/"
run_name
:
"
NGP_
test
"
run_name
:
"
NGP_
Astrometry-on
"
# (Optional) a file of point list
# (Optional) a file of point list
# if you just want to run default pointing:
# if you just want to run default pointing:
# - pointing_dir: null
# - pointing_dir: null
# - pointing_file: null
# - pointing_file: null
pointing_dir
:
"
/data/simudata/CSSOSDataProductsSims/data/"
pointing_dir
:
"
/data/simudata/CSSOSDataProductsSims/data/"
pointing_file
:
"
pointing_test_NGP_
3
.dat"
pointing_file
:
"
pointing_test_NGP_
2.17
.dat"
# Whether to use MPI
# Whether to use MPI
run_option
:
run_option
:
...
@@ -34,7 +34,7 @@ run_option:
...
@@ -34,7 +34,7 @@ run_option:
out_cat_only
:
NO
out_cat_only
:
NO
# Only simulate stars?
# Only simulate stars?
star_only
:
YES
star_only
:
NO
# Only simulate galaxies?
# Only simulate galaxies?
galaxy_only
:
NO
galaxy_only
:
NO
...
@@ -73,7 +73,7 @@ obs_setting:
...
@@ -73,7 +73,7 @@ obs_setting:
# - give a list of indexes of pointings: [ip_1, ip_2...]
# - give a list of indexes of pointings: [ip_1, ip_2...]
# - run all pointings: null
# - run all pointings: null
# Note: only valid when a pointing list is specified
# Note: only valid when a pointing list is specified
run_pointings
:
[
1
]
run_pointings
:
[
5
,
7
,
11
,
14
,
19
,
60
,
70
,
82
,
88
]
# Run specific chip(s):
# Run specific chip(s):
# - give a list of indexes of chips: [ip_1, ip_2...]
# - give a list of indexes of chips: [ip_1, ip_2...]
...
...
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