File tree 1 file changed +7
-3
lines changed
lis/utils/usaf/s2s/s2s_modules/s2splots
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 39
39
import cartopy .io .img_tiles as cimgt
40
40
import shapely .geometry as sgeom
41
41
import requests
42
+ import dask
42
43
import PIL
43
44
import numpy as np
44
45
mpl .use ('pdf' )
@@ -544,9 +545,12 @@ def preproc(ds_):
544
545
545
546
def crop (limits , lat , lon , xrin ):
546
547
''' 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 )
550
554
return crop_xcm
551
555
552
556
def getclosest_ij (lats ,lons ,latpt ,lonpt ):
You can’t perform that action at this time.
0 commit comments