Modules reference

satnogsclient

SatNOGS Client module initialization

satnogsclient.main()[source]

Main function

satnogsclient.locator.locator

class satnogsclient.locator.locator.Locator[source]
static show_location(gpsd)[source]
update_location()[source]

satnogsclient.observer.observer

class satnogsclient.observer.observer.Observer[source]
observe()[source]

Starts threads for rotcrl and rigctl.

plot_waterfall(waterfall)[source]
poll_gnu_proc_status(flowgraph)[source]
remove_waterfall_file()[source]
rename_data_file()[source]
rename_ogg_file()[source]
run_rig()[source]
run_rot()[source]
setup(observation_id, tle, observation_end, frequency, mode, baud)[source]

Sets up required internal variables. * returns True if setup is ok * returns False if issue is encountered

satnogsclient.observer.observer.post_and_save_artifacts(artifacts_file, observation_id)[source]

Accepts a TemporaryFile artifacts_file opened at the beginning of the file, saves it to disk if enabled, then tries to upload it to satnogs-db. Finally closes this file.

Parameters
  • artifacts_file (file) – The Artifact file (opened at position 0).

  • observation_id (str) – The observation id of the associated observation (for enhanced logging).

satnogsclient.observer.observer.rx_device_for_frequency(rx_device_spec, frequency)[source]
satnogsclient.observer.observer.save_artifacts(artifacts_file, filename)[source]

Accepts a TemporaryFile artifacts_file opened at the beginning of the file and writes this file to disk. Finally seeks back to the beginning of the file.

NOTE: Does NOT close this file.

Parameters
  • artifacts_file (file) – TemporaryFile, open at position 0

  • filename (str) – Filename of artifacts file

satnogsclient.observer.orbital

satnogsclient.observer.orbital.pinpoint(observer_dict, satellite_dict, timestamp=None)[source]

Provides azimuth and altitude of tracked object.

args:

observer_dict: dictionary with details of observation point. satellite_dict: dictionary with details of satellite. time: timestamp we want to use for pinpointing the observed object.

returns:

Dictionary containing azimuth, altitude and “ok” for error detection.

satnogsclient.artifacts

class satnogsclient.artifacts.Artifacts(waterfall, metadata)[source]
create()[source]

satnogsclient.waterfall

exception satnogsclient.waterfall.EmptyArrayError[source]

Empty data array exception

class satnogsclient.waterfall.Waterfall(datafile_path)[source]

Parse waterfall data file

Parameters

datafile_path (str_array) – Path to data file

plot(figure_path, vmin=None, vmax=None)[source]

Plot waterfall into a figure

Parameters
  • figure_path (str) – Path of figure file to save

  • vmin (int) – Minimum value range

  • vmax (int) – Maximum value range

satnogsclient.waterfall._compress_waterfall(waterfall)[source]

Compress spectra of waterfall

Parameters

waterfall (dict) – Watefall data

Returns

Compressed spectra

Return type

dict

satnogsclient.waterfall._get_waterfall(datafile_path)[source]

Get waterfall data

Parameters

datafile_path (str_array) – Path to data file

Returns

Waterfall data including compressed data

Return type

dict

satnogsclient.waterfall._read_waterfall(datafile_path)[source]

Read waterfall data file

Parameters

datafile_path (str) – Path to data file

Raises
  • EmptyArrayError – Empty waterfall data

  • IndexError – Invalid waterfall data

  • FileNotFoundError – No waterfall data file found

  • OSError – Could not open waterfall data file

Returns

Waterfall data

Return type

dict

satnogsclient.observer.worker

class satnogsclient.observer.worker.Worker(time_to_stop=None, sleep_time=None)[source]

Class to facilitate as a worker for rotctl/rigctl.

_communicate_tracking_info()[source]
_observation_end = None
_sleep_time = 0.1
_stay_alive = False
property is_alive

Returns if tracking loop is alive or not.

observer_dict = {}
satellite_dict = {}
send_to_socket(pin, sock)[source]
trackobject(observer_dict, satellite_dict)[source]

Sets tracking object. Can also be called while tracking to manipulate observation.

Parameters
  • observer_dict (dict) – Location of the Observer, example: {‘lon’: 0.0, ‘lat’: 0.0, ‘elev’:0.0}

  • satellite_dict (dict) – TLE of the satellite, example: {‘tle0’: ‘’, ‘tle1’: ‘’, ‘tle2’: ‘’}

trackstart()[source]

Starts the thread that communicates tracking info to remote socket. Stops by calling trackstop()

trackstop()[source]

Sets object flag to false and stops the tracking thread.

class satnogsclient.observer.worker.WorkerFreq(ip, port, **kwargs)[source]
_communicate_tracking_info()[source]

Runs as a daemon thread, communicating tracking info to remote socket. Uses observer and satellite objects set by trackobject(). Will exit when observation_end timestamp is reached.

