SNIFS R-channel¶
Author: Yannick Copin y.copin@ipnl.in2p3.fr
We construct a very simple optical model mimicking the red channel of the Supernova Integral Field Spectrograph.
[1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
#import mpld3
#mpld3.enable_notebook()
[2]:
import warnings
warnings.filterwarnings("ignore")
import numpy as N
from spectrogrism import spectrogrism as S
from spectrogrism import snifs
Load the SNIFS-R channel optical configuration:
[3]:
optcfg = snifs.SNIFS_R
print(optcfg)
------------------ Optical configuration 'SNIFS-R' -------------------
name : SNIFS-R
wave_ref : 7.6e-07
wave_range : [5e-07, 1e-06]
telescope_flength : 22.5
collimator_flength : 0.169549
collimator_distortion: 2.141
collimator_lcolor_coeffs: [-4.39879e-06, 8.91241e-10, -1.82941e-13]
grism_prism_material: BK7
grism_prism_angle : 0.30159289474462014
grism_grating_rho : 200.0
grism_dispersion : 2.86
grism_grating_material: EPR
grism_grating_blaze : 0.2617993877991494
camera_flength : 0.228014
camera_distortion : -0.276
camera_lcolor_coeffs: [2.66486e-06, -5.52303e-10, 1.1365e-13]
detector_pxsize : 1.5e-05
detector_angle : 0.0
Load the simulation configuration:
[4]:
simcfg = snifs.SNIFS_SIMU
print(simcfg)
---------------- Simulation configuration 'standard' -----------------
name : standard
wave_npx : 6
modes : (1, 0, 2, -1)
input_coords : [-0.01 -0.005 0. 0.005 0.01 ]
input_angle : -0.17453292519943295
Create a Spectrograph
instance from optical configuration:
[5]:
spectro = S.Spectrograph(optcfg)
print(spectro)
---------------------------- Spectrograph ----------------------------
Collimator: f=0.170 m
Null geometric distortion
Null chromatic distortion
Grism:
Prism [BK7]: A=17.28°, tilts=+0',+0',+0'
Grating [EPR]: rho=200.0 g/mm, blaze=15.00°
1st-order null-deviation wavelength: 0.76 µm
Camera: f=0.228 m
Null geometric distortion
Null chromatic distortion
Detector: pxsize=15 µm
Offset=(+0.000, +0.000) mm, angle=0.0°
Spectrograph magnification: 1.345
Central dispersion: 2.77 AA/px at 0.76 µm
Test the optical model:
[6]:
if not spectro.test(simcfg.get_wavelengths(optcfg), verbose=False):
print("ERROR: backward modeling does not match.")
else:
print(" SUCCESSFUL ROUND-TRIP TEST ".center(70, '-'))
--------------------- SUCCESSFUL ROUND-TRIP TEST ---------------------
Simulate spectra on the detector and plot:
[7]:
detector = spectro.predict_positions(simcfg)
ax = detector.plot(modes=(-1, 0, 1, 2), blaze=True)
ax.set_aspect('auto')
ax.axis(N.array([-2000, 2000, -4000, 4000]) *
spectro.detector.pxsize / 1e-3) # [mm]
ax.figure.set_size_inches(12, 10)
ax.legend()
[7]:
<matplotlib.legend.Legend at 0x7fd0e5d2a748>
This sequence of actions is readily available under snifs.plot_SNIFS()
function.
This page was generated from SNIFS-R.ipynb.