nisp

NISP-specific tools, including a ZemaxPositions handler.

ZemaxPositions(simulations[, colname]) Zemax simulated positions, in spectroscopic or photometric mode.
class spectrogrism.nisp.ZemaxPositions(simulations, colname='psfcmm')

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}.

bands

Undispersed photometric bands (string modes).

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

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

orders

Dispersion orders (int modes).

plot_input(ax=None, **kwargs)

Plot input coordinates [deg].

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

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

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

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

classmethod read_simulation(filename, colname='psfcmm')

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.