pycmor.fesom_1p4 package#
Submodules#
pycmor.fesom_1p4.load_mesh_data module#
- class pycmor.fesom_1p4.load_mesh_data.fesom_mesh(path, abg=[50, 15, -90], get3d=True)[source]#
Bases:
objectCreates instance of the FESOM mesh.
This class creates instance that contain information about FESOM mesh. At present the class works with ASCII representation of the FESOM grid, but should be extended to be able to read also netCDF version (probably UGRID convention).
Minimum requirement is to provide the path to the directory, where following files should be located (not nessesarely all of them will be used):
nod2d.out
nod3d.out
elem2d.out
aux3d.out
- Parameters:
- x2#
x position (lon) of the surface node
- Type:
array
- y2#
y position (lat) of the surface node
- Type:
array
- zlevs#
array of vertical level depths
- Type:
array
- voltri#
array with 2d volume of triangles
- Type:
array
- Returns:
mesh – fesom_mesh object
- Return type:
- pycmor.fesom_1p4.load_mesh_data.ind_for_depth(depth, mesh)[source]#
Return indexes that belong to certain depth.
- Parameters:
- Returns:
ind_depth (1d array) – vector with the size equal to the size of the surface nodes with index values where we have data values and missing values where we don’t have data values.
ind_noempty (1d array) – vector with indexes of the ind_depth that have data values.
ind_empty (1d array) – vector with indexes of the ind_depth that do not have data values.
- pycmor.fesom_1p4.load_mesh_data.load_mesh(path, abg=[50, 15, -90], get3d=True, usepickle=True, usejoblib=False)[source]#
Loads FESOM mesh
pycmor.fesom_1p4.nodes_to_levels module#
This module contains a function to convert FESOM 1.4 output data stored in the dimensions (nodes, time) to the dimensions (nodes, levels, time).
You can include it in your Pipeline by using the step:
pycmor.fesom1.nodes_to_levels
This script can also be used stand-alone:
$ pycmor scripts fesom1 nodes_to_levels mesh in_path out_path [variable]
The argument [variable] defaults to "temp".
- pycmor.fesom_1p4.nodes_to_levels._convert(meshpath, ipath, opath, variable, ncore, skip)[source]#
Main CLI for FESOM unstructured-to-structured conversion.
- pycmor.fesom_1p4.nodes_to_levels.interpolate_dataarray(ds_in, mesh, indices)[source]#
Applies depth-level interpolation across an entire dataset.
- Parameters:
ds_in (xarray.DataArray) – Input dataset.
mesh (object) – FESOM mesh object.
variable (str) – Variable name to interpolate.
indices (dict) – Precomputed depth and mask indices.
- Returns:
Dataset with interpolated values.
- Return type:
- pycmor.fesom_1p4.nodes_to_levels.interpolate_dataset(ds_in, variable, mesh, indices)[source]#
Interpolate Dataset -> Interpolate DataArray converter function
- pycmor.fesom_1p4.nodes_to_levels.interpolate_to_levels(data, mesh, indices)[source]#
Interpolates unstructured data onto depth levels for FESOM.