saferoad.plotter module

class saferoad.plotter.Plotter[source]

Bases: object

Class to create and manage plots for geospatial data analysis.

class MapPane[source]

Bases: object

Class to create and manage a multi-panel map figure.

Panels include: - PS Density - Outliers - Cumulative Displacement - PS Velocity based on GCP - PS Velocity based on LCP

cum_disp_color_label(value: float) str[source]

Returns color and label based on cumulative displacement value.

Parameters:

value (float) – Cumulative displacement value.

Returns:

Tuple containing color and label.

Return type:

tuple[str, str]

gcp_vel_color(value: float) str[source]

Returns color based on GCP velocity value.

Parameters:

value (float) – GCP velocity value.

Returns:

Color string.

Return type:

str

generate_figure()[source]

Generates a multi-panel figure with specified layout and titles.

get_figure() tuple[Figure, list[Axes]][source]

Returns the figure and axes.

Returns:

Tuple containing the figure and axes.

Return type:

tuple[plt.Figure, list[plt.Axes]]

lcp_vel_color(value: float) str[source]

Returns color based on LCP velocity value.

Parameters:

value (float) – LCP velocity value.

Returns:

Color string.

Return type:

str

outlier_color_label(value: float) tuple[str, str][source]

Returns color and label based on outlier velocity value.

Parameters:

value (float) – Outlier velocity value.

Returns:

Tuple containing color and label.

Return type:

tuple[str, str]

plot_basemap(bbox: tuple[float, float, float, float])[source]

Plots a basemap on all axes using the provided bounding box.

Parameters:

bbox – A tuple representing the bounding box (minx, miny, maxx, maxy).

plot_cum_disp(plot_data: list[tuple]) None[source]

Plots cumulative displacement data on the third axis.

Parameters:

plot_data – List of tuples containing geometry and cumulative displacement value.

plot_gcp_velocity(plot_data: list[tuple]) None[source]

Plots GCP velocity data on the fourth axis.

Parameters:

plot_data – List of tuples containing geometry and GCP velocity value.

plot_lcp_velocity(plot_data: list[tuple]) None[source]

Plots LCP velocity data on the fifth axis.

Parameters:

plot_data – List of tuples containing geometry and LCP velocity value.

plot_outliers(plot_data: list[tuple]) None[source]

Plots outlier data on the second axis.

Parameters:

plot_data – List of tuples containing geometry and outlier velocity value.

plot_ps_density(plot_data: list[tuple]) None[source]

Plots PS Density data on the first axis.

Parameters:

plot_data – List of tuples containing geometry and PS density value.

post_process()[source]

Post-processes the figure for better aesthetics.

ps_density_color_label(value: float) tuple[str, str][source]

Returns color and label based on PS density value.

Parameters:

value (float) – PS density value.

Returns:

Tuple containing color and label.

Return type:

tuple[str, str]

class TimeSeriesPane[source]

Bases: object

Class to create and manage a multi-panel time series figure. Panels include: - Basemap with Outliers - Basemap with PS Points - Cumulative Displacement - Relative Displacement - Local Control Point Displacement

generate_figure()[source]

Generates a multi-panel figure with specified layout and titles.

get_figure() tuple[Figure, list[Axes]][source]

Returns the figure and axes.

Returns:

Tuple containing the figure and axes.

Return type:

tuple[plt.Figure, list[plt.Axes]]

outlier_color_label(value: float) tuple[str, str][source]

Returns color and label based on outlier velocity value.

Parameters:

value (float) – Outlier velocity value.

Returns:

Tuple containing color and label.

Return type:

tuple[str, str]

plot_all_outliers(plot_data: list[tuple]) None[source]

Plots all outlier data on the first axis.

Parameters:

plot_data (list[tuple]) – List of tuples containing geometry and outlier velocity value.

plot_avg_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots average cumulative displacement data on the third axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing average cumulative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_avg_lcp_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots average LCP displacement data on the fifth axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing average LCP displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_avg_rel_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots average relative displacement data on the fourth axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing average relative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_basemap_outlier(center: tuple[float, float])[source]

Plots a basemap on the first axis using the provided center point.

Parameters:

center (tuple[float, float]) – A tuple representing the center point (x, y).

plot_basemap_pspoint(center: tuple[float, float])[source]

Plots a basemap on the second axis using the provided center point.

Parameters:

center (tuple[float, float]) – A tuple representing the center point (x, y).

plot_cum_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots cumulative displacement data on the third axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing cumulative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_lcp(plot_data: list[tuple]) None[source]

Plots LCP data on the second axis.

Parameters:

plot_data (list[tuple]) – List of tuples containing geometry.

plot_lcp_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots LCP displacement data on the fifth axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing LCP displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_outlier(plot_data: list[tuple]) None[source]

Plots outlier data on the second axis.

Parameters:

plot_data (list[tuple]) – List of tuples containing geometry and outlier velocity value.

plot_pspoint_dist(plot_data: list[tuple]) None[source]

Plots PS Points on the second axis.

Parameters:

plot_data (list[tuple]) – List of tuples containing geometry.

plot_rel_disp_graph(plot_data: list[tuple], dates: list[datetime]) None[source]

Plots relative displacement data on the fourth axis.

Parameters:
  • plot_data (list[tuple]) – List of tuples containing relative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_square(plot_data: list[tuple]) None[source]

Plots a square on the first axis to indicate zoom area.

Parameters:

plot_data (list[tuple]) – List of tuples containing geometry and outlier velocity value.

plot_std_disp_graph(avg_data: list[tuple], std_data: list[tuple], dates: list[datetime])[source]

Plots standard deviation of cumulative displacement data on the third axis.

Parameters:
  • avg_data (list[tuple]) – List of tuples containing average cumulative displacement values.

  • std_data (list[tuple]) – List of tuples containing standard deviation of cumulative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_std_lcp_disp_graph(avg_data: list[tuple], std_data: list[tuple], dates: list[datetime])[source]

Plots standard deviation of LCP displacement data on the fifth axis.

Parameters:
  • avg_data (list[tuple]) – List of tuples containing average LCP displacement values.

  • std_data (list[tuple]) – List of tuples containing standard deviation of LCP displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

plot_std_rel_disp_graph(avg_data: list[tuple], std_data: list[tuple], dates: list[datetime])[source]

Plots standard deviation of relative displacement data on the fourth axis.

Parameters:
  • avg_data (list[tuple]) – List of tuples containing average relative displacement values.

  • std_data (list[tuple]) – List of tuples containing standard deviation of relative displacement values.

  • dates (list[datetime]) – List of datetime objects corresponding to the displacement values.

post_process()[source]

Post-processes the figure for better aesthetics.