neclib.coordinates.pointing_error.pointing_error#

Aliases#

Parameters

General format of NECLIB parameters.

get_quantity

Convert a value to astropy Quantity.

class PointingError(*, model=None, **kwargs)[source]#

Bases: Parameters, ABC

Calculate pointing error offset.

Parameters:
  • model (Optional[str]) – Name of the pointing error model. If not specified, a dummy class which performs no pointing correction will be returned.

  • **kwargs – Model specific parameters.

Notes

This class automatically determines which pointing model to use based on the model argument, so you don’t have to import observatory-specific subclass. The model can be specified in TOML file as well.

Examples

>>> pointing_error = neclib.parameters.PointingError.from_file(
...     "path/to/pointing_error.toml"
... )
>>> pointing_error.apparent_to_refracted(0 * u.deg, 45 * u.deg)
(<Quantity 0.1 deg>, <Quantity 45.5 deg>)
>>> pointing_error.refracted_to_apparent(0 * u.deg, 45 * u.deg)
(<Quantity -0.1 deg>, <Quantity 44.5 deg>)
classmethod get_dummy()[source]#

Return a dummy pointing error model which performs no correction.

Examples

>>> pointing_error = neclib.parameters.PointingError.get_dummy()
>>> pointing_error.apparent_to_refracted(0 * u.deg, 45 * u.deg)
(<Quantity 0. deg>, <Quantity 45. deg>)
Return type:

PointingError

abstract fit(*args, **kwargs)[source]#

Fit the model to the measured pointing error parameters.

Return type:

Any

abstract apply_offset(az, el)[source]#

Compute the pointing error offset.

Parameters:
  • az (Quantity) – Azimuth at which the pointing error is computed.

  • el (Quantity) – Elevation at which the pointing error is computed.

Returns:

  • dAz – Offset in azimuth axis.

  • dEl – Offset in elevation axis.

Return type:

Tuple[Quantity, Quantity]

Important

The offset will be ADDED to encoder readings to convert it to true sky/celestial coordinate.

abstract apply_inverse_offset(az, el)[source]#

Compute the pointing error offset.

Parameters:
  • az (Quantity) – Azimuth at which the pointing error is computed.

  • el (Quantity) – Elevation at which the pointing error is computed.

Returns:

  • dAz – Offset in azimuth axis.

  • dEl – Offset in elevation axis.

Return type:

Tuple[Quantity, Quantity]

Important

The offset will be ADDED to encoder readings to convert it to true sky/celestial coordinate.

inverse_atmospheric_refraction(az, el, pressure, temperature, relative_humidity, obswl)[source]#
Parameters:
  • az (Union[Quantity, int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]]) –

  • el (Union[Quantity, int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]]) –

  • pressure (Unit("hPa")) –

  • temperature (Unit("deg_C")) –

  • relative_humidity (float) –

  • obswl (Unit("micron")) –

Return type:

Tuple[Quantity, Quantity]

apparent_to_refracted(az: Quantity, el: Quantity, unit: Optional[Union[UnitBase, str]] = None) Tuple[Quantity, Quantity][source]#
apparent_to_refracted(az: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]], el: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]], unit: Union[UnitBase, str]) Tuple[Quantity, Quantity]

Convert apparent AltAz coordinate to true coordinate.

Parameters:
  • az – Apparent azimuth, which may not accurate due to pointing/instrumental error.

  • el – Apparent elevation, which may not accurate due to pointing/instrumental error.

  • unit – Unit of the input azimuth and elevation.

Returns:

  • az – True azimuth.

  • el – True elevation. Atmospheric refraction should be taken into account, when converting this to sky/celestial coordinate.

Examples

>>> pointing_error = neclib.parameters.PointingError.from_file(
...     "path/to/pointing_error.toml"
... )
>>> pointing_error.apparent_to_refracted(0 * u.deg, 45 * u.deg)
(<Quantity 0.1 deg>, <Quantity 45.5 deg>)
refracted_to_apparent(az: Quantity, el: Quantity, unit: Optional[Union[UnitBase, str]] = None) Tuple[Quantity, Quantity][source]#
refracted_to_apparent(az: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]], el: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]]], unit: Union[UnitBase, str]) Tuple[Quantity, Quantity]

Convert true sky/celestial coordinate to apparent AltAz coordinate.

Parameters:
  • az – True azimuth.

  • el – True elevation. Atmospheric refraction should be taken into account before passing to this method.

  • unit – Unit of the input azimuth and elevation.

Returns:

  • az – Apparent azimuth, with pointing/instrumental error taken into account.

  • el – Apparent elevation, with pointing/instrumental error taken into account.

Examples

>>> pointing_error = neclib.parameters.PointingError.from_file(
...     "path/to/pointing_error.toml"
... )
>>> pointing_error.refracted_to_apparent(0 * u.deg, 45 * u.deg)
(<Quantity -0.1 deg>, <Quantity 44.5 deg>)