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
Wu Jin
CSST simulation
Commits
ae6b8921
Commit
ae6b8921
authored
Jan 09, 2022
by
Fang Yuedong
Browse files
minor fix in C3Catalog.py
parent
0fa8ebe9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Catalog/C3Catalog.py
View file @
ae6b8921
...
...
@@ -30,13 +30,13 @@ class C3Catalog(CatalogBase):
self
.
chip
=
chip
self
.
pointing
=
pointing
if
"star_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"star_cat"
]:
if
"star_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"star_cat"
]
and
not
config
[
"galaxy_only"
]
:
star_file
=
config
[
"input_path"
][
"star_cat"
]
star_SED_file
=
config
[
"SED_templates_path"
][
"star_SED"
]
self
.
star_path
=
os
.
path
.
join
(
self
.
cat_dir
,
star_file
)
self
.
star_SED_path
=
os
.
path
.
join
(
config
[
"data_dir"
],
star_SED_file
)
self
.
_load_SED_lib_star
()
if
"galaxy_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"galaxy_cat"
]:
if
"galaxy_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"galaxy_cat"
]
and
not
config
[
"star_only"
]
:
galaxy_file
=
config
[
"input_path"
][
"galaxy_cat"
]
self
.
galaxy_path
=
os
.
path
.
join
(
self
.
cat_dir
,
galaxy_file
)
self
.
galaxy_SED_path
=
os
.
path
.
join
(
config
[
"data_dir"
],
config
[
"SED_templates_path"
][
"galaxy_SED"
])
...
...
@@ -190,17 +190,20 @@ class C3Catalog(CatalogBase):
def
_load
(
self
,
**
kwargs
):
self
.
nav
=
15005
self
.
avGal
=
extAv
(
self
.
nav
,
seed
=
self
.
seed_Av
)
gals_cat
=
h5
.
File
(
self
.
galaxy_path
,
'r'
)[
'galaxies'
]
star_cat
=
h5
.
File
(
self
.
star_path
,
'r'
)[
'catalog'
]
self
.
objs
=
[]
self
.
ids
=
0
for
pix
in
self
.
pix_list
:
gals
=
gals_cat
[
str
(
pix
)]
stars
=
star_cat
[
str
(
pix
)]
self
.
_load_gals
(
gals
,
pix_id
=
pix
)
self
.
_load_stars
(
stars
,
pix_id
=
pix
)
del
gals
del
stars
if
"star_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"star_cat"
]
and
not
self
.
config
[
"galaxy_only"
]:
star_cat
=
h5
.
File
(
self
.
star_path
,
'r'
)[
'catalog'
]
for
pix
in
self
.
pix_list
:
stars
=
star_cat
[
str
(
pix
)]
self
.
_load_stars
(
stars
,
pix_id
=
pix
)
del
stars
if
"galaxy_cat"
in
self
.
config
[
"input_path"
]
and
self
.
config
[
"input_path"
][
"galaxy_cat"
]
and
not
self
.
config
[
"star_only"
]:
gals_cat
=
h5
.
File
(
self
.
galaxy_path
,
'r'
)[
'galaxies'
]
for
pix
in
self
.
pix_list
:
gals
=
gals_cat
[
str
(
pix
)]
self
.
_load_gals
(
gals
,
pix_id
=
pix
)
del
gals
print
(
"number of objects in catalog: "
,
len
(
self
.
objs
))
del
self
.
avGal
...
...
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