panoptes.pocs package

Subpackages

Submodules

panoptes.pocs.base module

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).

get_config(*args, **kwargs)[source]

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

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

Parameters:
  • *args – Passed to get_config

  • **kwargs – Passed to get_config

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

panoptes.pocs.core module

panoptes.pocs.hardware module

Information about hardware supported by Panoptes.

class panoptes.pocs.hardware.HardwareName(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

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]

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

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

>>> 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 expect 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=None, kwargs=None)[source]

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

Note that 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. For example:

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

# Or:

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

The reason this function doesn’t just take **kwargs as its sole arg is that we need to allow for the case where the caller is passing in simulator (or config) twice, once on its own, and once in the kwargs (which won’t be examined). Python doesn’t permit a keyword argument to be passed in twice.

>>> 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 (list) – An explicit list of names of hardware to be simulated (i.e. hardware drivers to be replaced with simulators).

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

Returns:

List of names of the hardware to be simulated.

panoptes.pocs.images module

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

Bases: PanBase

compute_offset(ref_image)[source]
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