Postprocessing

class ledsa.postprocessing.simulation.SimData(path_simulation, read_all=True, remove_duplicates=False, load_config_params=True)[source]

Bases: _BaseSimData

get_image_name_from_time(time)[source]

Retrieves the image name corresponding to a specific time.

Parameters:

time (int) – The time index.

Returns:

The name of the image.

Return type:

str

get_ledparams_at_led_array(channel, led_array_id, param='sum_col_val', yaxis='led_id', window=1, n_ref=None)[source]

Retrieves a DataFrame containing normalized LED parameters for a specific LED array.

Parameters:
  • channel (int) – The channel index from which to extract LED parameters.

  • led_array_id (int) – The ID for which to extract LED parameters.

  • param (str, optional) – The specific LED parameter to extract and analyze. Defaults to ‘sum_col_val’.

  • yaxis (str, optional) – Column labeling: 'led_id' or 'height'. Defaults to 'led_id'.

  • window (int, optional) – Smoothing window size. 1 = no smoothing.

  • n_ref (int or bool, optional) – Number of initial entries for normalisation. False disables normalisation. Defaults to None (uses num_ref_images).

Returns:

DataFrame; index = time, columns = LED IDs or heights.

Return type:

pd.DataFrame

get_ledparams_at_led_id(channel, led_id, param='sum_col_val', window=1, n_ref=None)[source]

Retrieves a DataFrame containing normalized LED parameters for a specific LED ID.

Parameters:
  • channel (int) – The channel index from which to extract LED parameters.

  • led_id (int) – The identifier of the LED for which to extract parameters.

  • param (str, optional) – The specific LED parameter to extract and analyze. Defaults to ‘sum_col_val’.

  • window (int, optional) – Smoothing window size. 1 = no smoothing.

  • n_ref (int or bool, optional) – Number of initial entries for normalisation. False disables normalisation. Defaults to None (uses num_ref_images).

Returns:

DataFrame indexed by time with the specified LED parameter.

Return type:

pd.DataFrame

get_pixel_cordinates_of_LED(led_id)[source]

Returns the pixel coordinates of a specified LED.

Parameters:

led_id (int) – The identifier for the LED.

Returns:

A list containing the x and y pixel coordinates of the LED.

Return type:

list

get_pixel_values_of_led(led_id, channel, time, radius=None)[source]

Retrieves a cropped numpy array of pixel values around a specified LED.

Parameters:
  • led_id (int) – The identifier for the LED of interest.

  • channel (int) – The image channel from which to extract pixel values.

  • time (int) – The time at which the image was taken.

  • radius (int, optional) – Pixel radius around the LED. If not specified, uses search_area_radius from the config file.

Returns:

A numpy array of pixel values around the LED.

Return type:

numpy.ndarray

Raises:

ValueError – If path_images is not available.

read_all()[source]

Read led parameters and extinction coefficients for all channels.

read_led_params()[source]

Read led parameters for all color channels from the simulation path.

remove_duplicate_heights()[source]

Remove duplicate height entries for each LED parameter DataFrame.

set_timeshift(timedelta)[source]

Sets the time shift for the experiment’s start time.

Parameters:

timedelta (int) – Time shift in seconds.

class ledsa.postprocessing.simulation.StackedSimData(config_path='.', read_all=True)[source]

Bases: _BaseSimData

Postprocessing interface for stacked multi-camera extinction coefficient results.

Reads config_stacked.ini from config_path, discovers the stacked CSV output files produced by StackedExtinctionCoefficients, and exposes the same _BaseSimData query API for those results.

LED parameter data is not available through this class because stacked results aggregate rays from multiple cameras. Use individual per-camera SimData objects for raw LED intensities.

Variables:

config_stacked (ConfigDataStacked) – Parsed stacked-analysis configuration.