Requirement: cartesian data to latlon and vice-versa for a grid file.
The current function encode_as has an output grid type as the only argument.
Can we add another argument that can change the grid from cartesian to spherical?
Current implementation:
def encode_as(self, grid_type):
"""Encodes the grid as a new `xarray.Dataset` per grid format supplied
in the `grid_type` argument.
Parameters
----------
grid_type : str, required
Grid type of output dataset.
Currently supported options are "ugrid", "exodus", and "scrip"
Returns
-------
out_ds : xarray.Dataset
The output `xarray.Dataset` that is encoded from the this grid.
New option:
def encode_as(self, grid_type, coord_type):
coord_type by default is the same as the original grid
if specified as something else, we can transform coordinates internally.
Requirement: cartesian data to latlon and vice-versa for a grid file.
The current function
encode_as
has an output grid type as the only argument. Can we add another argument that can change the grid from cartesian to spherical?Current implementation:
New option:
This would use helper functions such as: