Plotting of data imported by the dnora package
Project description
dnplot 💻
dnplot is a tool designed for the visualization of dnora objects, such as 🌬️ wind, 🌊 wave and ocean current data.
Quick Installation 🚀
Ready to dive in? You can easily install dnplot using pip:
$ pip install dnplot
Examples
To quickly visualize the wave data outputted by SWAN to a netcdf file:
import dnplot
from dnora.wavegrid import WaveGrid
data = WaveGrid.from_netcdf('model_output.nc')
point = data.sel(lon=5.25, lat=62.3, method='nearest') # Pick just one point
# The dict could be a dnora ModelRun object containing the data
plot = dnplot.Matplotlib({'wavegrid': data, 'waveseries': point})
# default value for var=["hs", ("tm01", "tm02"), "dirm"]
plot.waveseries(var=['hs', ('tp','tm01'), 'dirp'])
plot.wavegrid('hs', contour=False)
To interactively compare spectra from a model with several locations with buoy measurements:
import dnora as dn
import dnplot
model = dn.modelrun.ModelRun(year=2020)
model.import_spectra(filename="nora3.nc", name="NORA3")
model.spectra_to_1d()
buoy = dn.modelrun.ModelRun(year=2020, month=2, day=5)
buoy.import_spectra1d(filename="spec_E39_D_1h.nc", name="Breisundet")
plot = dnplot.Plotly(buoy, model)
plot.spectra()
Docs 📚
Looking for more details? Our documentation (currently under development) provides information about the package, its features, and how to use it. Explore it here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dnplot-0.4.2.tar.gz
(21.8 MB
view details)
File details
Details for the file dnplot-0.4.2.tar.gz.
File metadata
- Download URL: dnplot-0.4.2.tar.gz
- Upload date:
- Size: 21.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98e6a985f6d3d308c67d56b2d469bfb477e8cabc690adeeab22a06eb623c7197
|
|
| MD5 |
14eca8b4788070633b62d491e1ac18b2
|
|
| BLAKE2b-256 |
9c4d963f8109196657edf445b73dadfe94edec6cbef384de2ca4352f27502bc7
|