From 54bccd8d8c7773b8b2e9e25e7adf28046ec87407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Neveu?= Date: Tue, 23 Jan 2024 10:39:50 +0100 Subject: [PATCH] rename spectrogram in spectrogram_data --- spectractor/simulation/image_simulation.py | 4 ++-- spectractor/simulation/simulator.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spectractor/simulation/image_simulation.py b/spectractor/simulation/image_simulation.py index 0fd7ba9b..d5c8d392 100644 --- a/spectractor/simulation/image_simulation.py +++ b/spectractor/simulation/image_simulation.py @@ -470,11 +470,11 @@ def ImageSim(image_filename, spectrum_filename, outputdir, pwv=5, ozone=300, aer true_spectrum = np.copy(spectrogram.true_spectrum) # Saturation effects - saturated_pixels = np.where(spectrogram.spectrogram > image.saturation)[0] + saturated_pixels = np.where(spectrogram.spectrogram_data > image.saturation)[0] if len(saturated_pixels) > 0: my_logger.warning(f"\n\t{len(saturated_pixels)} saturated pixels detected above saturation " f"level at {image.saturation} ADU/s in the spectrogram." - f"\n\tSpectrogram maximum is at {np.max(spectrogram.spectrogram)} ADU/s.") + f"\n\tSpectrogram maximum is at {np.max(spectrogram.spectrogram_data)} ADU/s.") image.data[image.data > image.saturation] = image.saturation # Convert data from ADU/s in ADU diff --git a/spectractor/simulation/simulator.py b/spectractor/simulation/simulator.py index 07d38e26..931b2521 100644 --- a/spectractor/simulation/simulator.py +++ b/spectractor/simulation/simulator.py @@ -521,11 +521,11 @@ def simulate(self, A1=1.0, A2=0., A3=0., aerosols=0.05, angstrom_exponent=None, self.profile_params[order][:, 0] = spec # self.spectrogram is in ADU/s units here - self.spectrogram = A1 * ima + self.spectrogram_data = A1 * ima self.spectrogram_err = A1 * np.sqrt(ima_err2) if self.with_background: - self.spectrogram += B * self.spectrogram_bgd + self.spectrogram_data += B * self.spectrogram_bgd # Save the simulation parameters self.psf_poly_params = np.copy(poly_params[0]) self.header['OZONE_T'] = ozone @@ -539,7 +539,7 @@ def simulate(self, A1=1.0, A2=0., A3=0., aerosols=0.05, angstrom_exponent=None, self.header['Y0_T'] = shift_y self.header['ROTANGLE'] = angle - return self.lambdas, self.spectrogram, self.spectrogram_err + return self.lambdas, self.spectrogram_data, self.spectrogram_err if __name__ == "__main__":