asi_tools.daq.image_acquisition_simulator

This script serves as a simulation for a camera real-time data acquisition, based on historical images. This is intended to check the real-time operation of various applications.

Some user inputs have to be defined (see #user input)

Attributes

origin_folder

Functions

copy_periodically(scheduler, interval_seconds, ...)

Main function which check for the images, creates a copy and schedules the next periodical call.

calculate_deviation(interval_seconds)

This function calculates the temporal deviation from the current time to the next expected image acquisition.

find_closest_datetime(datetime_list, target_datetime)

This function finds from the historical available images to the closest match to the expected time stamp.

Module Contents

asi_tools.daq.image_acquisition_simulator.copy_periodically(scheduler, interval_seconds, start_time, end_time, origin_folder, destination_folder, call_count, add_path_month_day)

Main function which check for the images, creates a copy and schedules the next periodical call.

Parameters:
  • scheduler – sched.scheduler object

  • interval_seconds – used interval in seconds of scheduler -> should be according to the camera update rate

  • start_time – datetime object which defines the first time stamp

  • end_time – datetime object which defines the last time stamp

  • origin_folder – main folder to historical images’

  • destination_folder – main folder for the simulated image acquisition

  • call_count – index which takes track of already evaluated images

  • add_path_month_day – zero padded string for month and day folder

asi_tools.daq.image_acquisition_simulator.calculate_deviation(interval_seconds)

This function calculates the temporal deviation from the current time to the next expected image acquisition.

Parameters:

interval_seconds – used interval in seconds of scheduler -> should be according to the camera update rate

Returns:

datetime object of the current real computer time -> only used to keep track of update rate

Returns:

temporal deviation in seconds for the next expected image acquisition event.

asi_tools.daq.image_acquisition_simulator.find_closest_datetime(datetime_list, target_datetime)

This function finds from the historical available images to the closest match to the expected time stamp. The real camera acquisition does not work perfectly. Some images are created with a delay of several seconds, which is reflected in the name of the images.

Parameters:
  • datetime_list – list of datetime objects with the available images within the current hour folder.

  • target_datetime – datetime object with the expected time stamp of the next image

Returns:

datetime object of the image closest to the target time

Returns:

position of the image within the list corresponding to the determined closest_datetime

asi_tools.daq.image_acquisition_simulator.origin_folder = '//129.247.24.3/Meteo/MeteoCamera/2020/Cloud_Cam_Metas'