# noctua.devices package

## Submodules

## noctua.devices.alpaca module

class noctua.devices.alpaca.AlpacaDevice(url, dev=None)

  Bases: `BaseDevice`

  Base wrapper class for ASCOM Alpaca devices

  property actions

    List the actions supported by the device.

  property addr

    Get or set the device URL address.

  command(val, cmd='commandstring')
  commandblind(val)
  property connection

    Get or set the connection status of the device.

  get(**kwargs)

    Modifies the func() method.

  property name

    Get the name of the device.

  put(**kwargs)

    Modifies the func() method.

class noctua.devices.alpaca.Dome(url)

  Bases: `AlpacaDevice`

  Wrapper for ASCOM Alpaca devices of “dome” type.

  abort()

    Abort the motion of the dome.

  property azimuth

    Get or set the dome azimuth.

  property is_moving

    Check if the dome is slewing.

  property is_parked

    Check if the dome is at its park position.

  property open

    Get the dome shutter position, or open/close it.

  park()

    Put the dome in its park position.

  property shutter

    Get the status of the dome shutter.

  property slave

    Check if the dome position is slaved to the telescope, or slave/unslave it.

  sync(az)

    Force the value of the dome azimuth to assume a specific value.

class noctua.devices.alpaca.Focuser(url)

  Bases: `AlpacaDevice`

  property is_moving
  property position

class noctua.devices.alpaca.Rotator(url)

  Bases: `AlpacaDevice`

  property is_moving
  property position

class noctua.devices.alpaca.Switch(url, id=3)

  Bases: `AlpacaDevice`

  Wrapper for ASCOM Alpaca devices of “switch” type.

  property description

    Describe the switch.

  property state

    Get or set the switch state.

class noctua.devices.alpaca.Telescope(url)

  Bases: `AlpacaDevice`

  abort()
  property altaz
  clear(n)
  property clock
  property cover
  property is_moving
  property offset
  property open
  property park
  property radec
  property state
  property status
  property targetradec
  property temperature
  track()
  property tracking

## noctua.devices.astelco module

Interface with an Astelco OpenTSI-based device

class noctua.devices.astelco.Focuser(url)

  Bases: `OpenTSI`

  Implementation of the Focuser commands mocking my Alpaca Telescope wrapper.

  property absolute

    Get Absolute focuser position from telnet

  property is_moving

    TBD with the right telnet commands

  property position

    Get Relative focuser position from telnet

class noctua.devices.astelco.OpenTSI(url)

  Bases: `BaseDevice`

  Base wrapper class for astelco OpenTSI stuff

  get(message)

    Send a telnet message to the cabinet to retrieve a value or a set of values.

  put(key, val)

    Send to telnet a key to set a a value. keys and values can be both lists with the same element number.

class noctua.devices.astelco.Rotator(url)

  Bases: `OpenTSI`

  Implementation of the Rotator commands mocking my Alpaca Telescope wrapper.

  property absolute

    Get Absolute rotator position from telnet

  property is_moving

    TBD with the right telnet commands

  property position

    Get Relative rotator position from telnet

class noctua.devices.astelco.Sensor(url, temp_id, hum_id)

  Bases: `OpenTSI`

  Implementation of a Sensor class.

  property humidity

    Does it have humidity sensors?

  property temperature

    Mirrors temperature

class noctua.devices.astelco.Telescope(url)

  Bases: `OpenTSI`

  Implementation of the Telescope commands mocking my Alpaca Telescope wrapper.

  abort()

    Direct way to stop tracking

  property altaz
  clear(n)
  property clock

    in UNIX time

  property coordinates

    Ask simultaneously RA2000, DEC2000, ALT, AZ, LST, UTC. Answer is given as a dict of decimal numbers. UTC is given as unix time.

  property cover
  property is_moving

    Check the motion state of the telescope

  property offset

    Get Telescope offset

  property open
  property park

    Get if the telescope is in parked position

  property radec

    Get Right Ascension / Declination

  property state
  property status

    need to check exit and error from get function

  property targetradec

    Get target Right Ascension / Declination

  track()

    More direct way to start tracking

  property tracking

    Tracking status

