asi_core.utils.image_time_series

Functions

generate_image_series_paths(init_time, path_structure, ...)

Create a list of image file paths for the given timestamp, camera, exposure time and time gaps

find_closest_image(missing_time, existing_paths)

Find the image file with the closest time to the missing one from the given paths list

get_image_path(expected_path, time_tolerance)

Get the image file path with the closest time to the expected one with certain time tolerance

get_image_series_path(init_time, path_structure, ...)

Get a list of paths of a series of images given a list of seconds between each image.

Module Contents

asi_core.utils.image_time_series.generate_image_series_paths(init_time, path_structure, camera_name, img_exposure_time, time_gap)

Create a list of image file paths for the given timestamp, camera, exposure time and time gaps

Parameters:
  • init_time – (datetime) Initial timestamp for the creation of the image series.

  • path_structure – (string) formated string to build up the path to each camera image folder. It shall contain {camera_name}, {exposure_time} and {timestamp:…} where the camera name, exposure_time and evaluated date is inserted.

  • camera_name – (string) camera name

  • img_exposure_time – (int) exposure time of the image in milliseconds.

  • time_gap – (int) list of seconds between each image.

Return image_paths:

(string) list of image file paths

asi_core.utils.image_time_series.find_closest_image(missing_time, existing_paths)

Find the image file with the closest time to the missing one from the given paths list

Parameters:
  • missing_time – (datetime) timestamp of the missing image file.

  • existing_paths – (string list) list of paths to look for.

Returns:

(string) path to the image file closest in time.

asi_core.utils.image_time_series.get_image_path(expected_path, time_tolerance)

Get the image file path with the closest time to the expected one with certain time tolerance

Parameters:
  • expected_path – (string) expected path to the image file.

  • time_tolerance – (float) time tolerance in seconds for searching a file path.

Returns:

(string) path to the image file closest in time. If nothing found return [].

asi_core.utils.image_time_series.get_image_series_path(init_time, path_structure, camera_name, exposure_time, time_gap=[0], time_tolerance=0)

Get a list of paths of a series of images given a list of seconds between each image.

Parameters:
  • init_time – (datetime) initial timestamp for the creation of the image series.

  • path_structure – (string) formated string to build up the path to each camera image folder. It shall contain {camera_name}, {exposure_time} and {timestamp:…} where the camera name, expos is inserted, evaluated date is inserted and where the exposure time is inserted.

  • camera_name – (string) camera name

  • exposure_time – (int) exposure time of the image in milliseconds.

  • time_gap – (int) list of seconds between each image. Default is [0]

  • time_tolerance – (float) time tolerance in seconds for searching a file path. Default is 0