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.
- get_capabilities(interface: type[Interface]) Any | None[source]
Return the capabilities for the given interface, or None.
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,IAbortableThe module can acquire a target, usually by accessing a telescope and a camera.
- abstractmethod 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:
IAbortableThe module can perform an autofocus.
- abstractmethod async auto_focus(count: int, step: float, exposure_time: ~typing.Annotated[float, <Unit.SECONDS: 'seconds'>], **kwargs: ~typing.Any) AutoFocusResult[source]
Perform an autofocus series.
This method performs an autofocus 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:
Result of autofocus.
- Raises:
ValueError – If focus could not be obtained.
- state
alias of
AutoFocusState
IAutoGuiding
- class IAutoGuiding
Bases:
IStartStop,IExposureTimeThe module can perform auto-guiding.
IAutonomous
- class IAutonomous
Bases:
IStartStopThe module does some autonomous actions, mainly used for warnings to users.
IBinning
- class IBinning
Bases:
InterfaceThe camera supports binning, to be used together with
ICamera.- capabilities
alias of
BinningCapabilities
- abstractmethod async set_binning(x: int, y: int, **kwargs: Any) None[source]
Set the camera binning.
- Parameters:
x – X binning.
y – Y binning.
- Raises:
ValueError – If binning could not be set.
- state
alias of
BinningState
ICalibrate
ICamera
IConfig
- class IConfig
Bases:
InterfaceThe module allows access to some of its configuration options.
- capabilities
alias of
ConfigCapabilities
ICooling
- class ICooling
Bases:
ITemperaturesThe module can control the cooling of a device.
- abstractmethod async set_cooling(enabled: bool, setpoint: ~typing.Annotated[float, <Unit.CELSIUS: 'celsius'>], **kwargs: ~typing.Any) None[source]
Enables/disables cooling and sets setpoint.
- Parameters:
enabled – Enable or disable cooling.
setpoint – Setpoint in celsius for the cooling.
- Raises:
ValueError – If cooling could not be set.
- state
alias of
CoolingState
IData
- class IData
Bases:
InterfaceThe module can grab and return an image from whatever device.
- abstractmethod 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,IPointingAltAzThe module controls a dome, i.e. a
IRoofwith a rotating roof.
IExposure
IExposureTime
- class IExposureTime
Bases:
InterfaceThe camera supports exposure times, to be used together with
ICamera.- abstractmethod async set_exposure_time(exposure_time: ~typing.Annotated[float, <Unit.SECONDS: 'seconds'>], **kwargs: ~typing.Any) None[source]
Set the exposure time in seconds.
- Parameters:
exposure_time – Exposure time in seconds.
- Raises:
ValueError – If exposure time could not be set.
- state
alias of
ExposureTimeState
IFilters
- class IFilters
Bases:
IMotionThe module can change filters in a device.
- capabilities
alias of
FiltersCapabilities
- abstractmethod async set_filter(filter_name: str, **kwargs: Any) None[source]
Set the current filter.
- Parameters:
filter_name – Name of filter to set.
- Raises:
ValueError – If an invalid filter was given.
MoveError – If filter wheel cannot be moved.
- state
alias of
FilterState
IFitsHeaderAfter
- class IFitsHeaderAfter
Bases:
InterfaceThe module provides some additional header entries for FITS headers after some event (usually the end of the exposure).
- abstractmethod async get_fits_header_after(namespaces: list[str] | None = None, **kwargs: Any) dict[str, FitsHeaderEntry][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:
InterfaceThe module provides some additional header entries for FITS headers before some event (usually the start of the exposure).
- abstractmethod async get_fits_header_before(namespaces: list[str] | None = None, **kwargs: Any) dict[str, FitsHeaderEntry][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:
IAbortableThe module performs flat-fielding.
IFocusModel
IFocuser
- class IFocuser
Bases:
IMotionThe module is a focusing device.
- abstractmethod async set_focus(focus: float, **kwargs: Any) None[source]
Sets new focus.
- Parameters:
focus – New focus value.
- Raises:
MoveError – If telescope cannot be moved.
InterruptedError – If movement was aborted.
- abstractmethod async set_focus_offset(offset: float, **kwargs: Any) None[source]
Sets focus offset.
- Parameters:
offset – New focus offset.
- Raises:
ValueError – If given value is invalid.
MoveError – If telescope cannot be moved.
- state
alias of
FocuserState
IGain
- class IGain
Bases:
InterfaceThe camera supports setting of gain, to be used together with
ICamera.- abstractmethod async set_gain(gain: float, **kwargs: Any) None[source]
Set the camera gain.
- Parameters:
gain – New camera gain.
- Raises:
ValueError – If gain could not be set.
- abstractmethod async set_offset(offset: float, **kwargs: Any) None[source]
Set the camera offset.
- Parameters:
offset – New camera offset.
- Raises:
ValueError – If offset could not be set.
- state
alias of
GainState
IImageFormat
- class IImageFormat
Bases:
InterfaceThe module supports different image formats (e.g. INT16, FLOAT32), mainly used by cameras.
- capabilities
alias of
ImageFormatCapabilities
- abstractmethod 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.
- state
alias of
ImageFormatState
IImageType
- class IImageType
Bases:
InterfaceThe module supports different image types (e.g. object, bias, dark, etc), mainly used by cameras.
- abstractmethod async set_image_type(image_type: ImageType, **kwargs: Any) None[source]
Set the image type.
- Parameters:
image_type – New image type.
- state
alias of
ImageTypeState
ILatLon
IMode
- class IMode
Bases:
InterfaceThe module can change modes in a device.
- capabilities
alias of
ModeCapabilities
- abstractmethod async set_mode(mode: str, group: int = 0, **kwargs: Any) None[source]
Set the current mode.
- Parameters:
mode – Name of mode to set.
group – Group number
- Raises:
ValueError – If an invalid mode was given.
MoveError – If mode selector cannot be moved.
- state
alias of
ModeState
IModule
IMotion
- class IMotion
Bases:
IReadyThe module controls a device that can move.
- abstractmethod async init(**kwargs: Any) None[source]
Initialize device.
- Raises:
InitError – If device could not be initialized.
- abstractmethod async park(**kwargs: Any) None[source]
Park device.
- Raises:
ParkError – If device could not be parked.
- state
alias of
MotionState
IMultiFiber
- class IMultiFiber
Bases:
InterfaceAn interface for multi-fiber setups that helps to set/get a fiber and retrieve position and size of the current fiber on the acquisition/guiding image.
- capabilities
alias of
MultiFiberCapabilities
- abstractmethod async set_fiber(fiber: str, **kwargs: Any) None[source]
Sets the currently active fiber. Must be in fiber_names capability.
- Parameters:
fiber – Name of fiber to set.
- state
alias of
MultiFiberState
IOffsetsAltAz
- class IOffsetsAltAz
Bases:
InterfaceThe module supports Alt/Az offsets, usually combined with
ITelescopeandIPointingAltAz.- abstractmethod async set_offsets_altaz(dalt: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], daz: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Move an Alt/Az offset.
- Parameters:
dalt – Altitude offset in degrees.
daz – Azimuth offset in degrees.
- Raises:
MoveError – If device could not be moved.
- state
alias of
AltAzOffsetState
IOffsetsRaDec
- class IOffsetsRaDec
Bases:
InterfaceThe module supports RA/Dec offsets, usually combined with
ITelescopeandIPointingRaDec.- abstractmethod async set_offsets_radec(dra: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], ddec: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Move an RA/Dec offset.
- Parameters:
dra – RA offset in degrees.
ddec – Dec offset in degrees.
- Raises:
MoveError – If telescope cannot be moved.
- state
alias of
RaDecOffsetState
IPointingAltAz
- class IPointingAltAz
Bases:
InterfaceThe module can move to Alt/Az coordinates, usually combined with
ITelescope.- abstractmethod async move_altaz(alt: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], az: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Moves to given coordinates.
- Parameters:
alt – Alt in deg to move to.
az – Az in deg to move to.
- Raises:
MoveError – If device could not be moved.
- state
alias of
AltAzState
IPointingHGS
- class IPointingHGS
Bases:
InterfaceThe module can move to Mu/Psi coordinates, usually combined with
ITelescope.- abstractmethod async move_hgs_lon_lat(lon: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], lat: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Moves on given coordinates.
- Parameters:
lon – Longitude in deg to track.
lat – Latitude in deg to track.
- Raises:
MoveError – If device could not be moved.
- state
alias of
HGSState
IPointingHelioprojective
- class IPointingHelioprojective
Bases:
InterfaceThe module can move to Mu/Psi coordinates, usually combined with
ITelescope.- abstractmethod async move_helioprojective(theta_x: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], theta_y: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Moves on given coordinates.
- Parameters:
theta_x – The theta_x coordinate.
theta_y – The theta_y coordinate.
- Raises:
MoveError – If device could not be moved.
- state
alias of
HelioprojectiveState
IPointingRaDec
- class IPointingRaDec
Bases:
InterfaceThe module can move to RA/Dec coordinates, usually combined with
ITelescope.- abstractmethod async move_radec(ra: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], dec: ~typing.Annotated[float, <Unit.DEGREES: 'deg'>], **kwargs: ~typing.Any) None[source]
Starts tracking on given coordinates.
- Parameters:
ra – RA in deg to track.
dec – Dec in deg to track.
- Raises:
MoveError – If device could not be moved.
- state
alias of
RaDecState
IPointingSeries
IReady
IRoof
IRotation
IRunnable
- class IRunnable
Bases:
IAbortableThe module has some action that can be started remotely.
IRunning
IScriptRunner
ISpectrograph
IStartStop
ISyncTarget
- class ISyncTarget
Bases:
InterfaceThe module can synchronize a target, e.g. via a telescope control software behinde an
ITelescope.
ITelescope
ITemperatures
IVideo
IWeather
- class IWeather
Bases:
IStartStopThe module acts as a weather station.
- abstractmethod async get_sensor_value(station: str, sensor: WeatherSensors, **kwargs: Any) WeatherSensorReading[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:
Current reading for the given sensor.
- state
alias of
WeatherState
IWindow
- class IWindow
Bases:
InterfaceThe camera supports windows, to be used together with
ICamera.- capabilities
alias of
WindowCapabilities
- abstractmethod async set_window(left: int, top: int, width: int, height: int, **kwargs: Any) None[source]
Set the camera window.
- Parameters:
left – X offset of window.
top – Y offset of window.
width – Width of window.
height – Height of window.
- Raises:
ValueError – If window could not be set.
- state
alias of
WindowState