Dashboard
This tutorial shows how to use the Streamlit dashboard for interactive analysis and plotting.
Physical background
Not applicable. The dashboard is a user interface for the analytics already described in earlier tutorials.
Function overview
- The dashboard uses plot functions such as
plot_imp_over_f_plotlyandplot_soil_inversion_plotly. - It calls analytics functions such as
invert_soil_resistivity_layersandsoil_resistivity_curve.
Inputs and outputs
| Function | Input | Output | Description |
|---|---|---|---|
plot_imp_over_f_plotly |
measurement ids | Plotly figure | Impedance vs frequency plot. |
plot_soil_inversion_plotly |
measurement id, inversion options | Plotly figure | Observed vs fitted resistivity plot. |
invert_soil_resistivity_layers |
measurement id, layers | dict | Fitted layered model and misfit. |
soil_resistivity_curve |
measurement id, method | list | Spacing vs apparent resistivity points. |
General workflow
Scenario A: compare impedance across sites
- Launch the dashboard.
- Filter by asset type in the sidebar.
- Select multiple measurements on the map.
- Open the Impedance vs Frequency tab and generate the plot.
Scenario B: soil inversion and model inspection
- Select a soil survey measurement.
- Open the Soil Simulation tab to test a layered model.
- Open the Soil Inversion tab and run the inversion.
- Review the fitted curve and layer table.
Python API examples
Scenario A: compare impedance across sites
from groundmeas.db import connect_db
from groundmeas.visualization.vis_plotly import plot_imp_over_f_plotly
connect_db("groundmeas.db")
fig = plot_imp_over_f_plotly([1, 2, 3])
fig.show()
Scenario B: soil inversion and model inspection
from groundmeas.db import connect_db
from groundmeas.visualization.vis_plotly import plot_soil_inversion_plotly
connect_db("groundmeas.db")
fig = plot_soil_inversion_plotly(
measurement_id=2,
method="wenner",
layers=2,
initial_rho=[120.0, 35.0],
initial_thicknesses=[2.5],
)
fig.show()
CLI examples
Scenario A: compare impedance across sites
Scenario B: soil inversion and model inspection
gm-cli soil-inversion 2 --layers 2 --method wenner \
--initial-rho 120 --initial-rho 35 \
--initial-thickness 2.5
gm-cli plot-soil-inversion 2 --layers 2 --out plots/soil_inv.png
Additional notes
- Large datasets can slow down the dashboard; use filters to reduce selection.
- If the dashboard shows missing data warnings, verify item types and frequencies.
- If soil inversion fails, check spacing values and units for soil resistivity items.