Code for Beach Water Bacterial Responses to Wildfires in California: A Twenty-year Investigation
Abstract
Code for Beach Water Bacterial Responses to Wildfires in California: A Twenty-year Investigation 1. Overview This set of files contains the most important scripts that were used to process data for the archived manuscript, which can be found here: https://essopenarchive.org/doi/full/10.22541/essoar.176798028.83877353 (citations are here) Information pertaining to where to download the files for processing is available in this manuscript. All of the data referenced in the manuscript is/was publicly available for download. For the scripts, correctly set paths and format data appropriately. Inspect the code in detail prior to running to ensure outputs are correct. Ensure inputs are formatted accordingly too in terms of the names and structures of files. Ensure the appropriate Python packages are installed to run the code. Enhancements may be made to improve the computation time. Some spatial and filtering operations were conducted using QGIS and Microsoft Excel. 2. Coastal Watershed and Coastal Zones Watersheds that flow into the ocean and corresponding coastal polygons were produced using HydroBASINS and HydroRIVERS data and QGIS join functions and buffers and knowledge of coastal areas. Spatially redundant polygons (that were produced and observed to facilitate validation of the approach) can be removed to decrease computation time. Spatial files for the watershed polygons (CA_BASINS_SHP_TEST2.shp) and the coastal polygons (ca_coastal_polygons.shp) are included. 3. Land Cover Fractions in Watersheds Run hydrobasin_land_use.py In each basin (watershed), counts of each land cover pixel type are reported in columns with lc_# where # corresponds to the category in the GeoTIFF. There appears to be an overcounting issue with lc_0 (the 0 corresponds to no data) but outputs for all other counts correctly represent the number of pixels of each land cover type in each watershed. This may be due to the formatting of the land cover GeoTIFF, but it is inconsequential to the results of the manuscript. Conversions from pixel counts per watershed Area calculations were conducted for each watershed using GIS and the fractional area of each land cover type was calculated be scaling the sum of the pixels in each watershed by the pixel size and then normalizing by the total area of the watershed. 4. Splitting Fire Scars by Watershed Functions in QGIS algorithms were used to filter the CAL FIRE Historic Fire Perimeters and to split perimeters into smaller polygons by boundaries of the watersheds (applicable for historic fires covering multiple watersheds). One of the files with split fire scar polygons is included (fires_with_basin_areas.shp). 5. Daily Mean Precipitation by Watershed Run rain_column_basins.py (calculates mean daily precipitation in millimeters in each basin – returns annual files from 2003-2023) 6. Time Series and FIB Anomalies Ensure FIB data columns are ordered daily and that corresponding: run these sequentially… Run tit12_works_txt.py (daily analysis of number of FIB analyses, mean, and standard error in each watershed from 2003-2023) Run mergetxt3.py (merges daily time series information for each watershed into a single file) Run timebb.py (incorporates fire history and precipitation [time series correlates] to output time series information for each watershed) Run try21.py (Calibrates non-burn period baselines and identifies FIB anomalies in each watershed – also monitors time series correlates by watershed attributes all at monthly resolution – generates time series plots and scatter plots) Run plots_ppcstat_dict.py or plots_pccp_dict.py [for low numbers of FIB anomalies when plots_ppcstat_dict.py fails] (Compares burn period and non-burn period FIB anomalies with time series correlates and watershed attributes [e.g., land cover] using quantitative metrics described in the manuscript) Run mtc.py (False Discovery Correction – p-values are loaded manually in this case – no files read)
Fields of Study & Subjects
Fecal contamination and water quality
Fire effects on ecosystems
Water Quality and Pollution Assessment
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 31 January 2026