diff --git a/pygmtsar/pygmtsar/PRM.py b/pygmtsar/pygmtsar/PRM.py index 09400767..4d4eb91d 100755 --- a/pygmtsar/pygmtsar/PRM.py +++ b/pygmtsar/pygmtsar/PRM.py @@ -957,6 +957,9 @@ def intf(self, other, basedir, topo_fromfile, basename=None, wavelength=200, psi import numpy as np import xarray as xr import dask.array + import warnings + # suppress Dask warning "RuntimeWarning: divide by zero encountered in divide" + warnings.filterwarnings("ignore", category=RuntimeWarning, module="dask.core") if not isinstance(other, PRM): raise Exception('Argument "other" should be PRM class instance') @@ -980,15 +983,6 @@ def intf(self, other, basedir, topo_fromfile, basename=None, wavelength=200, psi # make full file name, use workaround for 'weight' argument name defined without extension fullname = lambda name: os.path.join(basedir, basename + name if name[-4:]=='.grd' else f'{subswath}_{name}.grd') -# # weight can be None, xarray dataarray, NetCDF file name -# if weight is not None and isinstance(weight, str): -# if debug: -# print (f'DEBUG: intf weight from file {weight}') -# weight = xr.open_dataarray(fullname(weight), engine=self.engine, chunks=chunksize) -# # revert fake dimension names -# if weight.dims == ('a', 'r'): -# weight = weight.rename({'a': 'y', 'r': 'x'}) - # prepare PRMs for the calculation below other.set(self.SAT_baseline(other, tail=9)) self.set(self.SAT_baseline(self).sel('SC_height','SC_height_start','SC_height_end'))