Skip to content

NOC-MSM/cf-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Workflow CI Status Code Coverage pre-commit.ci status

cf-tools

Tools based on CF Conventions to post-process OGCMs. The parent accessor gives access to general methods and properties. Child accessors inherit all methods and properties from the parent adding model-specific features.

Parent accessor: obj.cf_tools

Child accessors:

  • obj.nemo_tools

NEMO quick start

# Import
import xarray as xr
from cf_tools.nemo import standardize_output
from dask.distributed import Client
from intake import open_catalog

# Dask Client
client = Client()

# Select simulation from catalog
intake_kwargs = dict(
    name="GSRIDGE36Z",
    time_freq="5d_mean",
)
cat = open_catalog(
    "https://raw.githubusercontent.com/NOC-MSM/intake-catalogs/master/catalog.yaml"
)

# Create a single standardized dataset with all grids
domain = cat.NOCS.GSRIDGE(grid="mesh_mask", **intake_kwargs).to_dask()
output = []
for grid in ("T", "U", "V", "W", "ice"):
    ds = cat.NOCS.GSRIDGE(grid=grid, **intake_kwargs).to_dask()
    output += [standardize_output(ds, domain, hgrid="T" if grid == "ice" else None)]
ds = xr.merge(output)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages