I'm looking to select all data from an xarray
dataset that is between one point and another. This is of course easy with sel
for example with a dataset based on a lat/lon grid to subset from a global dataset to the Atlantic coastline I can do ds_geo_subset = ds.sel( lat=slice(42, 20), lon=slice(-85,-65))
but I want to select all data along the Gulf Stream front, basically from to point (-78 lon, 32 lat) to (-72 lon, 36 lat) but I'm not sure how to do this. Would this be best done by giving a full point dataset and getting data from each point or can these two end points be given to xarray and interpolated data returned?
Get all grid values on a diagonal line from point to point in xarray
988 views Asked by clifgray At
1
As the comment above suggested,
Metpy
has a specific function which can be handy for this task.Here is a nice example to plot a cross-section.