Metadata-Version: 2.4
Name: dnplot
Version: 0.4.2
Summary: Plotting of data imported by the dnora package
Author-email: Konstantinos Christakos <konstantinosc@met.no>, Jan-Victor Björkqvist <janvb@met.no>, Dominykas Jasas <dominykas.jasas@stud.vilniustech.lt>
Requires-Python: >=3.9, <=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: cartopy
Requires-Dist: pandas
Requires-Dist: plotly
Requires-Dist: dash
Requires-Dist: scipy
Requires-Dist: cmocean
Requires-Dist: pytest>=7.0 ; extra == "test"
Project-URL: repository, http://github.com/bjorkqvi/dnplot
Provides-Extra: test

# dnplot 💻

**dnplot** is a tool designed for the visualization of [**dnora**](https://github.com/MET-OM/dnora) objects, such as 🌬️ wind, 🌊 wave and ocean current data.

![dnplot Visualization](https://github.com/bjorkqvi/dnplot/blob/doc/docs/files/spectra_plotly.gif)


## Quick Installation 🚀 

Ready to dive in? You can easily install **dnplot** using pip:

```shell
$ pip install dnplot 
```

## Examples

To quickly visualize the wave data outputted by SWAN to a netcdf file:

```python
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)
```

<img width="924" height="754" alt="Screenshot from 2025-10-14 14-09-08" src="https://github.com/user-attachments/assets/4bddfb55-9cf2-43e0-9a50-8b9431fa5991" />
<img width="997" height="786" alt="Screenshot from 2025-10-14 12-49-05" src="https://github.com/user-attachments/assets/1fc94da7-4345-4208-b63b-f20f8b198087" />


To interactively compare spectra from a model with several locations with buoy measurements:

```python
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()
```
<img width="3377" height="1299" alt="Screenshot from 2025-10-14 12-34-48" src="https://github.com/user-attachments/assets/88fcddd5-52da-4d90-851e-b1ce7d6a127c" />

## 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](https://dnora.readthedocs.io/en/latest/index.html).

