mllam / neural-lam

Neural Weather Prediction for Limited Area Modeling
MIT License
64 stars 24 forks source link

Feature Request: Enhance Visualization Plots with Map Features #21

Open sadamov opened 1 month ago

sadamov commented 1 month ago

Description: To improve the visualization plots in the vis.py module, we should add the following features to the plots:

Country Borders: Add country borders to the plots using cartopy.feature.BORDERS. Set the linestyle to a solid line ("-") and the edge color to black.

Coastlines: Include coastlines in the plots using cartopy.feature.COASTLINE. Set the linestyle to a solid line ("-") and the edge color to black.

Gridlines: Add gridlines to the plots using ax.gridlines(). Use the projection specified in constants.SELECTED_PROJ for the gridlines. Disable drawing labels for the gridlines by setting draw_labels=False. Set the linewidth of the gridlines to 0.5 and the alpha (transparency) to 0.5.

Implementation:

import cartopy.feature as cf
ax.add_feature(cf.BORDERS, linestyle="-", edgecolor="black")
ax.add_feature(cf.COASTLINE, linestyle="-", edgecolor="black")
ax.gridlines(
    crs=constants.SELECTED_PROJ,
    draw_labels=False,
    linewidth=0.5,
    alpha=0.5,
)

Benefits: Enhancing the plots with country borders and coastlines will provide better geographical context and make the visualizations more informative. Adding gridlines will improve the readability of the plots and help in understanding the spatial distribution of the data. Customizing the linestyle, edge color, linewidth, and alpha allows for better visual aesthetics and clarity in the plots.

Notes: Since we are already depending on cartopy for the projections we might as well use some additional functionalities.

joeloskarsson commented 1 month ago

Note that coastlines are already drawn, e.g.

https://github.com/mllam/neural-lam/blob/879cfec1b49d0255ed963f44b3a9f55d42c9920a/neural_lam/vis.py#L95

But could be nice to use add_feature also for coastlines, for consistency.