Skip to content

Derived variables#327

Merged
bpbond merged 14 commits into
dev-v2from
derived
Jun 23, 2025
Merged

Derived variables#327
bpbond merged 14 commits into
dev-v2from
derived

Conversation

@bpbond

@bpbond bpbond commented Jun 21, 2025

Copy link
Copy Markdown
Member

Implement derived variables; add L2 plots; debug code after running all 2024 data through

@bpbond bpbond linked an issue Jun 21, 2025 that may be closed by this pull request
@bpbond
bpbond marked this pull request as ready for review June 23, 2025 01:20
@bpbond
bpbond merged commit 636f9cd into dev-v2 Jun 23, 2025
1 check passed
@bpbond
bpbond deleted the derived branch June 23, 2025 01:30
@Fausto2504

Fausto2504 commented Jun 23, 2025

Copy link
Copy Markdown

@bpbond,

This is a how COMPASS calculates groundwater level below the soil surface.

For this, you need Aquatroll instalation info:
https://docs.google.com/spreadsheets/d/1O4sHvj2FO7EcWEm3WpKEZhFubGn8HCcUsz9EFXhQTXM/edit?gid=0#gid=0

Well measurements (chart explaining): https://docs.google.com/document/d/1N5mJfluWiq6zGNgjLacdm11zS27FqC3tRdE7gdGW9BE/edit?tab=t.0

Methods description:
"Groundwater level above and below the soil surface (GWL, m) was calculated using the relationship between fluid potential and hydraulic head referred to the soil surface. (35) Then, barometric pressure (P, kg m–1 s–1), groundwater density (ρ, kg m–3), gravity (g, m s–2), and depths of pressure sensors were measured during the sondes deployment (DPS) as follows:
GWL = (P / (p*g)) - Dps"
Reference: Machado-Silva et al., 2024 https://pubs.acs.org/doi/10.1021/acs.est.4c01115

R script:

Reading well dimensions to calculate wl_below the surface

well_dimensions <- read_sheet("https://docs.google.com/spreadsheets/d/1O4sHvj2FO7EcWEm3WpKEZhFubGn8HCcUsz9EFXhQTXM/edit#gid=0") %>%
mutate(location = case_when(transect_location == "Upland" ~ "UP",
transect_location == "Transition" ~ "TR",
transect_location == "Wetland" ~ "W"),
ground_to_sensor_cm = ring_to_pressure_sensor_cm - (well_top_to_ground_cm - bolt_to_cap_cm)) %>%
dplyr::select(site, location, ground_to_sensor_cm)

df_raw_depths <- inner_join(df_raw, well_dimensions, by = c("site", "location")) %>%
filter(!is.na(pressure_mbar))

df <- df_raw_depths %>%
mutate(density_gcm3_cor = ifelse(water_density > 0.95, water_density, 1),
pressurehead_m = (pressure_mbar * 100) / (density_gcm3_cor * 1000 * 9.80665),
wl_below_surface_m = pressurehead_m - (ground_to_sensor_cm / 100))

In the R script:
GWL = wl_below_surface_m
P = pressurehead_m
p = density_gcm3_cor
g = 9.80665
Dps = ground_to_sensor_cm
Note: Multiplications 100 and 1000 are unit conversions

@bpbond

bpbond commented Jun 23, 2025

Copy link
Copy Markdown
Member Author

Thank you @Fausto2504 !

I will look at this and a script that @peterregier sent by email and let you guys know if I have questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thinking through Level 2

2 participants