neclib.coordinates.paths.scan_block module#

Aliases#

ControlContext

ControlContext(tight: ‘Optional[bool]’ = None, start: ‘Optional[float]’ = None, stop: ‘Optional[float]’ = None, duration: ‘Optional[float]’ = None, infinite: ‘bool’ = False, waypoint: ‘bool’ = False, kind: ‘str’ = ‘’, label: ‘str’ = ‘’, line_index: ‘int’ = -1, section_plan_index: ‘int’ = -1, section_sequence_index: ‘int’ = -1, section_uid: ‘str’ = ‘’, geometry_valid: ‘bool’ = False, section_frame: ‘str’ = ‘’, section_unit: ‘str’ = ‘’, section_start_lon_deg: ‘float’ = nan, section_start_lat_deg: ‘float’ = nan, section_stop_lon_deg: ‘float’ = nan, section_stop_lat_deg: ‘float’ = nan, section_speed_deg_per_sec: ‘float’ = nan)

Index

Index(time: ‘NPArrayValidator’, index: ‘NPArrayValidator’)

Linear

None

Path

None

config

None

get_logger

Get logger instance which prints operation logs to console.

get_quantity

Convert a value to astropy Quantity.

class ScanBlockKinematicLimits(max_speed: 'u.Quantity', max_acceleration: 'u.Quantity', max_jerk: 'Optional[u.Quantity]' = None)[source]#

Bases: object

Parameters:
  • max_speed (Quantity)

  • max_acceleration (Quantity)

  • max_jerk (Quantity | None)

max_speed: Quantity#
max_acceleration: Quantity#
max_jerk: Quantity | None = None#
conservative_antenna_kinematic_limits(*, speed_headroom=1.0, acceleration_headroom=1.0, jerk_headroom=1.0)[source]#
Parameters:
  • speed_headroom (float)

  • acceleration_headroom (float)

  • jerk_headroom (float)

Return type:

ScanBlockKinematicLimits

