Open cchwala opened 8 months ago
xarray
Accessors for plotting the CML paths. IMO it works great.Things we should do/discuss now:
plot_map.plot_lines(cmls, ...)
which take a xarray.Dataset
as input or if we consider these functions redundant because the exact same thing can be achieved with ds_cmls.plg.plot_cmls(...)
. This currently calls plot_map.plot_lines
but it could also call the lower-level function plot_map.scatter_lines
which does not require a xarray.Dataset
as input and which can also serve as basis for plotting for SMLs.xarray
Accessors for other functions, e.g. spatial distance, finding nearest neigbor, projecting coordinates.
Because we use
xarray.Dataset
andxarray.DataArray
as our data container it would be best and most convenient to make as much functionality as possible accessible via custom xarray Accessors so that we can e.g. plot the CML paths like thiswhere
plg
is our custom accessor.If we go this step, we could also make some basics functions that work in the background more general regarding their input, e.g. allow plotting colored lines by passing the coordinates and values as numpy arrays and not rely on
xarray.Dataset
in these "low-level functions" because one can call the functions via the xarray Accessor. The only question would where to put the detailed doc string, in the low-level function or in the accessor method.