RCAIDE.Library.Plots.Noise.plot_2D_noise_contour

plot_2D_noise_contour#

plot_2D_noise_contour(noise_data, noise_level=None, min_noise_level=35, max_noise_level=90, noise_scale_label=None, save_figure=False, show_figure=True, save_filename='2D_Noise_Contour', show_elevation=False, use_lat_long_coordinates=True, colormap='jet', file_type='.png', width=10, height=7)[source]#

Creates a 2D contour plot of noise levels with optional terrain elevation.

Parameters:
  • noise_data (NoiseData) –

    RCAIDE noise data structure containing:
    • microphone_locations[:,:,0:3]

      3D array of microphone positions

    • microphone_coordinates[:,:,0:2]

      Latitude and longitude of measurement points

    • topography_file

      Optional path to terrain elevation data

  • noise_level (ndarray, optional) – 2D array of noise levels at measurement points

  • min_noise_level (float, optional) – Minimum noise level for contour scale (default: 35 dB)

  • max_noise_level (float, optional) – Maximum noise level for contour scale (default: 90 dB)

  • noise_scale_label (str, optional) – Label for noise metric (e.g., “dBA”, “EPNL”, etc.)

  • save_figure (bool, optional) – Flag for saving the figure (default: False)

  • show_figure (bool, optional) – Flag to display the figure (default: True)

  • save_filename (str, optional) – Name of file for saved figure (default: “2D_Noise_Contour”)

  • show_elevation (bool, optional) – Flag to display terrain elevation contours (default: False)

  • use_lat_long_coordinates (bool, optional) – Flag to use geographic coordinates (default: True)

  • colormap (str, optional) – Colormap specification for noise contours (default: ‘jet’)

  • file_type (str, optional) – File extension for saved figure (default: “.png”)

  • width (float, optional) – Figure width in inches (default: 10)

  • height (float, optional) – Figure height in inches (default: 7)

Returns:

fig – Handle to the generated figure

Return type:

plotly.graph_objects.Figure

Notes

Creates visualization showing:
  • Noise level contours

  • Optional terrain elevation

  • Geographic or Cartesian coordinates

  • Customizable color scales

Definitions

‘Noise Level’

Sound pressure level or derived metric

‘Terrain Elevation’

Height above sea level

‘Geographic Coordinates’

Latitude and longitude positions

See also

RCAIDE.Library.Plots.Noise.plot_3D_noise_contour

3D visualization of noise field

RCAIDE.Library.Plots.Noise.post_process_noise_data

Data preparation for plotting

truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100)[source]#
class FixPointNormalize(vmin=None, vmax=None, sealevel=0, col_val=0.21875, clip=False)[source]#

Bases: Normalize

Inspired by https://stackoverflow.com/questions/20144529/shifted-colorbar-matplotlib Subclassing Normalize to obtain a colormap with a fixpoint somewhere in the middle of the colormap. This may be useful for a terrain map, to set the “sea level” to a color in the blue/turquise range.

__init__(vmin=None, vmax=None, sealevel=0, col_val=0.21875, clip=False)[source]#
Parameters:
  • vmin (float or None) – Values within the range [vmin, vmax] from the input data will be linearly mapped to [0, 1]. If either vmin or vmax is not provided, they default to the minimum and maximum values of the input, respectively.

  • vmax (float or None) – Values within the range [vmin, vmax] from the input data will be linearly mapped to [0, 1]. If either vmin or vmax is not provided, they default to the minimum and maximum values of the input, respectively.

  • clip (bool, default: False) –

    Determines the behavior for mapping values outside the range [vmin, vmax].

    If clipping is off, values outside the range [vmin, vmax] are also transformed, resulting in values outside [0, 1]. This behavior is usually desirable, as colormaps can mark these under and over values with specific colors.

    If clipping is on, values below vmin are mapped to 0 and values above vmax are mapped to 1. Such values become indistinguishable from regular boundary values, which may cause misinterpretation of the data.

Notes

If vmin == vmax, input data will be mapped to 0.

colorax(vmin, vmax)[source]#