src.data_assimilation.letkf#

Functions

bin_func(obs, ens_mem_shape)

da_interface(results, dap, obs, attr, tout, ...)

Interface for batch-observations localisation with LETKF.

interpolation_func(ensemble, x_obs, y_obs, ud)

none_func(ensemble)

Classes

analysis(ensemble, rho, X_mean, Y_mean[, ...])

LETKF Analysis based on (Hunt et al., 2007).

prepare_rloc(ud, elem, node, dap, N[, ...])

Helper class to get grid-based localisation for LETKF.

src.data_assimilation.letkf.da_interface(results, dap, obs, attr, tout, N, ud)#

Interface for batch-observations localisation with LETKF.

src.data_assimilation.letkf.interpolation_func(ensemble, x_obs, y_obs, ud)#
src.data_assimilation.letkf.bin_func(obs, ens_mem_shape)#
src.data_assimilation.letkf.none_func(ensemble)#
class src.data_assimilation.letkf.analysis(ensemble, rho, X_mean, Y_mean, identifier=None)#

LETKF Analysis based on (Hunt et al., 2007).

__init__(ensemble, rho, X_mean, Y_mean, identifier=None)#
forward(forward_operator)#
localisation(localisation_matrix)#
analyse(obs, obs_covar)#

Analysis method. ‘l’ is the observation space. ‘m’ the state space, ‘k’ the ensemble size.

get_mean(vec)#
static state_vector(ensemble)#
to_array(X)#
debug(obs_current, suffix='')#
class src.data_assimilation.letkf.prepare_rloc(ud, elem, node, dap, N, obs_X=5, obs_Y=5)#

Helper class to get grid-based localisation for LETKF. Used only when da_type==’rloc’ is True.

__init__(ud, elem, node, dap, N, obs_X=5, obs_Y=5)#
sort_locs()#

Given a dictionary of attributes and the index (locs) of its data container, return attributes that are cell-based and node-based.

Note#

Face-based flux is not yet supported.

analyse(results, obs, covar, mask, N, tout)#

Wrapper to do analysis by grid-type.

analyse_by_grid_type(results, obs, covar, mask, N, tout, grid_type)#

Do analysis by grid-type. Wrapper of the LETKF analysis.

Note that k is the ensemble size, m is the size of the local state space, attr_len, and l is the size of the local observation space, obs_X*obs*Y*attr_len

do_analysis#
stack(results, obs, mask, obs_attr, tout)#

On each grid-point, stack all the quantities to be assimilated. This stacking is done separately for cells and nodes.

Quantities, e.g. {rho, rhou, …}.

get_state(state, mask, Nx, Ny, attr_len)#

Get state vector in grid-localised view. This is step 1 of the LETKF algorithm in Hunt et. al. (2007). Prepares global X and ar{X}.

get_obs(obs, mask, obs_X, obs_Y, Nx, Ny, attr_len)#

Get observations vector in grid-localised view.

get_state_in_obs_space(state, mask, obs_attr, obs_X, obs_Y, Nx, Ny, attr_len)#

Get state vector projected onto observation space, in grid-localised view. This is step 1 of the LETKF algorithm in Hunt et. al., 2007.

get_bc_mask(mask, type, Nx, Ny, obs_X, obs_Y, attr_len)#

Mask handling the boundary condition for cell or node grids in the local subdomains.

get_properties(type)#

For a given grid-type (cell / node), return the 2D grid-size (Nx,Ny), the attributes {rho, rhou…} observed on this grid (obs_attr), the number of attributes (attr_len), and the index location of its data container.

Returns#

Nx : int Ny : int obs_attr : list of str attr_len : int loc : int

get_quantity(results, quantity, inner=True)#

Get ensemble representation of {rho, rhou…}.

get_loc_mat(bc_mask, mask_n, n, attr_len)#