## noctua.devices.basedevice module

Base device. Other devices inherit from this

class noctua.devices.basedevice.BaseDevice(url)

  Bases: `object`

  Base device class for our devices

  get(message)

    Implement a getter method to obtain info from your device.

  put(message)

    Implement a setter method to send info to your device.

  property test_attribute

    res = self.get(“”) self._test_attribute = res return self._test_attribute

  test_method()

## noctua.devices.domotics module

class noctua.devices.domotics.Sensor(url, temp_id, hum_id)

  Bases: `Sonoff`

  property humidity
  property temperature

class noctua.devices.domotics.Sonoff(url, id)

  Bases: `object`

  property all
  property clock
  get(**kwargs)

    Modifies the func() method.

  property last_update
  property name
  put(**kwargs)

    Modifies the func() method.

class noctua.devices.domotics.Switch(url, id)

  Bases: `Sonoff`

  reboot()
  property state

## noctua.devices.ipcam module

class noctua.devices.ipcam.DlinkDCSCamera(url)

  Bases: `BaseDevice`

  Base wrapper class for Dlink DCS 5020l cameras.

  get(**kwargs)

    Modifies the func() method.

  put(**kwargs)

    Modifies the func() method.

class noctua.devices.ipcam.Webcam(url)

  Bases: `DlinkDCSCamera`

  Implementation of the Telescope commands mocking my Alpaca Telescope wrapper.

  property altaz

    Get the IP Camera Network Pan Tilt Zoom.

  property clock

    Get IP Camera Data Time settings.

  property daynight

    Get the IP Camera Day Night Mode settings.

  property description

    Get IP Camera Information.

  property email

    Get the IP Camera Email notification settings.

  property image

    Get IP Camera image in raw format.

  property inetwork

    Get the IP Camera Network information.

  property is_moving

    Get the IP Camera Motion Detection settings.

  property isystem

    Get the IP Camera System information.

  property network

    Get the IP Camera Network settings.

  property ptzpresets

    Get the IP Camera Network Pan Tilt Zoom Preset List

  property save_image

    Save a IP Camera image snapshot.

  property sound_detection

    Get the IP Camera Sound Detection settings.

  property stream_info

    Get the IP Camera Video stream info.

  property upload

    Get the IP Camera FTP Upload settings.

  property user

    Get the IP Camera user setttings.

  property user_list

    Get the list of IP Camera users.

  property version

    Get IP Camera CGI version.

  property video

    Get IP Camera video as mjpeg stream.

  property wireless

    Get the IP Camera Wireless information.

## noctua.devices.meteo module

class noctua.devices.meteo.Meteo(url)

  Bases: `object`

  archive()
  connect(**kwargs)

    Modifies the func() method.

  property data
  property original
  summary()
  synctime()
  property time

noctua.devices.meteo.main()

## noctua.devices.siemens module

class noctua.devices.siemens.Switch(url, id=0)

  Bases: `object`

  Base wrapper class for the Siemens PLC switch managing the Telescope cabinet.

  property all

    Requesting all the avaible status information.

  get(**kwargs)

    Modifies the func() method.

  put(**kwargs)

    Modifies the func() method.

  property state

    the cabinet is on or off?

    Type:

      Requesting just the state information

## noctua.devices.stx module

Interface with a SBIG STX camera device

class noctua.devices.stx.Camera(url)

  Bases: `STX`

  Camera device based on STX cameras.

  abort()
  abort2(**kwargs)

    Modifies the func() method.

  property all
  property ambient
  property binning
  property center
  property cooler
  property description
  download()
  property fan
  property filter
  full_frame()
  half_frame()
  property is_moving
  property max_range
  property ready
  property setpoint
  small_frame()
  start(duration, frametype, datetime='2025-06-19T08:23:00.005151')
  property state
  property temperature
  property version
  property xrange
  property xyend
  property xystart
  property yrange

