asi_core.real_time.utils

Utility functions for real time applications.

Functions

parse_logger_data(url_cs_logger_table, timezone[, ...])

Access the measurements table of a campbell scientific logger via HTTP

parse_latest_image_ssh(asi_img_fmt, host[, interval, ...])

Function to load latest images from remote server

Module Contents

asi_core.real_time.utils.parse_logger_data(url_cs_logger_table, timezone, name_desired_columns_cs_table=None)

Access the measurements table of a campbell scientific logger via HTTP

All channels and the time stamp are retrieved from the HTML string and placed in a data frame. If desired some channels can be renamed.

Parameters:
  • url_cs_logger_table – (str) url of table as string

  • timezone – (str) desired time zone (e.g. “GMT+1” = UTC+1)

  • name_desired_columns_cs_table – (dict) List with 2 columns and n rows. First column holds the original names of channels which shall be renamed. The second column holds the new names for the channels.

Return df:

data frame single row with n columns for each channel + timestamp index as datetime

asi_core.real_time.utils.parse_latest_image_ssh(asi_img_fmt, host, interval=30, verbose=False)

Function to load latest images from remote server

Parameters:
  • asi_img_fmt – (str) filename format of image to load from server (absolute path). Requires identifier for timestamp (dt, e.g. {dt:%Y%m%d%H%M%S})

  • host – (str) host name to be accessed via ssh

  • interval – (int, optional, default=30) Interval for image acquisition

Return img, dt:

image + timestamp (datetime64)