openghg_inversions.hbmcmc.inversionsetup#
Functions used for setting up HBMCMC inversions.
- openghg_inversions.hbmcmc.inversionsetup.create_bc_sensitivity(start_date: str, end_date: str, site: str, fp_data: dict, freq: str) ndarray#
Creates a sensitivity matrix (H-matrix) for the boundary conditions, which will map boundary condition scalings to the observations. This is for a single site. The frequency that the boundary condition sensitivity is specified over must be given in days. Currently only works for a boundary condition from each cardinal direction.
- Parameters:
start_date – Start time of inversion “YYYY-mm-dd”
end_date – End time of inversion “YYYY-mm-dd”
site – Site that you’re creating it for
fp_data – Output from ModelScenario() Should be a dictionary of xr.Dataset/DataArray
freq – Length-scale over which boundary condition sensitivities are specified over. Specified as in pandas, e.g. “30D”.
- Returns:
Sensitivity matrix by for observations to boundary conditions
- Return type:
hmbc
- openghg_inversions.hbmcmc.inversionsetup.monthly_bcs(start_date: str, end_date: str, site: str, fp_data: dict) ndarray#
Creates a sensitivity matrix (H-matrix) for the boundary conditions, which will map monthly boundary condition scalings to the observations. This is for a single site.
- Parameters:
start_date – Start time of inversion “YYYY-mm-dd”
end_date – End time of inversion “YYYY-mm-dd”
site – Site that you’re creating it for
fp_data – Output from utils..bc_sensitivity
- Returns:
Sensitivity matrix by month for observations
- Return type:
hmbc
- openghg_inversions.hbmcmc.inversionsetup.sigma_freq_indicies(ytime: ndarray, sigma_freq: str | None) ndarray#
Create an index that splits times into given periods.
- Parameters:
ytime – concatenated array of time values for observations
sigma_freq – either “monthly”, a pandas format string (“30D”), or None this is the period of time to divide the time array into
- Returns:
index array that defines periods against time
- Return type:
output