class noctua.devices.stx.STX(url)

  Bases: `BaseDevice`

  Base wrapper class for SBIG STX cameras.

  property connection

    Setup a telnet connection to the cabinet. No decorator to silence errors. If error, not connected.

  get(**kwargs)

    Modifies the func() method.

  put(**kwargs)

    Modifies the func() method.

## noctua.devices.stx2 module

Interface with a SBIG STX camera device

class noctua.devices.stx2.Camera(url)

  Bases: `STX`

  High-level interface for the SBIG STX camera imaging CCD.

  abort()

    Aborts the current exposure.

  property all

    A comprehensive dictionary of the current camera state.

    Type:

      dict

  property ambient

    The ambient temperature in degrees Celsius.

    Type:

      float

  property binning

    The current [X, Y] binning factor.

    Type:

      list of int

  property center

    The sensor’s [X, Y] center coordinates for current binning.

    Type:

      list of int

  property cooler

    The current state of the CCD cooler (True=On, False=Off).

    Type:

      bool

  property description

    The camera model description string.

    Type:

      str

  download(filepath='temp.fits')

    Downloads the last completed image from the camera buffer.

    Parameters:

      filepath (str, optional) – The local path to save the FITS file to.

  property fan

    The current cooler power level in percent.

    Type:

      int

  property filter

    The currently selected filter position (1-8).

    Type:

      int

  full_frame()

    Sets the camera to use the full sensor area.

  half_frame()

    Sets the camera to use a centered 50% sub-frame.

  property is_moving

    The current state of the filter wheel. 0=Idle, 1=Moving, 2=Error.

    Type:

      int

  property max_range

    The maximum sensor dimensions [X, Y] for current binning.

    Type:

      list of int

  property ready

    The status of the image buffer. 1 if an image is ready for download, 0 otherwise.

    Type:

      int

  set_window(start_x, start_y, width, height)

    Sets the imaging sub-frame in a single, safe command. Coordinates are for a 1x1 binned frame.

    Parameters:

      - start_x (int) – The starting X pixel.

      - start_y (int) – The starting Y pixel.

      - width (int) – The width of the sub-frame in pixels.

      - height (int) – The height of the sub-frame in pixels.

  property setpoint

    The current CCD temperature setpoint in degrees Celsius.

    Type:

      float

  small_frame()

    Sets the camera to use a centered 10% sub-frame.

  start(duration, frametype, dt=None)

    Starts an exposure if the camera is idle.

    Parameters:

      - duration (float) – Exposure time in seconds.

      - frametype (int) – The type of frame (0=Dark, 1=Light, 2=Bias, 3=Flat).

      - dt (str, optional) – ISO-formatted datetime string for the FITS header. If None, the current UTC time is used.

  property state

    The current state of the imaging CCD. 0=Idle, 2=Exposing, 3=Reading, 5=Error.

    Type:

      int

  property temperature

    The current CCD temperature in degrees Celsius.

    Type:

      float

  property version

    Camera firmware and API version numbers.

    Type:

      list of str

  property xrange

    The current [start, end] X-axis window for current binning.

    Type:

      list of int

  property xyend

    The current [X, Y] end coordinates for current binning.

    Type:

      list of int

  property xystart

    The current [X, Y] start coordinates for current binning.

    Type:

      list of int

  property yrange

    The current [start, end] Y-axis window for current binning.

    Type:

      list of int

class noctua.devices.stx2.STX(url)

  Bases: `BaseDevice`

  Base wrapper class for SBIG STX cameras. Handles low-level communication and timing constraints.

  property connection

    Checks the connection to the camera.

    Returns:

      True if the camera responds to a version query, False otherwise.

    Return type:

      bool

  get(**kwargs)

    Modifies the func() method.

  put(**kwargs)

    Modifies the func() method.

## Module contents

Import devices using configuration files

noctua.devices.dynamic_import(this, dev)

  Dynamically import into this module the devices from the nodes.ini and devices.ini files. Old way:

  # from config.addresses import ASCOM_REMOTE # from devices import ascom # lamp = ascom.Switch(ASCOM_REMOTE, 2)