src.var#

This module defines the data objects used in the program.

Classes

analysis()

Analysis object, contains all the attributes required to compute the idealised pseudo-momentum fluxes

grid()

Grid class

obj()

Helper object to generate class instances on the fly

params()

User parameter class

topo()

Topography class with its corresponding lat-lon values

topo_cell()

Inherits and initialises an instance of src.var.topo, to be used for storing data associated to a grid cell

class src.var.grid#

Grid class

__init__()#

Contains the (lat,lon) of each triangular grid cell with the corresponding vertices (lat_1, lat_2, lat_3), (lon_1, lon_2, lon_3).

link is a lookup table linking the grid cell to the corresponding topography file.

apply_f(f)#

Applies a function to all class attributes, except those listed in non_convertibles

Parameters#

ffunction

arbitrary function to be applied to class attributes, e.g. a radians-degrees converter.

class src.var.topo#

Topography class with its corresponding lat-lon values

__init__()#
class src.var.topo_cell#

Inherits and initialises an instance of src.var.topo, to be used for storing data associated to a grid cell

__init__()#
gen_mgrids(grad=False)#

Generates a meshgrid based on the lat-lon values

Parameters#

gradbool, optional

deprecated by 0.90.0, by default False

get_masked(triangle=None, mask=None)#

Gets the masked attributes

Parameters#

trianglesrc.utils.gen_triangle

instance of the generate-triangle class, by default None

maskarray-like, optional

2D array of the mask, by default None

get_grad_topo(triangle)#

Computes the gradient of the topography

Deprecated since version 0.90.0.

class src.var.analysis#

Analysis object, contains all the attributes required to compute the idealised pseudo-momentum fluxes

__init__()#

Initialises empty attributes

get_attrs(fobj, freqs)#

Copies required attributes given the arguments

Parameters#

fobjsrc.fourier.f_trans

instance of the Fourier transformer

freqsarray-like

2D (abs. valued real) spectrum

grid_kk_ll(fobj, dat)#

Deprecated since version 0.90.0.

class src.var.obj#

Helper object to generate class instances on the fly

__init__()#
print()#
class src.var.params#

User parameter class

Defines required and optional parameters to run a simulation

__init__()#

Defines the required parameters for a simulation run

self_test()#

Checker method if user-defined parameters contains sensible compulsory parameters. Calls src.var.params.check_init() and src.var.params.check_delaunay().

Returns#

bool

True if test passed, False otherwise

check_init()#

Checks if all required parameters are defined.

check_delaunay()#

If run uses a Delaunay triangulation, this method checks if all required parameters are defined.

static checker(arg, compulsory_params)#

Auxiliary function that checks if arg is in compulsory_params