_frequency = None
send_to_socket(pin, sock)[source]
trackobject(frequency, observer_dict, satellite_dict)[source]

Track object

Parameters
  • frequency (int) – Frequency of original signal in Hz

  • observer_dict (dict) – Location of the Observer example: {‘lon’: 0.0, ‘lat’: 0.0, ‘elev:0.0}

  • satellite_dict (dict) – TLE of the satellite example: {‘tle0’: ‘’, ‘tle1’: ‘’, ‘tle2’: ‘’}

class satnogsclient.observer.worker.WorkerTrack(port, **kwargs)[source]
_altitude = None
_azimuth = None
_communicate_tracking_info()[source]

Runs as a daemon thread, communicating tracking info to remote socket. Uses observer and satellite objects set by trackobject(). Will exit when observation_end timestamp is reached.

_flip = False
_midpoint = None
static find_midpoint(observer_dict, satellite_dict, start)[source]
static flip_coordinates(azi, alt, timestamp, midpoint)[source]
static normalize_angle(num, lower=0, upper=360)[source]
send_to_socket(pin, sock)[source]
trackobject(*args)[source]

Track object

Parameters

args – Positional Arguments of parent class Worker

satnogsclient.rig

class satnogsclient.rig.Rig(model=Hamlib.RIG_MODEL_DUMMY, path='', debug=Hamlib.RIG_DEBUG_WARN)[source]

Communicate and interface with rigs

Parameters
  • model – Model of Hamlib rig

  • path (str, optional) – Path or address to Hamlib rig device

  • debug (int, optional) – Hamlib rig debug level

close()[source]

Close Hamlib rig device

property frequency

Get rig frequency

Returns

Rig frequency

Return type

float

open()[source]

Open Hamlib rig device

property vfo

Get active VFO

Returns

Active VFO

Return type

int

satnogsclient.rotator

class satnogsclient.rotator.Rotator(model, baud, port)[source]

Communicate and interface with rotators

Parameters
  • model (str) – Model of rotator e.g. “ROT_MODEL_EASYCOMM3” or “ROT_MODEL_DUMMY”

  • baud (int, optional) – The baud rate of serial communication, e.g. 19200

  • port (str) – The port of the rotator, e.g. “/dev/ttyUSB0”

close()[source]

End the communication with rotator

get_conf(cmd)[source]

Return the configuration of a register

Parameters

cmd (int) – Number of the register

Returns

Value of register

Return type

str

get_info()[source]

Return information about the rotator

Returns

Information about the rotator

Return type

str

move(direction, speed)[source]

Move the rotator with speed (mdeg/s) to specific direction

Parameters
  • direction (str) – The direction of movement, e.g. ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_RIGHT

  • speed (int) – The velocity set point in mdeg/s

open()[source]

Start the communication with rotator

park()[source]

Move the rotator to park position and return the current position

Returns

Current position in degrees

Return type

None or list[float, float]

property position

Return the position in degrees of azimuth and elevation

Returns

Position in degrees

Return type

list[float, float]

reset()[source]

Move the rotator to home position and return the current position

Returns

Current position in degrees

Return type

None or list[float, float]

stop()[source]

Stop the rotator and return the current position

Returns

Current position in degrees

Return type

None or list[float, float]

satnogsclient.scheduler.tasks

satnogsclient.scheduler.tasks.get_jobs()[source]

Query SatNOGS Network API to GET jobs.

satnogsclient.scheduler.tasks.keep_or_remove_file(filename)[source]
satnogsclient.scheduler.tasks.post_data()[source]

PUT observation data back to Network API.

satnogsclient.scheduler.tasks.spawn_observer(**kwargs)[source]
satnogsclient.scheduler.tasks.status_listener()[source]
satnogsclient.scheduler.tasks.upload_observation_data(observation_id, observation, fil)[source]

Upload observation data to SatNOGS Network API.

satnogsclient.settings

SatNOGS Client settings file

satnogsclient.settings._cast_or_none(func, value)[source]
satnogsclient.settings.validate(logger)[source]

Validate the provided settings: - Check for the existance of all required variables - Validate format of the provided value for some required variables

Since this module has to be loaded before the logger has been initialized, this method requires a configured logger to be passed.

Arguments: logger – the output logger

satnogsclient.radio.flowgraphs

class satnogsclient.radio.flowgraphs.Flowgraph(device, sampling_rate, frequency, mode, baud, output_data)[source]

Execute SatNOGS Flowgraphs

Parameters
  • device (str) – SoapySDR device

  • sampling_rate (int) – Sampling rate

  • frequency (int) – RX frequency

  • mode (str) – Mode of operation

  • baud (int) – Baud rate or WPM

  • output_data (dict) – Dictionary of output data

property enabled

Get flowgraph running status

Returns

Flowgraph running status

Return type

bool

property info

Get information and parameters of flowgraph and radio

Returns

Information about flowgraph and radio

Return type

dict