neclib.coordinates.convert#

Coordinate conversion functions.

This module contains functions for coordinate conversion and types for coordinate handling. The intention of the custom type definitions is to avoid unintended coordinate conversions which can be caused by the use of highly automated SkyCoord objects.

Aliases#

Array

None

PointingError

Calculate pointing error offset.

QuantityValidator

Type validator, to force some instance variables to be Quantity.

config

None

get_logger

Get logger instance which prints operation logs to console.

get_quantity

Convert a value to astropy Quantity.

parse_frame

Parse a frame string and create a frame object.

class CoordinateDelta(d_lon: Union[int, float, numpy.ndarray[Any, numpy.dtype[numpy.number]], neclib.core.types.Array[Union[int, float]], astropy.units.quantity.Quantity], d_lat: Union[int, float, numpy.ndarray[Any, numpy.dtype[numpy.number]], neclib.core.types.Array[Union[int, float]], astropy.units.quantity.Quantity], frame: Union[Type[astropy.coordinates.baseframe.BaseCoordinateFrame], astropy.coordinates.baseframe.BaseCoordinateFrame, str], unit: Union[astropy.units.core.UnitBase, str, NoneType] = None)[source]#

Bases: object

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

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

  • frame (Union[Type[BaseCoordinateFrame], BaseCoordinateFrame, str]) –

  • unit (Optional[Union[UnitBase, str]]) –

d_lon: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]], Quantity]#
d_lat: Union[int, float, ndarray[Any, dtype[number]], Array[Union[int, float]], Quantity]#
frame: Union[Type[BaseCoordinateFrame], BaseCoordinateFrame, str]#
unit: Optional[Union[UnitBase, str]] = None#
property broadcasted: CoordinateDelta#
property size: int#
property shape: Tuple[int, ...]#
class CoordCalculator(location=<EarthLocation (-3871165.06944156, 3428273.15427448, 3723695.62006595) m>, pointing_err_file=None, direct_mode=False, direct_before=None)[source]#

Bases: object

Collection of basic methods for celestial coordinate calculation.

Parameters:
  • location (astropy.coordinates.earth.EarthLocation) – Location of the telescope.

  • pointing_param_path – Path to the pointing error correction parameters. If None, pointing error correction won’t be performed.

  • pointing_err_file (Optional[Union[PathLike, str]]) –

  • direct_mode (bool) –

  • direct_before (bool) –

Examples

>>> calc = neclib.coordinates.CoordCalculator(config.location)
location: EarthLocation = <EarthLocation (-3871165.06944156, 3428273.15427448, 3723695.62006595) m>#
pointing_err_file: Optional[Union[PathLike, str]] = None#
obswl: ClassVar[QuantityValidator] = <Quantity nan mm>#
obsfreq: ClassVar[QuantityValidator] = <Quantity 230.538 GHz>#
relative_humidity: ClassVar[QuantityValidator] = <Quantity nan>#
pressure: ClassVar[QuantityValidator] = <Quantity nan hPa>#
temperature: ClassVar[QuantityValidator] = <Quantity nan K>#
direct_mode: bool = False#
direct_before: bool = None#
command_group_duration_sec = 1#
property command_freq: Union[int, float]#
property command_offset_sec: Union[int, float]#
property pointing_err: PointingError#
property altaz_kwargs: Dict[str, Any]#

Return keyword arguments for AltAz frame, except for obstime.

property coordinate: Type[Coordinate]#
property name_coordinate: Type[NameCoordinate]#
coordinate_delta#

alias of CoordinateDelta