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.


In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
import mpld3
mpld3.enable_notebook()

In [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:


In [3]:
optcfg = snifs.SNIFS_R
print(optcfg)


------------------ Optical configuration 'SNIFS-R' -------------------
  name                : SNIFS-R
  wave_ref            : 7.6e-07
  wave_range          : [5e-07, 1.02e-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.301592894745
  grism_grating_rho   : 200.0
  grism_dispersion    : 2.86
  grism_grating_material: EPR
  grism_grating_blaze : 0.261799387799
  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:


In [4]:
simcfg = snifs.SNIFS_SIMU
print(simcfg)


---------------- Simulation configuration u'standard' ----------------
  name                : standard
  wave_npx            : 10
  modes               : (1, 0, 2, -1)
  input_coords        : [-0.01  -0.005  0.     0.005  0.01 ]
  input_angle         : -0.174532925199

Create a Spectrograph instance from optical configuration:


In [5]:
spectro = S.Spectrograph(optcfg)
print(spectro)


---------------------------- Spectrograph ----------------------------
Collimator: f=0.2 m
  Geometric distortion: center=(+0.000, +0.000) mm, K-coeffs=[ 2.141], P-coeffs=[]
  Chromatic distortion: lref=0.76 µm, coeffs=[-4.39879e-06, +8.91241e-10, -1.82941e-13]
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.2 m
  Geometric distortion: center=(+0.000, +0.000) mm, K-coeffs=[-0.276], P-coeffs=[]
  Chromatic distortion: lref=0.76 µm, coeffs=[+2.66486e-06, -5.52303e-10, +1.1365e-13]
Detector: pxsize=15 µm
  Offset=(+0.000, +0.000) mm, angle=0.0 deg
Spectrograph magnification: 1.345
Central dispersion: 2.77 AA/px at 0.76 µm

Test the optical model:


In [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:


In [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)


This sequence of actions is readily available under snifs.plot_SNIFS() function.