rom-py / rompy

Relocatable Ocean Modelling in PYthon (rompy) combines templated cookie-cutter model configuration with various xarray extensions to assist in the setup and evaluation of coastal ocean model
https://rom-py.github.io/rompy/
BSD 3-Clause "New" or "Revised" License
3 stars 9 forks source link

Boundary #30

Closed rafa-guedes closed 1 year ago

rafa-guedes commented 1 year ago

This pull request moves the old rompy.swan.boundary.DataBoundary into a new core object rompy.core.boundary.BoundaryWaveStation. The old swan boundary object is now called rompy.swan.boundary.Boundnest1 and inherits from BoundaryWaveStation with only small changes to the get method to create SWAN ASCII boundary files instead of netcdf.

Addresses https://github.com/rom-py/rompy/issues/27.

pbranson commented 1 year ago

I have had a look, I think this all makes sense, but I wonder if the default boundary type for SWAN should be BOUNDSPEC rather than BOUNDNEST1.

rafa-guedes commented 1 year ago

We can make BOUNDSPEC the default @pbranson, my idea was to allow generating the different boundary types by interfacing with the data objects, Boundnest1 only happened to be the first one to be implemented in this new approach. The way these objects are being defined might as well change if that makes more sense.

The main thing with this current pull request though is the separation of the previously-defined rompy.swan.boundary.DataBoundary into a rompy.core.boundary.BoundaryWaveStation part which interacts with "stations" dataset and interpolates the spectra, and a rompy.core.swan.Boundnest1 part, which modifies BoundaryWaveStation to produce boundary in swan ascii format for the boundnest1 command (which is what DataBoundary was doing before). We could then implement similar objects to generate BOUNDSPEC etc. This will also allow using the logic defined with BoundaryWaveStation with schism and other models more easily.

rafa-guedes commented 1 year ago

@benjaminleighton would you be able to also review this and merge if happy please since you have been working with that boundary object? This implements some changes from DataBoundary.

benjaminleighton commented 1 year ago

Hi @rafa-guedes this looks good to me.