DOI: 10.5281/zenodo.15611919
title: Supplement to "Managing discharge data quality in sparsely gauged river basins using residual-based diagnostics and model-agnostic uncertainty analysis"

description: This deposit contains the code and data used in "Managing discharge data quality in sparsely gauged river basins using residual-based diagnostics and model-agnostic uncertainty analysis," which has been submitted for peer review. The following directories and files are herein available:





MRB_Q_RC.R is the R script used for formal analysis. Inline comments are provided to guide the user through the workflow. Please change the directory path names as needed. Please also download and install the required libraries prior to execution.




MRB_Q_RC_gg.R is the R script used to reproduce the figures used in the manuscript. Please note that MRB_Q_RC.R must be run first, as MRB_Q_RC_gg.R depends on the objects generated in the initial script.




MRB_CSVs is a directory containing all the required input data to MRB_Q_RC.R





MRB_DMs_in is a subdirectory containing the discharge measurements (“DMs”) or gaugings used to build the rating curves at each of the Mindanao River Basin (“MRB”) gauging stations used in the study: Buluan River (Bln_DMs.csv), Alip River (Alp_DMs.csv), Kapingkong River Basin (Kpn_DMs.csv), and Lanon River Basin (Lnn_DMs.csv). All CSV files have the same attributes:





“Date” — YYYY-MM-DD




“H” — [num] stage (m)




“Q_lps” — [num] discharge (L/s)




“Q_cms” — [num] discharge (m3/s)




“RC_ofcl” — [chr] official rating curve; either “RC_A” or “RC_B”




“Outside_val_per” — [log] if TRUE, the gauging (or more specifically the date of gauging) is outside the validity period of the rating curve. 






MRB_Q_dpwh_in is a subdirectory containing the rated or “processed” discharge data from the Department of Public Works and Highways. Data on all four stations are available: Lnn_DPWH.csv, Kpn_DPWH.csv, Alp_DPWH.csv, and Bln_DPWH.csv. All CSV files have the same attributes: “YEAR” [YYYY], “DAY” [D], and month columns (“JAN” through “DEC”). The values under each month column are discharge estimates in L/s.




MRB_RTs_in is a subdirectory containing the rating tables (“RTs”) for each official rating curve at each gauging station considered: Kapingkong (Kpn_RC_A.csv and Kpn_RC_B.csv); Alip (Alp_RC_A.csv and Alp_RC_B.csv); Lanon (Lnn_RC_A.csv and Lnn_RC_B.csv); and Buluan (Kpn_RC_A.csv and Bln_RC_B.csv). All CSV files have the same attributes: 





“H” — [num] stage (m)




“Q_lps” — [num] discharge (L/s)




“Q_cms” — [num] discharge (m3/s)






MRB_RCs_summ.csv is a CSV file containing a summary table of the gaugings and rating curves used at each station. The file has following attributes:





“River” — [chr] river name




“Station” — [chr] abbreviated station name based on the river name.




“Start_year_Q_ts” — [date] the start date of the discharge record (YYYY-MM-DD)




“End_year_Q_ts” — [date] the end date of the discharge record (YYYY-MM-DD)




“Year_count” — [num] the approximate number of years on record




“RCs_count” — [num] the number of official rating curves developed at each station




“RC_A_start” — [date] the start date of the validity period of the first official rating curve considered (YYYY-MM-DD)




“RC_A_end” — [date] the start end of the validity period of the first official rating curve considered (YYYY-MM-DD)




“RC_B_start” — [date] the start date of the validity period of the second official rating curve considered (YYYY-MM-DD) 




“RC_B_end” — [date] the end date of the validity period of the second official rating curve considered (YYYY-MM-DD) 




“RC_A_start_2” — [date] the start date of the second validity period of the first official rating curve considered (YYYY-MM-DD); applies only to the Buluan station. 




“RC_A_end_2” — [date] the end date of the second validity period of the first official rating curve considered (YYYY-MM-DD); applies only to the Buluan station.






MRB_RCs_rval.csv is a CSV file similar to MRB_RCs_summ.csv, though the data are pivoted wide to long and slightly modified. It has the following attributes: “Station” [chr], “Subperiod” [chr], “RC_ofcl” [chr], “RC_start” in YYYY-MM-DD and “RC_end” in YYYY-MM-DD.