Validate worldfish Survey Data
validate_wf_surveys.RdValidates survey data from worldfish activities by applying quality control checks and flagging potential data issues. The function filters out submissions that don't meet validation criteria and processes catch data.
Usage
validate_wf_surveys(log_threshold = logger::DEBUG)Value
The function processes and uploads two datasets to cloud storage:
Validation flags for each submission
Validated survey data with invalid submissions removed
Details
The function applies the following validation checks:
Bucket weight validation (max 50 kg per bucket)
Number of buckets validation (max 300 buckets)
Number of individuals validation (max 100 individuals)
Form completeness check for catch details
Catch information completeness check
Alert codes:
5: Bucket weight exceeds maximum
6: Number of buckets exceeds maximum
7: Number of individuals exceeds maximum
8: Incomplete catch form
9: Incomplete catch information
12: Effort indicator is infinite (
n_fishersortrip_durationis zero)13: Fisher count is zero or negative
Note
Requires configuration parameters to be set up in config file
Automatically downloads preprocessed survey data from cloud storage
Removes submissions that fail validation checks, unless a reviewer approved them (read with
coasts::review_decisions())Sets catch_kg to 0 when catch_outcome is 0
Data Processing Steps
Downloads preprocessed survey data and reads reviewers' decisions
Applies validation checks and generates alert flags
Filters out submissions with validation alerts, except those a reviewer approved
Processes catch data and adjusts catch weights
Uploads validation flags and validated data to cloud storage