Skip to content

Commit 62e5563

Browse files
committed
add one_grid arg for tolon
1 parent ef2178a commit 62e5563

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nctoolkit/to_lonlat.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from nctoolkit.temp_file import temp_file
44

55

6-
def to_latlon(self, lon=None, lat=None, res=None, method="bil", recycle=False):
6+
def to_latlon(
7+
self, lon=None, lat=None, res=None, method="bil", recycle=False, one_grid=False
8+
):
79
"""
810
Regrid a dataset to a regular latlon grid
911
@@ -29,6 +31,8 @@ def to_latlon(self, lon=None, lat=None, res=None, method="bil", recycle=False):
2931
recycle : bool
3032
Do you want the grid and weights to be available for recycling and use in regrid?
3133
Defaults to False
34+
one_grid : bool
35+
Set to True if all files in multi-file dataset have the same grid, to speed things up.
3236
3337
"""
3438

@@ -116,7 +120,7 @@ def to_latlon(self, lon=None, lat=None, res=None, method="bil", recycle=False):
116120
append_safe(grid_file)
117121

118122
# call regrid
119-
self.regrid(grid=grid_file, method=method, recycle=recycle)
123+
self.regrid(grid=grid_file, method=method, recycle=recycle, one_grid=one_grid)
120124

121125
remove_safe(grid_file)
122126

0 commit comments

Comments
 (0)