necst.az_unwrap_limits

Safety helpers for Az commands when absolute Az unwrap is disabled.

This module intentionally lives at the top level of necst, not under necst.ctrl.antenna. Core modules such as commander.py are imported while necst.core is still being initialised; importing necst.ctrl from there pulls in antenna controller modules and can create a circular import. The helpers here depend only on the already-loaded NECST configuration.

load_unwrap_disabled_mount_az_limit()[source]

Return raw-Az command limits when absolute unwrap is configured off.

When an absolute-modulo Az encoder is configured but antenna_encoder_unwrap.az.enabled is false, the control system has no branch information. In that state Az commands must be confined to the raw absolute encoder range (normally 0..360 deg). If no unwrap section exists, return None so NANTEN2/incremental-encoder configurations are unchanged.

Return type:

Optional[dict]

assert_mount_az_allowed_when_unwrap_disabled(az_deg, *, action_label='Az target')[source]

Reject Az commands outside raw range when unwrap is configured off.

This is a fail-closed guard for absolute-modulo encoders. It intentionally uses the configured raw absolute encoder range, not the wider continuous drive range, because without unwrap the controller cannot distinguish e.g. 10 deg from 370 deg.

Parameters:
  • az_deg (Any) –

  • action_label (str) –

Return type:

Optional[dict]