Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
priscavdsluis committed Feb 20, 2024
1 parent 3de2bba commit 5f6ac77
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 8 additions & 4 deletions netcdf_to_gltf_converter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

Color = List[float]

class ModelType(StrEnum):
DHYDRO = "D-HYDRO"
XBEACH = "XBEACH"

class BaseModel(PydanticBaseModel):
"""BaseModel defines the base for Pydantic model classes."""

Expand Down Expand Up @@ -94,6 +90,14 @@ def from_file(cls: Type[TJsonConfigFile], path: Path) -> TJsonConfigFile:

return cls.parse_file(path)

class ModelType(StrEnum):
"""The model type of the input data."""

DHYDRO = "D-HYDRO"
"""Output from a D-HYDRO model (UGRID)."""

XBEACH = "XBEACH"
"""Output from an XBEACH model (regular grid)."""

class Variable(BaseModel):
"""Configuration properties of a variable."""
Expand Down
10 changes: 9 additions & 1 deletion netcdf_to_gltf_converter/netcdf/xbeach/xbeach_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
from netcdf_to_gltf_converter.utils.arrays import uint32_array

class XBeachGrid(GridBase):
"""Represents a grid from an XBEACH output file.
XBEACH uses regular grids.
"""

def __init__(self, dataset: xr.Dataset):
"""Initialize a new instance of the `XBeachGrid` class.
Args:
dataset (xr.Dataset): The dataset retrieved from the netCDF file.
"""
x_coord_var = get_coordinate_variables(dataset, "projection_x_coordinate")[0]
y_coord_var = get_coordinate_variables(dataset, "projection_y_coordinate")[0]
n_vertex_cols = len(x_coord_var.data[0])
Expand Down Expand Up @@ -72,7 +80,7 @@ def fill_value(self) -> int:
return -1

class XBeachVariable(VariableBase):
"""Class that serves as a wrapper object for an xarray.DataArray with UGrid conventions.
"""Class that serves as a wrapper object for an xarray.DataArray for XBEACH output.
The wrapper allows for easier retrieval of relevant data.
"""

Expand Down

0 comments on commit 5f6ac77

Please sign in to comment.