environmentaltools.temporal.reconstruction

environmentaltools.temporal.reconstruction(cases_deep, data_deep, cases_shallow, index, base_vars, recons_vars, method='rbf-multiquadric', smooth=0.5, optimize=False, optimizer='local', eps=1.0, scale_data=False, scaler_method='StandardScaler')[source]

Reconstructs deep water variables from shallow water data using regression methods.

This function uses relationships established between deep and shallow water data to reconstruct missing deep water variables based on available base variables.

Parameters:
  • cases_deep (pd.DataFrame) – Representative cases with deep water data (training X)

  • data_deep (pd.DataFrame) – Deep water data to reconstruct (prediction X)

  • cases_shallow (pd.DataFrame) – Corresponding shallow water cases (training Y)

  • index (pd.Index) – Index for the reconstructed data

  • base_vars (list) – Names of base variables used for reconstruction

  • recons_vars (list) – Names of variables to be reconstructed

  • method (str, optional) – Regression method. Defaults to ‘rbf-multiquadric’. Options: ‘linear’, ‘nearest’, ‘cubic’, ‘rbf-’, ‘gp-

  • smooth (float, optional) – Smoothing parameter for RBF. Defaults to 0.5.

  • optimize (bool, optional) – Whether to optimize RBF epsilon. Defaults to True.

  • scale_data (bool, optional) – If False, data will not be scaled. Defaults to True.

  • scaler_method (str, optional) – Scaling method for normalization. Defaults to ‘StandardScaler’.

Returns:

Reconstructed deep water data with variables in recons_vars

Return type:

pd.DataFrame

Example

>>> reconstructed = reconstruction(
...     cases_deep=deep_cases,
...     data_deep=deep_data,
...     cases_shallow=shallow_cases,
...     index=deep_data.index,
...     base_vars=['Hs', 'Tp'],
...     recons_vars=['U10', 'Dir']
... )