nisp

NISP-specific tools, including a ZemaxPositions handler.

ZemaxPositions(simulations[, colname])

Zemax simulated positions, in spectroscopic or photometric mode.

spectrogrism.nisp.NISP_R = {'camera_flength': 0.9755, 'camera_gdist_K1': -0.0625, 'camera_gdist_x0': 0.0018, 'camera_gdist_y0': 0.2185, 'collimator_flength': 1.924, 'collimator_gdist_K1': 0.447, 'collimator_gdist_x0': -0.00031, 'collimator_gdist_y0': 0.0546, 'detector_dx': 0.000656, 'detector_dy': 0.00088, 'detector_pxsize': 1.8e-05, 'grism_dispersion': 13.4, 'grism_grating_blaze': 0.04537856055185257, 'grism_grating_material': 'FS', 'grism_grating_rho': 13.09, 'grism_prism_angle': 0.036267941856442165, 'grism_prism_material': 'FS', 'grism_prism_tiltx': -0.10530153153699122, 'grism_prism_tilty': 0.006574073515845309, 'grism_prism_tiltz': 0.002207841503772827, 'name': 'NISP-R', 'telescope_flength': 24.5, 'wave_range': [1.25e-06, 1.85e-06], 'wave_ref': 1.52e-06}

NISP effective optical configuration, R-grism

Note

The detector plane is tiled with 4×4 detectors of 2k×2k pixels of 18 µm; the spectrograph has a mean magnification (NISPPlateScale) of 0.5 approximately. Hence a focal plane of approximately 29×29 cm².

class spectrogrism.nisp.ZemaxPositions(simulations, colname='psfcmm')[source]

Zemax simulated positions, in spectroscopic or photometric mode.

Zemax configuration modes (‘confNB’):

  • 1: B-grism (NISP-S)

  • 2, 3, 4: R-grisms (NISP-S)

  • 5, 6, 7: Y, J, H (NISP-P)

Initialize from simulations = {mode: filename}.

colnames = ['confNb', 'wave', 'xindeg', 'yindeg', 'ximgmm', 'yimgmm', 'pxsize', 'nxpup', 'nypup', 'nximg', 'nyimg', 'ximgcpx', 'yimgcpx', 'ximgcmm', 'yimgcmm', 'xpsfcmm', 'ypsfcmm', 'ee50mm', 'ee80mm', 'ee90mm', 'ellpsf', 'papsfdeg']

Input column names

property orders

Dispersion orders (int modes).

property bands

Undispersed photometric bands (string modes).

classmethod read_simulation(filename, colname='psfcmm')[source]

Read single-mode simulation.

Parameters
  • filename (str) – input simulation filename

  • colname (str) – column name suffix to be used as output positions (in mm)

Returns

(wavelength, input coordinates) dataframe

Return type

pandas.DataFrame

Warning

this function relies on pandas.DataFrame.pivot(). Because of Pandas issue #12666 and related Numpy issue 7535, this requires Numpy >= v1.11.

get_simcfg()[source]

Generate a spectrogrism.spectrogrism.SimConfig corresponding to current simulation.

plot_input(ax=None, **kwargs)[source]

Plot input coordinates [deg].

plot_output(ax=None, modes=None, subsampling=0, **kwargs)[source]

Plot output (detector-level) positions [mm].

plot_offsets(other, ax=None, mode=1, nwaves=3)[source]

Plot output (detector-level) coordinate offsets [px].