This is a snippet of the code below from where I formed the xarray Dataset:
ds = xr.Dataset(
data_vars=dict(
glm_ff=(["x", "y"], grid)
),
coords=dict(
lon=(["x", "y"], lon),
lat=(["x", "y"], lat)
),
attrs=dict(description="Flashes per km squared per second."),
)
print('print new file: ', ds)
glm_ff = ds['glm_ff']
print('print variable: ', glm_ff)
####----------- XEMF Regrid
ds_out = xe.util.grid_global(1.25, 1)
print(ds_out)
regridder = xe.Regridder(ds, ds_out, "bilinear", periodic=True)
glm_ff_downscale = regridder(glm_ff)
glm_ff_downscale.to_netcdf('glm_ff_downscale_052019_xesmf.nc', mode='w')
Here is a portion of the error log file below after the code runs overnight for 12+ hours:
Dimensions: (y: 180, x: 288, y_b: 181, x_b: 289)
Coordinates:
lon (y, x) float64 -179.4 -178.1 -176.9 -175.6 ... 176.9 178.1 179.4
lat (y, x) float64 -89.5 -89.5 -89.5 -89.5 ... 89.5 89.5 89.5 89.5
lon_b (y_b, x_b) float64 -180.0 -178.8 -177.5 ... 177.5 178.8 180.0
lat_b (y_b, x_b) int64 -90 -90 -90 -90 -90 -90 -90 ... 90 90 90 90 90 90
Dimensions without coordinates: y, x, y_b, x_b
Data variables:
*empty*
Traceback (most recent call last):
File "lat_lon_xesmf2.py", line 60, in <module>
regridder = xe.Regridder(ds, ds_out, "bilinear")
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/xesmf/frontend.py", line 772, in __init__
super().__init__(grid_in, grid_out, method, input_dims=input_dims, **kwargs)
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/xesmf/frontend.py", line 315, in __init__
weights = self._compute_weights() # Dictionary of weights
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/xesmf/frontend.py", line 375, in _compute_weights
ignore_degenerate=self.ignore_degenerate,
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/xesmf/backend.py", line 481, in esmf_regrid_build
regrid = ESMF.Regrid(sourcefield, destfield, **kwargs)
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/ESMF/util/decorators.py", line 64, in new_func
return func(*args, **kwargs)
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/ESMF/api/regrid.py", line 185, in __init__
dstFracField=dst_frac_field
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/ESMF/interface/cbindings.py", line 2068, in ESMP_FieldRegridStore
handle_esmf_error(rc, 'ESMC_FieldRegridStore')
File "/app/spack/v0.15/linux-rhel7-x86_64/gcc-4.8.5/python/3.7.7-d6cyi6ophaei6arnmzya2kn6yumye2yl/lib/python3.7/site-packages/ESMF/interface/cbindings.py", line 26, in handle_esmf_error
raise ValueError(msg)
ValueError: ESMC_FieldRegridStore failed with rc = 506. Please check the log files (named "*ESMF_LogFile").