Skip to content

Commit

Permalink
Merge branch 'support/lisf-557ww-7.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
jvgeiger committed Jul 9, 2024
2 parents 49a2181 + 41756ca commit 3193996
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 3193996

Please sign in to comment.