neclib.coordinates.observations.observation_spec_base#

Aliases#

Parameters

General format of NECLIB parameters.

html_repr_of_observation_spec

Return HTML representation of the observation specification.

scan_to_points

Astropy units equivalency, between scan and point.

class ObservationMode(value)[source]#

Bases: Enum

Type of observation to be performed at certain coordinate.

DRIVE = '#777'#
ON = '#0F5'#
OFF = '#0DF'#
HOT = '#F50'#
SKY = '#0DF'#
class TimeKeeper(interval, points_per_scan=1)[source]#

Bases: object

Judge whether it’s time to run constant interval observation or not.

Parameters:
  • interval (Quantity) –

  • points_per_scan (int) –

property should_observe: bool#

Return True if it’s time to run observation, otherwise False.

increment(unit)[source]#

Increment the counter, which will be compared with interval.

Parameters:

unit (Union[UnitBase, str]) –

Return type:

None

tell_observed()[source]#

Tell the time keeper that the observation has been completed.

Return type:

None

class Waypoint(mode: neclib.coordinates.observations.observation_spec_base.ObservationMode, target: Union[str, Tuple[astropy.units.quantity.Quantity, astropy.units.quantity.Quantity, Union[str, astropy.coordinates.baseframe.BaseCoordinateFrame, Type[astropy.coordinates.baseframe.BaseCoordinateFrame]]], NoneType] = None, reference: Union[str, Tuple[astropy.units.quantity.Quantity, astropy.units.quantity.Quantity, Union[str, astropy.coordinates.baseframe.BaseCoordinateFrame, Type[astropy.coordinates.baseframe.BaseCoordinateFrame]]], NoneType] = None, scan_frame: Union[str, astropy.coordinates.baseframe.BaseCoordinateFrame, Type[astropy.coordinates.baseframe.BaseCoordinateFrame], NoneType] = None, start: Optional[Tuple[astropy.units.quantity.Quantity, astropy.units.quantity.Quantity]] = None, stop: Optional[Tuple[astropy.units.quantity.Quantity, astropy.units.quantity.Quantity]] = None, offset: Optional[Tuple[astropy.units.quantity.Quantity, astropy.units.quantity.Quantity, Union[str, astropy.coordinates.baseframe.BaseCoordinateFrame, Type[astropy.coordinates.baseframe.BaseCoordinateFrame]]]] = None, speed: Optional[astropy.units.quantity.Quantity] = None, integration: Optional[astropy.units.quantity.Quantity] = None, id: Any = None)[source]#

Bases: object

Parameters:
  • mode (ObservationMode) –

  • target (Optional[Union[str, Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]]) –

  • reference (Optional[Union[str, Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]]) –

  • scan_frame (Optional[Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]) –

  • start (Optional[Tuple[Quantity, Quantity]]) –

  • stop (Optional[Tuple[Quantity, Quantity]]) –

  • offset (Optional[Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]) –

  • speed (Optional[Quantity]) –

  • integration (Optional[Quantity]) –

  • id (Any) –

mode: ObservationMode#

Observation mode.

target: Optional[Union[str, Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]] = None#

Coordinate or name of the target object.

reference: Optional[Union[str, Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]] = None#

Coordinate or name of the object the other coordinate is defined relative to.

scan_frame: Optional[Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]] = None#

Coordinate frame in which the scan is performed.

start: Optional[Tuple[Quantity, Quantity]] = None#

Start position of the scan. The frame is defined in scan_frame.

stop: Optional[Tuple[Quantity, Quantity]] = None#

Stop position of the scan. The frame is defined in scan_frame.

offset: Optional[Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]] = None#

Offset applied to all the coordinates specified above.

speed: Optional[Quantity] = None#

Scan speed.

integration: Optional[Quantity] = None#

Integration time.

id: Any = None#

Identifier of the coordinate, if necessary.

property is_scan: bool#

Whether this coordinate contains enough information to perform a scan.

property with_offset: bool#

Whether this coordinate should be offset by certain amount.

property name_query: bool#

Whether the target is specified by its name.

property coordinates: SkyCoord#

Return a list of coordinates this section represents.

Warning

This property doesn’t perform accurate coordinate calculation when coordinates in AltAz frame is involved. Please use neclib.coordinates.convert module for accurate coordinate calculation.

class ObservationSpec(**kwargs)[source]#

Bases: Parameters, ABC

abstract observe()[source]#

Define all the observation steps which will be interpreted and commanded.

Return type:

Generator[Waypoint, None, None]

hot(id=None, integration=None)[source]#
Parameters:
  • id (Optional[Any]) –

  • integration (Optional[Quantity]) –

off(id=None, integration=None, *, relative=None, on_coord=None, off_coord=None)[source]#
Parameters:
  • id (Optional[Any]) –

  • integration (Optional[Quantity]) –

  • relative (Optional[bool]) –

  • on_coord (Optional[Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]) –

  • off_coord (Optional[Tuple[Quantity, Quantity, Union[str, BaseCoordinateFrame, Type[BaseCoordinateFrame]]]]) –

Return type:

Waypoint

property coords: DataFrame#

Crudely calculated waypoints this object represents.

Warning

This property doesn’t perform accurate coordinate calculation when coordinates in AltAz frame is involved.

property fig: Figure#

Figure of crudely calculated telescope driving path.

Notes

If you need Axes object, use fig.axes attribute.