Skip to content

Commit

Permalink
[telemac] write_meteo: added keywords for API control
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Jan 10, 2024
1 parent f481143 commit 9635d91
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyposeidon/telemac.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ def __init__(self, **kwargs):
if hotstart:
self.hotstart = pd.to_datetime(hotstart)

# specific to meteo grib files
self.gtype = get_value(self, kwargs, "meteo_gtype", "grid")
self.ttype = get_value(self, kwargs, "meteo_ttype", "time")
# convert -180/180 to 0-360
self.convert360 = get_value(self, kwargs, "meteo_convert360", False)

for attr, value in kwargs.items():
if not hasattr(self, attr):
setattr(self, attr, value)
Expand Down Expand Up @@ -942,7 +948,9 @@ def output(self, **kwargs):
# # WRITE METEO FILE
logger.info("saving meteo file.. ")
meteo = os.path.join(path, "input_wind.slf")
self.atm = write_meteo(meteo, geo, self.meteo.Dataset)
self.atm = write_meteo(
meteo, geo, self.meteo.Dataset, gtype=self.gtype, ttype=self.ttype, convert360=self.convert360
)

# WRITE BOUNDARY FILE
logger.info("saving boundary file.. ")
Expand Down

0 comments on commit 9635d91

Please sign in to comment.