diff --git a/csst_ifs_sim/csst_ifs_sim.py b/csst_ifs_sim/csst_ifs_sim.py index d3ef00e70a4fdb4bfb63ef2aba7b9242436de8b4..dd51535152c02f824159a3bf28f4637494cd8429 100644 --- a/csst_ifs_sim/csst_ifs_sim.py +++ b/csst_ifs_sim/csst_ifs_sim.py @@ -5519,10 +5519,15 @@ class IFSsimulator(): # if self.debug: # exptimes=1 - - self.image_b_N = np.zeros((1344, 9672, exptimes)) - - self.image_r_N = np.zeros((1856, 13768, exptimes)) + if exptimes>1: + self.image_b_N = np.zeros((1344, 9672, exptimes)) + + self.image_r_N = np.zeros((1856, 13768, exptimes)) + else: + self.image_b_N = np.zeros((1344, 9672)) + + self.image_r_N = np.zeros((1856, 13768)) + for idk in range(exptimes): @@ -5590,9 +5595,16 @@ class IFSsimulator(): print('Applying cosmetics finished.......') self.discretise() + + + if exptimes>1: - self.image_b_N[:, :, idk] = self.image_b[:, :] - self.image_r_N[:, :, idk] = self.image_r[:, :] + self.image_b_N[:, :, idk] = self.image_b[:, :].copy() + self.image_r_N[:, :, idk] = self.image_r[:, :].copy() + else: + self.image_b_N[:, :] = self.image_b[:, :].copy() + self.image_r_N[:, :] = self.image_r[:, :].copy() + self.writeOutputs(simnumber)