@@ -145,7 +145,7 @@ def _interpolate(self) -> bool:
145145 """Should interpolation to a regular lat/lon grid be performed?"""
146146 return self .interp_res is not None
147147
148- def write (self , filename : str , times : list , pred : np .ndarray ):
148+ def write (self , filename : str , times : np . datetime64 , pred : np .ndarray ):
149149 """Write prediction to NetCDF
150150 Args:
151151 times: List of np.datetime64 objects that this forecast is for
@@ -167,6 +167,9 @@ def c(x):
167167 frt_ut = times_ut [0 ]
168168 coords [c ("time" )] = np .array (times_ut ).astype (np .double )
169169
170+ x : np .ndarray | None = None
171+ y : np .ndarray | None = None
172+
170173 if self ._is_gridded :
171174 if self ._interpolate :
172175 # Find a bounding-box for interpolation
@@ -287,7 +290,7 @@ def c(x):
287290
288291 else :
289292 if self ._is_masked :
290- self ._not_gridded_masked (spatial_dims )
293+ self ._not_gridded_masked (spatial_dims , x , y )
291294 else :
292295 self ._not_gridded_not_masked (spatial_dims )
293296
@@ -296,7 +299,7 @@ def c(x):
296299 self ._set_attrs ()
297300 self ._write_files (filename )
298301
299- def _not_gridded_masked (self , spatial_dims : tuple ):
302+ def _not_gridded_masked (self , spatial_dims : tuple , y , x ):
300303 t0 = pytime .perf_counter ()
301304 if hasattr (self .ds_mask , "lat" ) and hasattr (self .ds_mask , "lon" ):
302305 lat = self .ds_mask .lat .values
0 commit comments