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
c5298bda
Commit
c5298bda
authored
Dec 17, 2021
by
Fang Yuedong
Browse files
add chip parameter to Catalog classes
parent
7e4fe4e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Catalog/C3Catalog.py
View file @
c5298bda
...
...
@@ -15,7 +15,7 @@ from ObservationSim.MockObject._util import seds, sed_assign, extAv, tag_sed, ge
NSIDE
=
128
class
C3Catalog
(
CatalogBase
):
def
__init__
(
self
,
config
,
**
kwargs
):
def
__init__
(
self
,
config
,
chip
,
**
kwargs
):
super
().
__init__
()
self
.
cat_dir
=
os
.
path
.
join
(
config
[
"data_dir"
],
config
[
"input_path"
][
"cat_dir"
])
self
.
seed_Av
=
config
[
"random_seeds"
][
"seed_Av"
]
...
...
@@ -24,10 +24,7 @@ class C3Catalog(CatalogBase):
self
.
normF_star
=
Table
.
read
(
os
.
path
.
join
(
self
.
normalize_dir
,
'SLOAN_SDSS.g.fits'
))
self
.
normF_galaxy
=
Table
.
read
(
os
.
path
.
join
(
self
.
normalize_dir
,
'lsst_throuput_g.fits'
))
try
:
self
.
chip
=
kwargs
[
"chip"
]
except
:
raise
ValueError
(
'For Cycle-3 Catalog class, must give a "chip" object to initiate'
)
self
.
chip
=
chip
if
"star_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"star_cat"
]:
star_file
=
config
[
"input_path"
][
"star_cat"
]
...
...
Catalog/Catalog_example.py
View file @
c5298bda
...
...
@@ -33,7 +33,7 @@ class Catalog_example(CatalogBase):
load the filter throughput for the input catalog's photometric system.
"""
def
__init__
(
self
,
config
,
**
kwargs
):
def
__init__
(
self
,
config
,
chip
,
**
kwargs
):
"""Constructor method.
Parameters
...
...
@@ -51,6 +51,7 @@ class Catalog_example(CatalogBase):
super
().
__init__
()
self
.
cat_dir
=
os
.
path
.
join
(
config
[
"data_dir"
],
config
[
"input_path"
][
"cat_dir"
])
self
.
chip
=
chip
if
"star_cat"
in
config
[
"input_path"
]
and
config
[
"input_path"
][
"star_cat"
]:
star_file
=
config
[
"input_path"
][
"star_cat"
]
star_SED_file
=
config
[
"SED_templates_path"
][
"star_SED"
]
...
...
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