DistortionParameters#
- class esis.optics.DistortionParameters(yaw_grating, pitch_grating, roll_grating, roll_field_stop, spacing_rulings, displacement_primary, pitch, yaw, roll, z_primary=<Quantity 0. mm>, z_sensor=<Quantity 0. mm>, roll_sensor=<Quantity 0. deg>, pitch_sensor=<Quantity 0. deg>, yaw_sensor=<Quantity 0. deg>, x_sensor=<Quantity 0. mm>, y_sensor=<Quantity 0. mm>, degradation=<Quantity 1.>)[source]#
Bases:
PrintableThe degrees of freedom adjusted when fitting an instrument model to images.
An instance of this class serves both as a point in parameter space and as the prototype that defines the units and structure of the flat vector seen by
scipy.optimizeroutines:named_arrays.pack()flattens it into a dimensionless vector andnamed_arrays.unpack()rebuilds it.Examples
Gather the distortion parameters of the ESIS flight-1 design and flatten them into a vector suitable for
scipy.optimize.import named_arrays as na import esis instrument = esis.flights.f1.optics.design(num_distribution=0) parameters = esis.optics.DistortionParameters.from_instrument(instrument) na.pack(parameters)
ScalarArray( ndarray=[-268.17403457, 0. , 0. , 0. , 0.38660662, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , -12.252 , 0. , 0. , 1. ], shape={'pack': 17}, )Attributes
The factor by which the channel's response falls short of the model.
The pitch of the sensor (a foreshortening of the image along one axis).
The roll of the sensor about its normal (a rotation of the image).
The in-plane translation of the sensor along its \(x\) axis.
The in-plane translation of the sensor along its \(y\) axis.
The yaw of the sensor (a foreshortening of the image along the other axis).
The displacement of the primary mirror along the optic axis at a fixed focal length: a defocus of the solar image at the field stop.
The displacement of the sensor along its normal, with the grating following along the beam by
kappa_focustimes less so that the image stays in focus: a change of the magnification of one channel without a change of its focus.The yaw angle of the diffraction grating.
The pitch angle of the diffraction grating.
The roll angle of the diffraction grating.
The roll angle of the field stop.
The constant coefficient of the grating ruling spacing polynomial.
The displacement of the primary mirror along the optic axis relative to its nominal focal length.
The pitch angle of the entire instrument.
The yaw angle of the entire instrument.
The roll angle of the entire instrument about its optical axis.
Methods
__init__(yaw_grating, pitch_grating, ...[, ...])from_file(path[, axis])Load parameters saved by
to_file().from_instrument(instrument)Gather the current distortion parameters of the given instrument.
to_file(path[, metadata])Save these parameters as a plain-text ECSV table.
to_instrument(instrument)Apply these parameters to a copy of the given instrument.
to_string([prefix])Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.Inheritance Diagram

