uxarray.io._scrip._encode_scrip#
- uxarray.io._scrip._encode_scrip(face_node_connectivity, node_lon, node_lat, face_areas)#
Function to reassign UGRID formatted variables to SCRIP formatted variables.
Currently, supports creating unstructured SCRIP grid files following traditional SCRIP naming practices (grid_corner_lat, grid_center_lat, etc).
Unstructured grid SCRIP files will have
grid_rank=1
and include variablesgrid_imask
andgrid_area
in the dataset.More information on structured vs unstructured SCRIP files can be found here on the Earth System Modeling Framework website.
- Parameters:
outfile (str) – Name of file to be created. Saved to working directory, or to specified location if full path to new file is provided.
face_node_connectivity (xarray.DataArray) – Face-node connectivity. This variable should come from the
Grid
object that calls this functionnode_lon (xarray.DataArray) – Nodes’ x values. This variable should come from the
Grid
object that calls this functionnode_lat (xarray.DataArray) – Nodes’ y values. This variable should come from the
Grid
object that calls this functionface_areas (numpy.ndarray) – Face areas. This variable should come from the
Grid
object that calls this function
- Returns:
ds – Dataset to be returned by
_encode_scrip
. The function returns the output dataset in SCRIP format for immediate use.- Return type: