Interfaces (pyobs.interfaces)
Using interface, a Module
signals another one, what functionality it provides for remote
procedure calls. The base class for all interfaces in pyobs is:
- class Interface
Base class for all interfaces in pyobs.
Modules need to implement the required interfaces. For instance, if a module operates a camera, it probably should
implement ICamera
.
IAbortable
IAcquisition
- class IAcquisition
Bases:
IRunning
,IAbortable
The module can acquire a target, usually by accessing a telescope and a camera.
- abstract async acquire_target(**kwargs: Any) Dict[str, Any] [source]
Acquire target at given coordinates.
If no RA/Dec are given, start from current position. Might not work for some implementations that require coordinates.
- Returns:
A dictionary with entries for datetime, ra, dec, alt, az, and either off_ra, off_dec or off_alt, off_az.
- Raises:
ValueError – If target could not be acquired.
IAutoFocus
- class IAutoFocus
Bases:
IAbortable
The module can perform an auto-focus.
- abstract async auto_focus(count: int, step: float, exposure_time: float, **kwargs: Any) Tuple[float, float] [source]
Perform an auto-focus series.
This method performs an auto-focus series with “count” images on each side of the initial guess and the given step size. With count=3, step=1 and guess=10, this takes images at the following focus values: 7, 8, 9, 10, 11, 12, 13
- Parameters:
count – Number of images to take on each side of the initial guess. Should be an odd number.
step – Step size.
exposure_time – Exposure time for images.
- Returns:
Tuple of obtained best focus value and its uncertainty.
- Raises:
ValueError – If focus could not be obtained.
IAutoGuiding
- class IAutoGuiding
Bases:
IStartStop
,IExposureTime
The module can perform auto-guiding.
IAutonomous
- class IAutonomous
Bases:
IStartStop
The module does some autonomous actions, mainly used for warnings to users.
IBinning
- class IBinning
Bases:
Interface
The camera supports binning, to be used together with
ICamera
.- abstract async get_binning(**kwargs: Any) Tuple[int, int] [source]
Returns the camera binning.
- Returns:
Tuple with x and y.
ICalibrate
ICamera
IConfig
- class IConfig
Bases:
Interface
The module allows access to some of its configuration options.
- abstract async get_config_caps(**kwargs: Any) Dict[str, Tuple[bool, bool, bool]] [source]
Returns dict of all config capabilities. First value is whether it has a getter, second is for the setter, third is for a list of possible options..
- Returns:
Dict with config caps
- abstract async get_config_value(name: str, **kwargs: Any) Any [source]
Returns current value of config item with given name.
- Parameters:
name – Name of config item.
- Returns:
Current value.
- Raises:
ValueError – If config item of given name does not exist.
ICooling
- class ICooling
Bases:
ITemperatures
The module can control the cooling of a device.
- abstract async get_cooling(**kwargs: Any) Tuple[bool, float, float] [source]
Returns the current status for the cooling.
- Returns:
- Tuple containing:
Enabled: Whether the cooling is enabled SetPoint: Setpoint for the cooling in celsius. Power: Current cooling power in percent or None.
- Return type:
(tuple)
IData
- class IData
Bases:
Interface
The module can grab and return an image from whatever device.
- abstract async grab_data(broadcast: bool = True, **kwargs: Any) str [source]
Grabs an image and returns reference.
- Parameters:
broadcast – Broadcast existence of image.
- Returns:
Name of image that was taken.
- Raises:
GrabImageError – If there was a problem grabbing the image.
IDome
- class IDome
Bases:
IRoof
,IPointingAltAz
The module controls a dome, i.e. a
IRoof
with a rotating roof.
IExposure
- class IExposure
Bases:
Interface
The module controls a camera.
- abstract async get_exposure_progress(**kwargs: Any) float [source]
Returns the progress of the current exposure in percent.
- Returns:
Progress of the current exposure in percent.
- abstract async get_exposure_status(**kwargs: Any) ExposureStatus [source]
Returns the current status of the camera, which is one of ‘idle’, ‘exposing’, or ‘readout’.
- Returns:
Current status of camera.
IExposureTime
- class IExposureTime
Bases:
Interface
The camera supports exposure times, to be used together with
ICamera
.- abstract async get_exposure_time(**kwargs: Any) float [source]
Returns the exposure time in seconds.
- Returns:
Exposure time in seconds.
IFilters
- class IFilters
Bases:
IMotion
The module can change filters in a device.
- abstract async get_filter(**kwargs: Any) str [source]
Get currently set filter.
- Returns:
Name of currently set filter.
IFitsHeaderAfter
- class IFitsHeaderAfter
Bases:
Interface
The module provides some additional header entries for FITS headers after some event (usually the end of the exposure).
- abstract async get_fits_header_after(namespaces: List[str] | None = None, **kwargs: Any) Dict[str, Tuple[Any, str]] [source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
IFitsHeaderBefore
- class IFitsHeaderBefore
Bases:
Interface
The module provides some additional header entries for FITS headers before some event (usually the start of the exposure).
- abstract async get_fits_header_before(namespaces: List[str] | None = None, **kwargs: Any) Dict[str, Tuple[Any, str]] [source]
Returns FITS header for the current status of this module.
- Parameters:
namespaces – If given, only return FITS headers for the given namespaces.
- Returns:
Dictionary containing FITS headers.
IFlatField
- class IFlatField
Bases:
IAbortable
The module performs flat-fielding.
IFocusModel
IFocuser
- class IFocuser
Bases:
IMotion
The module is a focusing device.
- abstract async get_focus(**kwargs: Any) float [source]
Return current focus.
- Returns:
Current focus.
- abstract async get_focus_offset(**kwargs: Any) float [source]
Return current focus offset.
- Returns:
Current focus offset.
IGain
IImageFormat
- class IImageFormat
Bases:
Interface
The module supports different image formats (e.g. INT16, FLOAT32), mainly used by cameras.
- abstract async get_image_format(**kwargs: Any) ImageFormat [source]
Returns the camera image format.
- Returns:
Current image format.
- abstract async list_image_formats(**kwargs: Any) List[str] [source]
List available image formats.
- Returns:
List of available image formats.
- abstract async set_image_format(fmt: ImageFormat, **kwargs: Any) None [source]
Set the camera image format.
- Parameters:
fmt – New image format.
- Raises:
ValueError – If format could not be set.
IImageType
ILatLon
- class ILatLon
Bases:
Interface
The module can move to general Lat/Lon coordinates, which have to be async defined by the module itself. Usually combined with
ITelescope
.
IModule
- class IModule
Bases:
Interface
The module is actually a module. Implemented by all modules.
- abstract async get_state(**kwargs: Any) ModuleState [source]
Returns current state of module.
IMotion
- class IMotion
Bases:
IReady
The module controls a device that can move.
- abstract async get_motion_status(device: str | None = None, **kwargs: Any) MotionStatus [source]
Returns current motion status.
- Parameters:
device – Name of device to get status for, or None.
- Returns:
A string from the Status enumerator.
- abstract async init(**kwargs: Any) None [source]
Initialize device.
- Raises:
InitError – If device could not be initialized.
IOffsetsAltAz
- class IOffsetsAltAz
Bases:
Interface
The module supports Alt/Az offsets, usually combined with
ITelescope
andIPointingAltAz
.
IOffsetsRaDec
- class IOffsetsRaDec
Bases:
Interface
The module supports RA/Dec offsets, usually combined with
ITelescope
andIPointingRaDec
.
IPointingAltAz
- class IPointingAltAz
Bases:
Interface
The module can move to Alt/Az coordinates, usually combined with
ITelescope
.
IPointingHGS
- class IPointingHGS
Bases:
Interface
The module can move to Mu/Psi coordinates, usually combined with
ITelescope
.
IPointingRaDec
- class IPointingRaDec
Bases:
Interface
The module can move to RA/Dec coordinates, usually combined with
ITelescope
.
IPointingSeries
- class IPointingSeries
Bases:
Interface
The module provides the interface for a device that initializes and finalizes a pointing series and adds points to it.
- abstract async add_pointing_measure(**kwargs: Any) None [source]
Add a new measurement to the pointing series.
IReady
IRoof
IRotation
IRunnable
- class IRunnable
Bases:
IAbortable
The module has some action that can be started remotely.
IRunning
IScriptRunner
ISpectrograph
IStartStop
ISyncTarget
- class ISyncTarget
Bases:
Interface
The module can synchronize a target, e.g. via a telescope control software behinde an
ITelescope
.
ITelescope
- class ITelescope
Bases:
IMotion
,IPointingAltAz
,IPointingRaDec
The module controls a telescope.
ITemperatures
IVideo
IWeather
- class IWeather
Bases:
IStartStop
The module acts as a weather station.
- abstract async get_current_weather(**kwargs: Any) Dict[str, Any] [source]
Returns current weather.
- Returns:
Dictionary containing entries for time, good, and sensor, with the latter being another dictionary with sensor information, which contain a value and a good flag.
- abstract async get_sensor_value(station: str, sensor: WeatherSensors, **kwargs: Any) Tuple[str, float] [source]
Return value for given sensor.
- Parameters:
station – Name of weather station to get value from.
sensor – Name of sensor to get value from.
- Returns:
Tuple of current value of given sensor or None and time of measurement or None.
IWindow
- class IWindow
Bases:
Interface
The camera supports windows, to be used together with
ICamera
.- abstract async get_full_frame(**kwargs: Any) Tuple[int, int, int, int] [source]
Returns full size of CCD.
- Returns:
Tuple with left, top, width, and height set.