- Parameters:
yaw_grating (Quantity | AbstractScalar)
pitch_grating (Quantity | AbstractScalar)
roll_grating (Quantity | AbstractScalar)
roll_field_stop (Quantity | AbstractScalar)
spacing_rulings (Quantity | AbstractScalar)
displacement_primary (Quantity | AbstractScalar)
pitch (Quantity | AbstractScalar)
yaw (Quantity | AbstractScalar)
roll (Quantity | AbstractScalar)
z_primary (Quantity | AbstractScalar)
z_sensor (Quantity | AbstractScalar)
roll_sensor (Quantity | AbstractScalar)
pitch_sensor (Quantity | AbstractScalar)
yaw_sensor (Quantity | AbstractScalar)
x_sensor (Quantity | AbstractScalar)
y_sensor (Quantity | AbstractScalar)
degradation (Quantity | AbstractScalar)
- classmethod from_file(path, axis=None)[source]#
Load parameters saved by
to_file().The logical axis of the parameters is recovered from the
axisentry of the table header.- Parameters:
- Return type:
- classmethod from_instrument(instrument)[source]#
Gather the current distortion parameters of the given instrument.
The parameters are converted to a canonical set of units (
arcminfor the grating angles,arcsecfor the instrument pointing, etc.) so that the components of the packed vector are of order unity and bounds built from different instances are consistent.- Parameters:
instrument (AbstractInstrument) – The instrument model to gather the parameters from.
- Return type:
- to_file(path, metadata=None)[source]#
Save these parameters as a plain-text ECSV table.
The fields become the columns of the table (with their units), and the elements along the (single) logical axis of the parameters become its rows, so that fit results can be committed to version control and reviewed as text. Scalar fields are broadcast along the axis.
- Parameters:
- Raises:
ValueError – If the parameters have more than one logical axis, or if metadata contains the reserved key
"axis", which records the name of the logical axis forfrom_file().- Return type:
None
See also
from_fileThe inverse of this method.
- to_instrument(instrument)[source]#
Apply these parameters to a copy of the given instrument.
The given instrument is left unmodified, and any cached optical system on the result is discarded so that it is rebuilt with the new parameters. The placements the terms are measured from are remembered on the result, so this method may be applied repeatedly to the results of previous applications.
- Parameters:
instrument (AbstractInstrument) – The instrument model to apply the parameters to. It must carry its focus ratio,
kappa_focus.- Raises:
TypeError – If instrument does not carry a focus ratio. This is a fault of the setup, so it is not a
ValueError, which merits treat as a failed trial.- Return type:
- to_string(prefix=None)#
Public-facing version of the
__repr__method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.
- degradation: Quantity | AbstractScalar = <Quantity 1.>#
The factor by which the channel’s response falls short of the model.
A scale on the image rather than an optical parameter, for a merit which compares absolute intensities;
to_instrument()ignores it.
- displacement_primary: Quantity | AbstractScalar#
The displacement of the primary mirror along the optic axis relative to its nominal focal length.
A displacement \(d\) simultaneously sets the focal length to \(f_\mathrm{nominal} + d\) and the translation of the primary mirror to \(-d\), so that the primary moves while the focal plane stays put.
- pitch: Quantity | AbstractScalar#
The pitch angle of the entire instrument.
- pitch_grating: Quantity | AbstractScalar#
The pitch angle of the diffraction grating.
- pitch_sensor: Quantity | AbstractScalar = <Quantity 0. deg>#
The pitch of the sensor (a foreshortening of the image along one axis).
- roll: Quantity | AbstractScalar#
The roll angle of the entire instrument about its optical axis.
A roll turns the sky inside windows that stay put, since the field stop turns with the optics, so it sets the angle between every window and the sky. It is the same as a roll of the field stop with the opposite sign, which one frame cannot tell it apart from.
- roll_field_stop: Quantity | AbstractScalar#
The roll angle of the field stop.
- roll_grating: Quantity | AbstractScalar#
The roll angle of the diffraction grating.
- roll_sensor: Quantity | AbstractScalar = <Quantity 0. deg>#
The roll of the sensor about its normal (a rotation of the image).
- spacing_rulings: Quantity | AbstractScalar#
The constant coefficient of the grating ruling spacing polynomial.
- x_sensor: Quantity | AbstractScalar = <Quantity 0. mm>#
The in-plane translation of the sensor along its \(x\) axis.
- y_sensor: Quantity | AbstractScalar = <Quantity 0. mm>#
The in-plane translation of the sensor along its \(y\) axis.
- yaw: Quantity | AbstractScalar#
The yaw angle of the entire instrument.
- yaw_grating: Quantity | AbstractScalar#
The yaw angle of the diffraction grating.
- yaw_sensor: Quantity | AbstractScalar = <Quantity 0. deg>#
The yaw of the sensor (a foreshortening of the image along the other axis).
- z_primary: Quantity | AbstractScalar = <Quantity 0. mm>#
The displacement of the primary mirror along the optic axis at a fixed focal length: a defocus of the solar image at the field stop.
Unlike
displacement_primary, this moves the focal plane off the field stop. Each channel views the defocused image through its own sector of the primary, so the image shifts on the sky by the sector’s offset times the defocus, differently in every channel, while the window edges stay put: it is the one term that moves the sky without moving the windows.
- z_sensor: Quantity | AbstractScalar = <Quantity 0. mm>#
The displacement of the sensor along its normal, with the grating following along the beam by
kappa_focustimes less so that the image stays in focus: a change of the magnification of one channel without a change of its focus.