Skip to content

Commit 942110d

Browse files
authored
Merge pull request #1568 from smahanam/support/lisf-557ww-7.5_patch3
Support/lisf 557ww 7.5 patch3
2 parents af0d333 + 9bf0201 commit 942110d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import cartopy.io.img_tiles as cimgt
4040
import shapely.geometry as sgeom
4141
import requests
42+
import dask
4243
import PIL
4344
import numpy as np
4445
mpl.use('pdf')
@@ -544,9 +545,12 @@ def preproc(ds_):
544545

545546
def crop (limits, lat, lon, xrin):
546547
''' crops a data set'''
547-
xr_lon = (lon >= limits[2]) & (lon <= limits[3])
548-
xr_lat = (lat >= limits[0]) & (lat <= limits[1])
549-
crop_xcm = xrin.where(xr_lon & xr_lat, drop=True)
548+
with dask.config.set(**{'array.slicing.split_large_chunks': True}):
549+
xr_lon = (lon >= limits[2]) & (lon <= limits[3])
550+
xr_lat = (lat >= limits[0]) & (lat <= limits[1])
551+
xr_lon = xr_lon.compute()
552+
xr_lat = xr_lat.compute()
553+
crop_xcm = xrin.where(xr_lon & xr_lat, drop=True)
550554
return crop_xcm
551555

552556
def getclosest_ij(lats,lons,latpt,lonpt):

0 commit comments

Comments
 (0)