From b8be6e98f2fc39ecff04cf11082c11fe8e86d891 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Thu, 15 Aug 2024 10:17:35 +0800 Subject: [PATCH] add gain value for closing 16 channel; fix sls bug: in two grating stitch --- observation_sim/mock_objects/Galaxy.py | 6 +++--- observation_sim/sim_steps/readout_output.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/observation_sim/mock_objects/Galaxy.py b/observation_sim/mock_objects/Galaxy.py index b0404e7..8dc9772 100755 --- a/observation_sim/mock_objects/Galaxy.py +++ b/observation_sim/mock_objects/Galaxy.py @@ -375,7 +375,7 @@ class Galaxy(MockObject): 1, origin_star[1] + galImg.array.shape[1] - 1] if gal_origin[1] < grating_split_pos_chip < gal_end[1]: - subSlitPos = int(grating_split_pos_chip - gal_origin[1] + 1) + subSlitPos = int(grating_split_pos_chip - gal_origin[1]) # part img disperse star_p1s=[] @@ -407,12 +407,12 @@ class Galaxy(MockObject): for galImg in galImg_List: subImg_p2 = galImg.array[:, - subSlitPos + 1:galImg.array.shape[1]] + subSlitPos:galImg.array.shape[1]] star_p2 = galsim.Image(subImg_p2) star_p2.setOrigin(0, 0) star_p2s.append(star_p2) origin_p2 = [origin_star[0], grating_split_pos_chip] - xcenter_p2 = max(x_nominal, grating_split_pos_chip - 1) - 0 + xcenter_p2 = max(x_nominal, grating_split_pos_chip) - 0 ycenter_p2 = y_nominal - 0 sdp_p2 = SpecDisperser(orig_img=star_p2s, xcenter=xcenter_p2, diff --git a/observation_sim/sim_steps/readout_output.py b/observation_sim/sim_steps/readout_output.py index c2cb8a1..0f3f4f5 100644 --- a/observation_sim/sim_steps/readout_output.py +++ b/observation_sim/sim_steps/readout_output.py @@ -44,6 +44,7 @@ def apply_gain(self, chip, filt, tel, pointing, catalog, obs_param): seed=self.overall_config["random_seeds"]["seed_gainNonUniform"]+chip.chipID) elif obs_param["gain_16channel"] == False: chip.img /= chip.gain + chip.gain_channel = np.ones(chip.nsecy*chip.nsecx)*chip.gain return chip, filt, tel, pointing -- GitLab