File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 10
10
from pyschism .mesh import Hgrid
11
11
from pyschism .forcing .bctides import Bctides
12
12
13
+ ##Optional: set up environment variable for TPXO files
14
+ #os.environ['TPXO_ELEVATION'] = '/path-to-your-hfile/h_tpxo9.v1.nc'
15
+ #os.environ['TPXO_VELOCITY'] = '/path-to-your-ufile/u_tpxo9.v1.nc'
16
+
13
17
logging .basicConfig (
14
18
format = "[%(asctime)s] %(name)s %(levelname)s: %(message)s" ,
15
19
force = True ,
Original file line number Diff line number Diff line change @@ -101,8 +101,11 @@ def h(self):
101
101
if self ._h_file is None :
102
102
self ._h_file = pathlib .Path (
103
103
appdirs .user_data_dir ('tpxo' )) / TPXO_ELEVATION
104
+ elif type (self ._h_file ) is str :
105
+ self ._h_file = pathlib .Path (self ._h_file )
104
106
if not self ._h_file .exists ():
105
107
raise_missing_file (self ._h_file , TPXO_ELEVATION )
108
+ logger .info (f'h_file is { self ._h_file } ' )
106
109
self ._h = Dataset (self ._h_file )
107
110
return self ._h
108
111
@@ -114,8 +117,11 @@ def uv(self):
114
117
if self ._u_file is None :
115
118
self ._u_file = pathlib .Path (
116
119
appdirs .user_data_dir ('tpxo' )) / TPXO_VELOCITY
120
+ elif type (self ._u_file ) is str :
121
+ self ._u_file = pathlib .Path (self ._u_file )
117
122
if not self ._u_file .exists ():
118
123
raise_missing_file (self ._u_file , TPXO_VELOCITY )
124
+ logger .info (f'u_file is { self ._u_file } ' )
119
125
self ._uv = Dataset (self ._u_file )
120
126
return self ._uv
121
127
You can’t perform that action at this time.
0 commit comments