Skip to content

Commit

Permalink
Merge pull request #207 from zhouconghao/return_se_wcs
Browse files Browse the repository at this point in the history
return dict of list of se_wcs
  • Loading branch information
esheldon authored Jun 18, 2024
2 parents f6c83f2 + 896b5ec commit 8542abe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions descwl_shear_sims/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def make_sim(
ra, dec: sky position of bright stars
radius_pixels: radius of mask in pixels
has_bleed: bool, True if there is a bleed trail
se_wcs: list of WCS
se_wcs: a dict keyed by band name, holding a list of se_wcs
"""
# Get the pixel scale using a default band from the survey
_bd = deepcopy(DEFAULT_SURVEY_BANDS)[survey_name]
Expand Down Expand Up @@ -188,7 +188,7 @@ def make_sim(
shear_obj = ShearConstant(g1=float(g1), g2=float(g2))
band_data = {}
bright_info = []
se_wcs = []
se_wcs = {}
for band in bands:
survey = get_survey(
gal_type=galaxy_catalog.gal_type,
Expand All @@ -213,6 +213,7 @@ def make_sim(
# bright_info once

bdata_list = []
se_wcs_list = []
for epoch in range(epochs_per_band):
exp, this_bright_info, this_se_wcs = make_exp(
rng=rng,
Expand Down Expand Up @@ -248,7 +249,6 @@ def make_sim(
)
if epoch == 0:
bright_info += this_bright_info
se_wcs.append(this_se_wcs)

if galaxy_catalog.gal_type == 'wldeblend':
# rescale the image to calibrate it to magnitude zero point
Expand All @@ -270,8 +270,10 @@ def make_sim(
)

bdata_list.append(exp)
se_wcs_list.append(this_se_wcs)

band_data[band] = bdata_list
se_wcs[band] = se_wcs_list

bright_info = eu.numpy_util.combine_arrlist(bright_info)
return {
Expand Down

0 comments on commit 8542abe

Please sign in to comment.