Skip to content

Commit

Permalink
minor fixes to data generation (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-regier authored Jul 24, 2024
1 parent 1db2ad4 commit 6898c24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bliss/conf/base_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ surveys:
psf_slen: 25
load_image_data: false
# options below only apply to prediction
align_to_band: null # should be 2 but it's slower then
align_to_band: 2
crop_to_bands: null
crop_to_hw: null

Expand Down
5 changes: 2 additions & 3 deletions bliss/simulator/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def render_image(self, tile_cat):

# calibration: convert from (linear) physical units to electron counts
# use the specified flux_calibration ratios indexed by image_id
avg_nelec_conv = np.mean(frame["flux_calibration"], axis=-1)
if n_sources > 0:
avg_nelec_conv = np.mean(frame["flux_calibration"], axis=-1)
full_cat["star_fluxes"] *= rearrange(avg_nelec_conv, "bands -> 1 1 bands")
if "galaxy_fluxes" in tile_cat:
full_cat["galaxy_fluxes"] *= avg_nelec_conv
Expand Down Expand Up @@ -196,8 +196,7 @@ def render_image(self, tile_cat):
image -= background

# convert electron counts to physical units (now what we've subtracted the background)
if n_sources > 0:
image /= rearrange(avg_nelec_conv, "bands -> bands 1 1")
image /= rearrange(avg_nelec_conv, "bands -> bands 1 1")

if self.with_dither:
image = align(image, [wcs_list], self.survey.align_to_band)
Expand Down

0 comments on commit 6898c24

Please sign in to comment.