pycsamt.map.overlays#
Overlay helpers for station, profile, and 3-D maps.
Functions
|
Estimate a reasonable Plotly map zoom. |
|
Resolve a style name into a (base style, raster layers) pair. |
|
Return layout settings for geographic station maps. |
|
Build an interpolated map contour overlay. |
|
Render a Surfer-style filled-contour PNG for a basemap image layer. |
|
Build a reusable profile-line overlay trace. |
|
Build a reusable station-label overlay trace. |
|
Build a Plotly 3-D terrain mesh or surface. |
|
Return a default public tile style. |
|
Interpolate scattered values to a regular grid. |
|
Return an EPSG authority string. |
|
Reproject x, y from epsg to WGS84 lon/lat. |
|
Return a human-readable CRS description. |
|
Transform coordinates between two CRS definitions. |
Classes
|
Plotly geographic map layout settings. |
|
Coordinate transform settings. |
|
Description of an interpolated contour overlay. |
|
Topography aligned to map coordinates. |
- class pycsamt.map.overlays.ContourOverlay(values, x, y, levels=12, cmap='viridis', opacity=0.65)[source]#
Bases:
objectDescription of an interpolated contour overlay.
- class pycsamt.map.overlays.TopographyOverlay(elevation, source='stations', opacity=0.7)[source]#
Bases:
objectTopography aligned to map coordinates.
- class pycsamt.map.overlays.CRSConfig(source, target=4326, always_xy=True)[source]#
Bases:
objectCoordinate transform settings.
- class pycsamt.map.overlays.BasemapConfig(style, center, zoom, bearing=0.0, layers=())[source]#
Bases:
objectPlotly geographic map layout settings.
- pycsamt.map.overlays.basemap_style_and_layers(style, *, dark=False)[source]#
Resolve a style name into a (base style, raster layers) pair.
ESRI styles are rendered as
white-bg+ a raster tile layer; native Plotly styles are returned as-is with no layers.
- pycsamt.map.overlays.resolve_crs_info(mode='geo', *, zone=50, hemisphere='N', epsg=4326)[source]#
Return a human-readable CRS description.
- pycsamt.map.overlays.transform_xy(x, y, *, crs)[source]#
Transform coordinates between two CRS definitions.
- pycsamt.map.overlays.reproject_xy_to_lonlat(x, y, *, epsg)[source]#
Reproject x, y from epsg to WGS84 lon/lat.
- pycsamt.map.overlays.build_contour_overlay(x, y, values, *, levels=12, cmap='Viridis', opacity=0.65, grid_size=80, mode='lines')[source]#
Build an interpolated map contour overlay.
Returns a Plotly
Contourtrace on a regular grid.
- pycsamt.map.overlays.build_geo_contour_image(lons, lats, values, *, cmap='jet', n_levels=12, opacity=0.6, mode='filled+lines', log_scale=False, grid_res=160, expand=0.06, interp='cubic', smooth_sigma=0.0)[source]#
Render a Surfer-style filled-contour PNG for a basemap image layer.
Interpolates sparse station values onto a regular lon/lat grid and rasterises filled (and/or line) contours to a transparent PNG. The result is meant to be added to a Plotly map as an
imagelayer.- Returns:
{"image": "data:image/png;base64,...", "coordinates": [...], "vmin": float, "vmax": float}(coordinates are the TL, TR, BR, BL[lon, lat]corners), orNonewhen it cannot be built.- Return type:
dict | None
- Parameters:
- pycsamt.map.overlays.interpolate_overlay_grid(x, y, values, *, grid_size=80, method='linear')[source]#
Interpolate scattered values to a regular grid.
- pycsamt.map.overlays.build_topography_overlay(x, y, elevation, *, opacity=0.7, colorscale='Earth')[source]#
Build a Plotly 3-D terrain mesh or surface.
- pycsamt.map.overlays.build_station_label_overlay(x, y, labels, *, geo=False, name='Station labels', color='#111827')[source]#
Build a reusable station-label overlay trace.
- pycsamt.map.overlays.build_profile_line_overlay(x, y, *, geo=False, name='Profile', color='#2563eb', width=2.0)[source]#
Build a reusable profile-line overlay trace.
- pycsamt.map.overlays.build_basemap_layout(lon, lat, *, dark=False, style=None, bearing=0.0)[source]#
Return layout settings for geographic station maps.