necst.core.observation_check

Static observation-file check and dry-run planning helpers.

The functions in this module are intentionally read-only. They parse and inspect observation parameter files, but they never acquire NECST privilege, move the antenna, move the chopper, touch recorder/gate state, or apply SG settings. They are shared by CLI-like operator actions and the web Operator Console so that Check / Dry run semantics stay consistent.

exception ObservationCheckError[source]

Bases: ValueError

Raised when an observation file cannot pass static validation.

class ObservationCheckReport(ok, mode, file, channel, summary, data=<factory>, warnings=<factory>, errors=<factory>)[source]

Bases: object

Machine-readable report returned by Check / Dry run.

Parameters:
  • ok (bool) –

  • mode (str) –

  • file (str) –

  • channel (Optional[int]) –

  • summary (str) –

  • data (Dict[str, Any]) –

  • warnings (list[str]) –

  • errors (list[str]) –

ok: bool
mode: str
file: str
channel: Optional[int]
summary: str
data: Dict[str, Any]
warnings: list[str]
errors: list[str]
to_dict()[source]
Return type:

Dict[str, Any]

normalize_observation_mode(mode)[source]
Parameters:

mode (Any) –

Return type:

str

optional_positive_int(value, *, name)[source]
Parameters:
  • value (Any) –

  • name (str) –

Return type:

Optional[int]

validate_obs_file_path(file_path, *, require_exists)[source]
Parameters:
  • file_path (Any) –

  • require_exists (bool) –

Return type:

Path

check_observation_file(mode, file_path, *, channel=None, require_exists=True, use_neclib_parser=True)[source]

Perform read-only static observation-file validation.

Parameters:
  • mode (Any) –

  • file_path (Any) –

  • channel (Any) –

  • require_exists (bool) –

  • use_neclib_parser (bool) –

Return type:

ObservationCheckReport

dry_run_observation_plan(mode, file_path, *, channel=None, require_exists=True, use_neclib_parser=True)[source]

Build a read-only execution-plan preview for a file-based observation.

Parameters:
  • mode (Any) –

  • file_path (Any) –

  • channel (Any) –

  • require_exists (bool) –

  • use_neclib_parser (bool) –

Return type:

ObservationCheckReport