WavelengthFromGratingEquation

class gwcs.spectroscopy.WavelengthFromGratingEquation(groove_density, spectral_order, **kwargs)[source]

Bases: astropy.modeling.core.Model

Solve the Grating Dispersion Law for the wavelength.

Note

This form of the equation can be used for paraxial (small angle approximation) as well as oblique incident angles. With paraxial systems the inputs are sin of the angles and it transforms to

\((\sin(alpha_in) + \sin(alpha_out)) / (groove_density * spectral_order)\).

With oblique angles the inputs are the direction cosines of the angles.

Parameters:

groove_density : int

Grating ruling density in units of 1/length.

spectral_order : int

Spectral order.

Examples

>>> from astropy.modeling.models import math
>>> model = WavelengthFromGratingEquation(groove_density=20000*1/u.m, spectral_order=-1)
>>> alpha_in = (math.Deg2radUfunc() | math.SinUfunc())(.0001 * u.deg)
>>> alpha_out = (math.Deg2radUfunc() | math.SinUfunc())(.0001 * u.deg)
>>> lam = model(alpha_in, alpha_out)
>>> print(lam)
-1.7453292519934437e-10 m

Attributes Summary

groove_density Grating ruling density in units of 1/m.
linear
n_inputs
n_outputs
param_names
return_units This property is used to indicate what units or sets of units the output of evaluate should be in, and returns a dictionary mapping outputs to units (or None if any units are accepted).
spectral_order Spectral order.

Methods Summary

__call__(*inputs[, model_set_axis, …]) Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.
evaluate(alpha_in, alpha_out, …) Evaluate the model on some input variables.

Attributes Documentation

groove_density = Parameter('groove_density', value=1.0)

Grating ruling density in units of 1/m.

linear = False
n_inputs = 2
n_outputs = 1
param_names = ('groove_density', 'spectral_order')
return_units

This property is used to indicate what units or sets of units the output of evaluate should be in, and returns a dictionary mapping outputs to units (or None if any units are accepted).

Model sub-classes can also use function annotations in evaluate to indicate valid output units, in which case this property should not be overridden since it will return the return units based on the annotations.

spectral_order = Parameter('spectral_order', value=1.0)

Spectral order.

Methods Documentation

__call__(*inputs, model_set_axis=None, with_bounding_box=False, fill_value=nan, equivalencies=None, inputs_map=None, **new_inputs)

Evaluate this model using the given input(s) and the parameter values that were specified when the model was instantiated.

evaluate(alpha_in, alpha_out, groove_density, spectral_order)[source]

Evaluate the model on some input variables.