Skip to content

Commit

Permalink
Merge pull request #1568 from smahanam/support/lisf-557ww-7.5_patch3
Browse files Browse the repository at this point in the history
Support/lisf 557ww 7.5 patch3
  • Loading branch information
emkemp authored Jul 8, 2024
2 parents af0d333 + 9bf0201 commit 942110d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lis/utils/usaf/s2s/s2s_modules/s2splots/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import cartopy.io.img_tiles as cimgt
import shapely.geometry as sgeom
import requests
import dask
import PIL
import numpy as np
mpl.use('pdf')
Expand Down Expand Up @@ -544,9 +545,12 @@ def preproc(ds_):

def crop (limits, lat, lon, xrin):
''' crops a data set'''
xr_lon = (lon >= limits[2]) & (lon <= limits[3])
xr_lat = (lat >= limits[0]) & (lat <= limits[1])
crop_xcm = xrin.where(xr_lon & xr_lat, drop=True)
with dask.config.set(**{'array.slicing.split_large_chunks': True}):
xr_lon = (lon >= limits[2]) & (lon <= limits[3])
xr_lat = (lat >= limits[0]) & (lat <= limits[1])
xr_lon = xr_lon.compute()
xr_lat = xr_lat.compute()
crop_xcm = xrin.where(xr_lon & xr_lat, drop=True)
return crop_xcm

def getclosest_ij(lats,lons,latpt,lonpt):
Expand Down

0 comments on commit 942110d

Please sign in to comment.