panoptes.pocs package

Subpackages

Submodules

panoptes.pocs.base module

Common base utilities for POCS classes.

Provides PanBase, which centralizes access to configuration, logging, and the shared lightweight database handle used throughout the project.

class panoptes.pocs.base.PanBase(config_host=None, config_port=None, *args, **kwargs)[source]

Bases: object

Base class for other classes within the PANOPTES ecosystem

Defines common properties for each class (e.g. logger, config, db).

clear_config_cache()[source]

Clear the config cache.

get_config(key: str, default: Any | None = None, remember: bool = False, *args, **kwargs) Any[source]

Thin-wrapper around client based get_config that sets default port.

See panoptes.utils.config.client.get_config for more information.

Parameters:
  • key (str) – The key name to use, can be namespaced with dots.

  • default (any) – The default value to return if the key is not found.

  • remember (bool) – If True, cache the result for future calls.

  • *args – Passed to get_config

  • **kwargs – Passed to get_config

Returns:

The retrieved configuration value, or the provided default if not found

or if the config server is unavailable.

Return type:

Any

set_config(key, new_value, *args, **kwargs)[source]

Thin-wrapper around client based set_config that sets default port.

See panoptes.utils.config.client.set_config for more information.

Parameters:
  • key (str) – The key name to use, can be namespaced with dots.

  • new_value (any) – The value to store.

  • *args – Passed to set_config

  • **kwargs – Passed to set_config

Returns:

The value returned by the config client after setting, or None

if the config server is unavailable.

Return type:

Any | None

panoptes.pocs.core module

panoptes.pocs.hardware module

Information about hardware supported by Panoptes.

class panoptes.pocs.hardware.HardwareName(*values)[source]

Bases: Enum

Enumeration of top-level hardware categories supported by POCS.

Members correspond to hardware subsystems that may have real drivers or simulators enabled via configuration (see get_simulator_names).

camera = 'camera'
dome = 'dome'
mount = 'mount'
night = 'night'
power = 'power'
sensors = 'sensors'
theskyx = 'theskyx'
weather = 'weather'
panoptes.pocs.hardware.get_all_names(all_names=None, without=None)[source]

Return the names of all the categories of hardware that POCS supports.

Note

This doesn’t extend to the Arduinos for the telemetry and camera boards, for which no simulation is supported at this time.

Examples

>>> from panoptes.pocs.hardware import get_all_names
>>> get_all_names()
['camera', 'dome', 'mount', 'night', 'power', 'sensors', 'theskyx', 'weather']
>>> get_all_names(without='mount')  # Single item
['camera', 'dome', 'night', 'power', 'sensors', 'theskyx', 'weather']
>>> get_all_names(without=['mount', 'power'])  # List
['camera', 'dome', 'night', 'sensors', 'theskyx', 'weather']

# You can alter available hardware if needed. >>> get_all_names([‘foo’, ‘bar’, ‘power’], without=[‘power’]) [‘bar’, ‘foo’]

Parameters:
  • all_names (list) – The list of hardware.

  • without (Iterable) – Return all items except those in the list.

Returns:

The sorted list of available hardware except those listed in without.

Return type:

list

panoptes.pocs.hardware.get_simulator_names(simulator: str | list | None = None, kwargs=None)[source]

Return the names of the simulators to be used in lieu of hardware drivers.

Note

Returning a list containing ‘X’ doesn’t mean that the config calls for a driver of type ‘X’; that is up to the code working with the config to create drivers for real or simulated hardware.

This function is intended to be called from PanBase or similar, which receives kwargs that may include simulator, config or both.

Examples

get_simulator_names(config=self.config, kwargs=kwargs)

# Or:

get_simulator_names(simulator=simulator, config=self.config)

>>> from panoptes.pocs.hardware import get_simulator_names
>>> get_simulator_names()
[]
>>> get_simulator_names('all')
['camera', 'dome', 'mount', 'night', 'power', 'sensors', 'theskyx', 'weather']
Parameters:
  • simulator (str | list | None) – An explicit list of names of hardware to be simulated (i.e. hardware drivers to be replaced with simulators).

  • kwargs (dict | None) – The kwargs passed in to the caller, which is inspected for an arg called ‘simulator’.

Returns:

Names of the hardware to be simulated.

Return type:

list

panoptes.pocs.images module

Image helpers for FITS headers, WCS solving, and pointing comparisons.

Provides the Image class, a lightweight utility that loads FITS headers, lazily solves for WCS (via panoptes-utils), and offers helpers to compute the pointing and pointing error between images.

class panoptes.pocs.images.Image(fits_file: Path, wcs_file=None, location=None, *args, **kwargs)[source]

Bases: PanBase

Represents a single FITS image and associated pointing metadata.

Loads core header values (DATE-OBS, EXPTIME), optionally reads/solves WCS, and exposes convenience properties for header pointing vs. WCS pointing and their differences.

compute_offset(ref_image)[source]

Compute pointing offset relative to a reference Image.

Parameters:

ref_image (Image) – The reference image to compare against.

Returns:

Named tuple of (delta_ra, delta_dec, magnitude) in arcseconds.

Return type:

OffsetError

get_header_pointing()[source]

Get the pointing information from the header

The header should contain the RA-MNT and DEC-MNT keywords, from which the header pointing coordinates are built.

get_wcs_pointing()[source]

Get the pointing information from the WCS

Builds the pointing coordinates from the plate-solved WCS. These will be compared with the coordinates stored in the header.

property pointing_error

Pointing error namedtuple (delta_ra, delta_dec, magnitude)

Returns pointing error information. The first time this is accessed this will solve the field if not previously solved.

Returns:

Pointing error information

Return type:

namedtuple

solve_field(radius=15, **kwargs)[source]

Solve field and populate WCS information.

Parameters:
  • radius (scalar) – The radius (in degrees) to search near RA-Dec. Defaults to 15°.

  • **kwargs – Options to be passed to get_solve_field.

property wcs_file

WCS file name

When setting the WCS file name, the WCS information will be read, setting the wcs property.

class panoptes.pocs.images.OffsetError(delta_ra, delta_dec, magnitude)

Bases: tuple

delta_dec

Alias for field number 1

delta_ra

Alias for field number 0

magnitude

Alias for field number 2

panoptes.pocs.observatory module

Module contents