Skip to content

Commit

Permalink
rename spectrogram in spectrogram_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémy Neveu committed Jan 23, 2024
1 parent e107961 commit 54bccd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spectractor/simulation/image_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spectractor/simulation/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__":
Expand Down

0 comments on commit 54bccd8

Please sign in to comment.