From b43dd45868bca003f1f77e070fb88522e658b73b Mon Sep 17 00:00:00 2001 From: limnoliver Date: Thu, 31 Mar 2022 15:33:12 -0500 Subject: [PATCH] filter out records tagged as "Water, sample" as these are likely temperature of grab samples. See #56 --- 5_data_munge/out/wqp_data_streams.rds.ind | 2 +- 5_data_munge/src/munge_wqp_files.R | 4 +++- ...X211bmdlL291dC93cXBfZGF0YV9zdHJlYW1zLnJkcy5pbmQ.yml | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/5_data_munge/out/wqp_data_streams.rds.ind b/5_data_munge/out/wqp_data_streams.rds.ind index f7bddd7..92ab68e 100644 --- a/5_data_munge/out/wqp_data_streams.rds.ind +++ b/5_data_munge/out/wqp_data_streams.rds.ind @@ -1,2 +1,2 @@ -hash: 2e65f46ab8178a7cb07484aad04cd29d +hash: e1fc3f9ca8c625e78dafa54fa4736432 diff --git a/5_data_munge/src/munge_wqp_files.R b/5_data_munge/src/munge_wqp_files.R index 75589a7..90d8817 100644 --- a/5_data_munge/src/munge_wqp_files.R +++ b/5_data_munge/src/munge_wqp_files.R @@ -7,7 +7,8 @@ filter_site_types <- function(in_ind, sites_ind, keep_types, out_ind) { pull(MonitoringLocationIdentifier) dat <- readRDS(sc_retrieve(in_ind, remake_file = 'getters.yml')) %>% - filter(MonitoringLocationIdentifier %in% sites) + filter(MonitoringLocationIdentifier %in% sites) %>% + filter(!CharacteristicName %in% 'Water, sample') saveRDS(dat, as_data_file(out_ind)) gd_put(out_ind) @@ -31,6 +32,7 @@ munge_wqp_withdepths <- function(in_ind, min_value, max_value, max_daily_range, is.na(`ActivityDepthHeightMeasure/MeasureValue`) & is.na(`ResultDepthHeightMeasure/MeasureValue`) & is.na(`ActivityTopDepthHeightMeasure/MeasureValue`) ~ `ActivityBottomDepthHeightMeasure/MeasureValue` )) + dat <- mutate(dat, sample_depth_unit_code = case_when( !is.na(`ActivityDepthHeightMeasure/MeasureValue`) ~ `ActivityDepthHeightMeasure/MeasureUnitCode`, is.na(`ActivityDepthHeightMeasure/MeasureValue`) & !is.na(`ResultDepthHeightMeasure/MeasureValue`) ~ `ResultDepthHeightMeasure/MeasureUnitCode`, diff --git a/build/status/NV9kYXRhX211bmdlL291dC93cXBfZGF0YV9zdHJlYW1zLnJkcy5pbmQ.yml b/build/status/NV9kYXRhX211bmdlL291dC93cXBfZGF0YV9zdHJlYW1zLnJkcy5pbmQ.yml index bfc51ad..3c795a9 100644 --- a/build/status/NV9kYXRhX211bmdlL291dC93cXBfZGF0YV9zdHJlYW1zLnJkcy5pbmQ.yml +++ b/build/status/NV9kYXRhX211bmdlL291dC93cXBfZGF0YV9zdHJlYW1zLnJkcy5pbmQ.yml @@ -1,14 +1,14 @@ version: 0.3.0 name: 5_data_munge/out/wqp_data_streams.rds.ind type: file -hash: fcf1a007a0c51e1c1ed04e8557e53042 -time: 2021-04-16 17:26:32 UTC +hash: 1091d4b0e14854dd8450a914273a0363 +time: 2022-03-31 20:30:18 UTC depends: - 1_wqp_pull/out/wqp_data.rds.ind: ff1f0c0c41adba063248b83dea39c943 - 1_wqp_pull/inout/wqp_inventory.feather.ind: 9fdcb5bd5f6a63ed85a6e595e022d05f + 1_wqp_pull/out/wqp_data.rds.ind: 1a8dbb9cd4dfd070cbfc946511ca65d7 + 1_wqp_pull/inout/wqp_inventory.feather.ind: 4d0042964407bcf7c2656a19e5c4bcd2 stream_types: ff830476c42cccbd885995ef9cb26b5c fixed: 987ddc70a46a2204bf0a037cfbaf2482 code: functions: - filter_site_types: 18728d55f0b9e889c42708016b3afcf3 + filter_site_types: a923ea39d53730097f3abceb1c329d5a