I am working with some atmospheric model outputs available in NetCDF format. I want to calculate Temperature Advection by 850 hPa winds. I tried using the metpy function https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.advection.html#metpy.calc.advection for the same. I am attaching a part of my code. Please help to resolve this error. All required libraries are updated with their latest versions.
import xarray as xr
import numpy as np
import matplotlib.pyplot as plt
from metpy.units import units
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import metpy.calc as mpcalc
temp = xr.open_dataset('ts.nc')
u10 = xr.open_dataset('u10.nc')
v10 = xr.open_dataset('v10.nc')
lat = temp['lat']
lon = temp['lon']
lonn, latt = np.meshgrid(lon,lat)
dx, dy = mpcalc.lat_lon_grid_deltas(lon, lat, )
time = np.array(temp.time[0:9])
T1 = temp['ts'][0:9,:,:]
u10_1 = u10['u10'][0:9,:,:]
v10_1 = v10['v10'][0:9,:,:]
T11 = xr.DataArray(data = T1.values, dims = ['time', 'lat', 'lon'], coords=dict(lat=lat, lon = lon, time = time))
u10_11 = xr.DataArray(data = u10_1.values, dims = ['time', 'lat', 'lon'], coords=dict(lat=lat, lon = lon, time = time))
v10_11 = xr.DataArray(data = v10_1.values, dims = ['time', 'lat', 'lon'], coords=dict(lat=lat, lon = lon, time = time))
advec = mpcalc.advection(T1, [u10_1, v10_1], (dx, dy))
[code][1]
Error: AttributeError: crs attribute is not available.
Please let me know if any further references are required.