geodezyx.volc_deform package
Submodules
geodezyx.volc_deform.calc_bl module
- geodezyx.volc_deform.calc_bl.baselines_plot(df_bl_inp, col='d_mean0', figax_tup=None, marker='', linestyle='-', suptitle='Direct baselines', ylabel='Distance difference (cm)', plt_shift=0.02, plt_factor=100, decim=100)
Plot baseline distance time series for all site pairs.
- Parameters:
df_bl_inp (pandas.DataFrame) – DataFrame of baselines as returned by
calc_baselines_direct()orcalc_baselines_virtual(). Must contain the columnssite1,site2,epochand the column specified by d_col.col (str, optional) – Name of the column to plot on the y-axis. Default is
"d_mean0"(centred running mean distance).figax_tup (tuple of (matplotlib.figure.Figure, matplotlib.axes.Axes) or None, optional) – Existing
(fig, ax)tuple to draw on. IfNonea new figure and axes are created. Default isNone.marker (str, optional) – Matplotlib marker style passed to
ax.plot. Default is""(no marker).linestyle (str, optional) – Matplotlib line style passed to
ax.plot. Default is"-".suptitle (str, optional) – Title string for the figure. Default is
"Direct baselines".
- Returns:
fig (matplotlib.figure.Figure) – The figure object containing the plot.
ax (matplotlib.axes.Axes) – The axes object containing the plot.
- geodezyx.volc_deform.calc_bl.calc_baselines_direct(df_inp, rovbas_pairs, bases_excluded=[], threshold_mad=3.5, xyz_dic_inp=None, mean_win=86400, strain_win=604800)
Compute direct baselines between rovers and their reference base stations.
Each rover position is differenced from the known (or first-epoch) position of its base station to obtain a baseline displacement time series.
- Parameters:
df_inp (pandas.DataFrame) – Input DataFrame containing at least the columns
rover,base,epoch,x,y,z.rovbas_pairs (list of tuple) – List of
(rover, base)pairs to process, e.g.[("ROV1", "BASE1"), ...].bases_excluded (list of str, optional) – Base station names to skip. Default is an empty list.
threshold_mad (float, optional) – Median Absolute Deviation multiplier used as the outlier rejection threshold. Default is 3.5.
xyz_dic_inp (dict or None, optional) – Dictionary mapping base station name to its reference coordinates
{base: [x, y, z]}. IfNoneor the base is not found in the dictionary the first epoch of the rover time series is used as reference. Default isNone.
- Returns:
df_bls – Concatenated DataFrame of baseline metrics (as returned by
_d_calc()) with additional columns:epoch: Observation epoch.site1: Rover site name.site2: Base station name.pivot: AlwaysNonefor direct baselines.
- Return type:
pandas.DataFrame
- geodezyx.volc_deform.calc_bl.calc_baselines_virtual(df_inp, rov12_pairs, pivots, threshold_mad=3.5, mean_win=86400, strain_win=604800)
Compute virtual baselines between rover pairs via a common pivot station.
For each pivot station the positions of two rovers are differenced to produce a virtual baseline, removing common-mode errors introduced by the pivot.
- Parameters:
df_inp (pandas.DataFrame) – Input DataFrame containing at least the columns
base,rover,epoch,x,y,z.rov12_pairs (list of tuple or list of set) – Rover pairs for which virtual baselines should be computed, e.g.
[("ROV1", "ROV2"), ...].pivots (str or list of str) – Name(s) of the pivot (base) station(s) to use.
threshold_mad (float, optional) – Median Absolute Deviation multiplier used as the outlier rejection threshold. Default is 3.5.
- Returns:
df_bls – Concatenated DataFrame of baseline metrics (as returned by
_d_calc()) with additional columns:epoch: Observation epoch.site1: First rover site name.site2: Second rover site name.pivot: Pivot station used to derive the virtual baseline.
- Return type:
pandas.DataFrame
- geodezyx.volc_deform.calc_bl.d_calc(coords_delta, mean_win=86400, strain_win=604800)
Compute baseline distance metrics and strain rate from coordinate differences.
- Parameters:
coords_delta (array-like of shape (N, 3)) – Array of coordinate differences (dx, dy, dz) for each epoch.
mean_win (int, optional) – Rolling window size (in samples) used to compute the running mean of the baseline distance. Default is 86400 (e.g. 1 day at 1 Hz).
strain_win (int or list of int, optional) – Window size(s) (in samples) used to compute the strain rate as the relative change of the running mean distance over the window. Default is 7 * 86400 (e.g. 7 days at 1 Hz).
- Returns:
df_bl – DataFrame with the following columns:
d: Euclidean baseline distance.d0: Distance centred on its median.d_mean: Rolling mean of the distance.d_mean0: Rolling mean centred on the overall median.d_diff: First difference of the distance.strainStrain rate computed over the first window instrain_win (relative change: (last - first) / first).
strain<w>(only when multiple windows are given) Strain ratefor each additional window size w.
- Return type:
pandas.DataFrame