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