schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
23 stars 18 forks source link

Problem about the windrot #95

Closed Caizhiwen19901122 closed 10 months ago

Caizhiwen19901122 commented 10 months ago

When I try to obtain the windrot_geo2proj.gr3 file, an error occurs as: TypeError: init() missing 1 required positional argument: 'nodes'

The code is: from datetime import datetime from time import time import pathlib

from pyschism.forcing.nws.nws2.era5 import ERA5 from pyschism.forcing.nws.nws2.nws2 import NWS2

from pyschism.mesh.hgrid import Hgrid from pyschism.mesh.gridgr3 import Windrot from pyschism.mesh.base import Gr3

if name == 'main':

startdate=datetime(2018, 1, 1)
rnday=5

t0=time()
hgrid = Gr3.open('./hgrid.gr3', crs='epsg:4326')
bbox = hgrid.get_bbox('EPSG:4326', output_type='bbox')
windrot=Windrot().default(hgrid=Hgrid)
SorooshMani-NOAA commented 10 months ago

@Caizhiwen19901122 when you want to create the wind rotation object from the grid, you should call it like

hgrid = Hgrid.open('./hgrid.gr3', crs='epsg:4326')
windrot = Windrot.default(hgrid=hgrid)

Note that: