windwhisper.plotting

Attributes

color_map

Functions

generate_contours(data, levels[, name])

Generate contour polygons and wrap them into a Folium layer.

add_legend(map_object)

Append a categorical legend to a Folium map.

rotate_coordinates(coords, angle, center)

Rotate coordinates around a centroid.

generate_map(noise_dataset[, filepath])

Export contour overlays for the provided noise dataset.

create_geojson(data)

Generate a GeoJSON feature collection of contour polylines.

Module Contents

windwhisper.plotting.color_map
windwhisper.plotting.generate_contours(data, levels, name='Noise Contours')

Generate contour polygons and wrap them into a Folium layer.

Parameters:
  • data (xarray.DataArray) – Raster to contour.

  • levels (list[int]) – Contour levels in dB.

  • name (str) – Name of the resulting Folium layer.

Returns:

Folium feature group containing contour polylines.

Return type:

folium.FeatureGroup

windwhisper.plotting.add_legend(map_object)

Append a categorical legend to a Folium map.

Parameters:

map_object (folium.Map) – Folium map receiving the legend.

Returns:

The modified map object.

Return type:

folium.Map

windwhisper.plotting.rotate_coordinates(coords, angle, center)

Rotate coordinates around a centroid.

Parameters:
  • coords (list[tuple[float, float]]) – Sequence of (latitude, longitude) pairs.

  • angle (float) – Rotation angle in degrees.

  • center (tuple[float, float]) – Rotation centre expressed as (latitude, longitude).

Returns:

Rotated coordinates as (latitude, longitude) pairs.

Return type:

list[tuple[float, float]]

windwhisper.plotting.generate_map(noise_dataset, filepath='noise_map.html')

Export contour overlays for the provided noise dataset.

Parameters:
  • noise_dataset (xarray.Dataset) – Dataset containing combined noise layers.

  • filepath (str) – Destination filepath for the generated HTML map.

Returns:

Generated Folium map instance.

Return type:

folium.Map

windwhisper.plotting.create_geojson(data)

Generate a GeoJSON feature collection of contour polylines.

Parameters:

data (xarray.DataArray) – Raster to contour.

Returns:

GeoJSON feature collection describing the contour lines.

Return type:

geojson.FeatureCollection