slv.inversion.covariances.build_prior_error#

slv.inversion.covariances.build_prior_error(prior, *, time_scale, spatial_scale, base_std=0.0, std_frac=0.0)[source]#

The prior flux error covariance S_0: a Kronecker product of a time and a space decay.

Each cell’s standard deviation is base_std + std_frac * prior; the correlation decays exponentially in time (time_scale) and with the great-circle distance between cells (spatial_scale, km). The covariance is kept as its two factors.

Parameters:
  • prior (pd.Series) – The flux prior, indexed by (time, lat, lon) in any order of the levels.

  • time_scale (str) – The e-folding time of the correlation ("32d").

  • spatial_scale (float) – The e-folding distance of the correlation, in km.

  • base_std (float) – The standard deviation’s floor and its fraction of the prior.

  • std_frac (float) – The standard deviation’s floor and its fraction of the prior.

Returns:

S_0 on the prior’s labels, as the one block flux, kept as Kronecker factors.

Return type:

Covariance