evaluate_single_line_edge_kinematics(*, speed, margin, unit=None, limits=None)[source]#
Parameters:
  • speed (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

  • margin (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

  • unit (UnitBase | str | None)

  • limits (ScanBlockKinematicLimits | None)

Return type:

Dict[str, Quantity]

evaluate_curved_turn_kinematics(*, start, stop, entry_direction, exit_direction, speed, turn_radius_hint=None, unit=None, limits=None, samples=2001)[source]#
Parameters:
  • start (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • stop (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • entry_direction (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • exit_direction (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • speed (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

  • turn_radius_hint (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None)

  • unit (UnitBase | str | None)

  • limits (ScanBlockKinematicLimits | None)

  • samples (int)

Return type:

Dict[str, Quantity]

single_line_required_acceleration(line)[source]#
Parameters:

line (ScanBlockLine)

Return type:

Quantity

plan_scan_block_kinematics(lines, *, speed_headroom=1.0, acceleration_headroom=1.0, jerk_headroom=1.0, samples=2001)[source]#
Parameters:
  • lines (Sequence[ScanBlockLine])

  • speed_headroom (float)

  • acceleration_headroom (float)

  • jerk_headroom (float)

  • samples (int)

Return type:

Dict[str, Any]

class ScanBlockLine(start, stop, speed, margin, label='', line_index=-1)[source]#

Bases: object

High-level description of one observed line inside a scan block.

Parameters are interpreted in scan_frame of the block. margin is the along-scan distance used to define the true standby point

margin_start = start - unit_vector * margin

and the final deceleration destination

margin_stop = stop + unit_vector * margin.

Parameters:
  • start (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • stop (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • speed (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

  • margin (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

  • label (str)

  • line_index (int)

start: Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]#
stop: Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]#
speed: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity#
margin: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity#
label: str = ''#
line_index: int = -1#
class ScanBlockSection(kind, start, stop=None, speed=None, margin=None, duration=None, label='', line_index=-1, tight=None, turn_radius_hint=None)[source]#

Bases: object

Low-level section description consumed by PathFinder.scan_block().

Parameters:
  • kind (str)

  • start (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity])

  • stop (Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity] | None)

  • speed (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None)

  • margin (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None)

  • duration (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None)

  • label (str)

  • line_index (int)

  • tight (bool | None)

  • turn_radius_hint (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None)

kind: str#
start: Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]#
stop: Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity] | None = None#
speed: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None = None#
margin: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None = None#
duration: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None = None#
label: str = ''#
line_index: int = -1#
tight: bool | None = None#
turn_radius_hint: int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity | None = None#
class Hold(calc, *target, unit=None, point, frame, duration, offset=None, cos_correction=False, **ctx_kw)[source]#

Bases: Path

Hold at a single coordinate for a finite duration.

Parameters:
  • calc (CoordCalculator)

  • target (Union[str, DimensionLess, u.Quantity, CoordFrameType])

  • unit (Optional[UnitType])

  • point (Tuple[T, T])

  • frame (CoordFrameType)

  • duration (T)

  • offset (Optional[Tuple[T, T, CoordFrameType]])

  • cos_correction (bool)

  • ctx_kw (Any)

tight: bool = False#
infinite: bool = False#
waypoint: bool = False#
property n_cmd: int#
property target_frame: str | BaseCoordinateFrame | Type[BaseCoordinateFrame]#
property lonlat_func: Callable[[Index], Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]]#
property arguments: Tuple[Tuple[Any, ...], Dict[str, Any]]#
class ScanBlockAccelerate(calc, *target, unit=None, start, stop, scan_frame, speed, offset=None, margin=None, cos_correction=False, **ctx_kw)[source]#

Bases: Linear

Jerk-smooth scan-block entry from standby point to line start.

Parameters:
  • calc (CoordCalculator)

  • target (Union[str, DimensionLess, u.Quantity, CoordFrameType])

  • unit (Optional[UnitType])

  • start (Tuple[T, T])

  • stop (Tuple[T, T])

  • scan_frame (CoordFrameType)

  • speed (T)

  • offset (Optional[Tuple[T, T, CoordFrameType]])

  • margin (Optional[T])

  • cos_correction (bool)

  • ctx_kw (Any)

tight: bool = False#
infinite: bool = False#
waypoint: bool = False#
property n_cmd: int#
property lonlat_func: Callable[[Index], Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]]#
class Decelerate(calc, *target, unit=None, start, stop, scan_frame, speed, offset=None, margin=None, cos_correction=False, **ctx_kw)[source]#

Bases: Linear

Mirror of ScanBlockAccelerate from line stop to final standby point.

Parameters:
  • calc (CoordCalculator)

  • target (Union[str, DimensionLess, u.Quantity, CoordFrameType])

  • unit (Optional[UnitType])

  • start (Tuple[T, T])

  • stop (Tuple[T, T])

  • scan_frame (CoordFrameType)

  • speed (T)

  • offset (Optional[Tuple[T, T, CoordFrameType]])

  • margin (Optional[T])

  • cos_correction (bool)

  • ctx_kw (Any)

tight: bool = False#
infinite: bool = False#
waypoint: bool = False#
property n_cmd: int#
property lonlat_func: Callable[[Index], Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]]#
class CurvedTurn(calc, *target, unit=None, start, stop, scan_frame, entry_direction, exit_direction, speed, turn_radius_hint=None, offset=None, cos_correction=False, **ctx_kw)[source]#

Bases: Path

Rest-to-rest curved turn between two standby points.

Geometry is defined by a cubic Bezier curve in the scan frame. The time parameter uses a septic smoothstep

σ(τ) = 35τ^4 - 84τ^5 + 70τ^6 - 20τ^7

so start/end velocity, acceleration, and jerk are all zero.

Parameters:
  • calc (CoordCalculator)

  • target (Union[str, DimensionLess, u.Quantity, CoordFrameType])

  • unit (Optional[UnitType])

  • start (Tuple[T, T])

  • stop (Tuple[T, T])

  • scan_frame (CoordFrameType)

  • entry_direction (Tuple[T, T])

  • exit_direction (Tuple[T, T])

  • speed (T)

  • turn_radius_hint (Optional[T])

  • offset (Optional[Tuple[T, T, CoordFrameType]])

  • cos_correction (bool)

  • ctx_kw (Any)

tight: bool = False#
infinite: bool = False#
waypoint: bool = False#
property n_cmd: int#
property target_frame: str | BaseCoordinateFrame | Type[BaseCoordinateFrame]#
property lonlat_func: Callable[[Index], Tuple[int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity, int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity]]#
property arguments: Tuple[Tuple[Any, ...], Dict[str, Any]]#
margin_start_of(line)[source]#
Parameters:

line (ScanBlockLine)

Return type:

Tuple[Quantity, Quantity]

margin_stop_of(line)[source]#
Parameters:

line (ScanBlockLine)

Return type:

Tuple[Quantity, Quantity]

build_scan_block_sections(lines, *, include_initial_standby=True, include_final_decelerate=True, include_final_standby=False, final_standby_duration=<Quantity 1. s>)[source]#
Parameters:
  • lines (Sequence[ScanBlockLine])

  • include_initial_standby (bool)

  • include_final_decelerate (bool)

  • include_final_standby (bool)

  • final_standby_duration (int | float | ndarray[Any, dtype[number]] | Array[int | float] | Quantity)

Return type:

List[ScanBlockSection]