San Diego Beachwatch Data, With Features

Last Modified: 2018-08-10 22:38

Water quality data for San Diego county beaches from CEDEN, with added features for log transformation, quantiles and group codes.

Documentation

Beachwatch Data, with Enhanced Features

This datasets rebuilds ceden.waterboards.ca.gov-beachwatch-sandiego with constant and null columns removed and many features added. It also breaks out station information into a seperate datasets, and enumerates the many difference combinations of methodname/analyte/unit, adding a code for each group to the dataset in measure_code. The measure code identifies sets of records that have compatible measurements.

The dataset adds counts, mean, median and quantiles for groups of station_code/measure_code. The dataset rows are grouped, for each station and measure code, and mean, median and quantiles computed for each group. The procedure is performed both for result and for lresult, the log of results.

After computing the group summary statistics, the processing creates dichotomous features for the relationship of result and lresult to the summary value, including:

  • Greater than the median
  • Greater than the mean
  • Less than or equal to the 25th percentile
  • Greater than or equal to the 7th percentile

These variables are particularly useful for doing logistic regressions across the measure code groups or stations.

Elided Columns

This datasets excludes the const and empty columns from the source dataset. These columns and their values are:

program                      BeachWatch
parentproject                BeachWatch_San Diego County
project                      BeachWatch_San Diego County
locationcode                 SurfZone
collectiondepth              -88
unitcollectiondepth          NR
sampletypecode               Grab
collectionreplicate          1
resultsreplicate             1
labsampleid                  Not Recorded
matrixname                   samplewater
mdl                          -88
rl                           -88
batchverification            NR
compliancecode               NR
eventcode                    WQ
protocolcode                 Not Recorded
collectionmethodname         Water_Grab
collectiondevicedescription  Not Recorded
calibrationdate              0000-00-00
positionwatercolumn          Not Recorded
preppreservationname         Not Recorded
preppreservationdate         0000-00-00 00:00:00
digestextractmethod          Not Recorded
digestextractdate            0000-00-00
analysisdate                 0000-00-00
dilutionfactor               -88
expectedvalue                0
submissioncode               NR
county                       San Diego
county_fips                  73
regional_board               San Diego
rb_number                    9
sampleid                     Not Recorded

The dataset also excludes these Null columns:

  • observation
  • samplecomments
  • collectioncomments
  • resultscomments
  • batchcomments
  • groupsamples
  • occupationmethod
  • startingbank
  • distancefrombank
  • unitdistancefrombank
  • streamwidth
  • unitstreamwidth
  • stationwaterdepth
  • unitstationwaterdepth
  • hydromod
  • hydromodloc
  • locationdetailwqcomments
  • channelwidth
  • upstreamlength
  • downstreamlength
  • totalreach
  • locationdetailbacomments
  • huc8
  • huc8_number
  • huc10
  • huc10_number
  • huc12
  • huc12_number
  • waterbody_type

Notes

The most prevalent measure code in this dataset is 24 for Enterococcus (analyte) meaured with Enterolert (methodname) in units of MPN/100 mL. This is probably because in 2004, the EPA changed recomendations to use Enterococcus as a primary indicator bacteria in coastal waters:

EPA subsequently recommended the use of E. coli or enterococci for fresh
recreational waters and enterococci for marine recreational waters because
levels of these organisms more accurately predict acute gastrointestinal
illness than levels of fecal coliforms.

Resources

stations
file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/stations.csv
Measurement stations
measure_codes
file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/measure_codes.csv
Measurement group codes
beachwatch
file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/beachwatch.csv
Beachwatch data, with features added

Identity

name
sandiegodata.org-beachwatch-4
identifier
2fd7bc17-28c2-4f4a-b494-1d9ca706a79a

Contacts

Wrangler
Eric Busboom, Civic Knowledge

stations

file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/stations.csv

Measurement stations
HeaderDatatypeDescription
stationnamestringFull name of the station
stationcodestringShort name for the station
stationgroupstringFirst two characters of station code
targetlatitudenumberStation lattitude
targetlongitudenumberStation longitude

measure_codes

file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/measure_codes.csv

Measurement group codes
HeaderDatatypeDescription
analytestringThe type of bacterial being measured, for coliform, total coliform, Enterococcus or E. coli.
methodnamestringMethod used to count bacteria, such as “MTF”, “SM 9222 B” or “Enterolert”
unitstringMeasurement units, type of count per 100 ml.
measure_codeintegerThe number of the unique group of analyte, mehodname and unit.

beachwatch

file:///Users/eric/proj/virt-proj/water/water-datasets/derived/sandiegodata.org-beachwatch/data/beachwatch.csv

Beachwatch data, with features added
HeaderDatatypeDescription
stationcodestringShort name for the station
stationgroupstringFirst two characters of station code
sampledatedatetimeDate sample was taken
collectiontimetimeTime sample was taken
measure_codeintegerReference to the measure codes, the unique groups of analyte, mehodname and unit.
analytestringThe type of bacterial being measured, for coliform, total coliform, Enterococcus or E. coli.
methodnamestringMethod used to count bacteria, such as “MTF”, “SM 9222 B” or “Enterolert”
unitstringMeasurement units, type of count per 100 ml.
resultintegerMeasured value
result_group_countintegerNumber of records in this measurement group
result_group_stdnumberStandard deviation for this group
result_group_meannumberMean for this group
result_group_25pctlnumber25th percentile for this group
result_group_mediannumberMedian for this group
result_group_75pctlnumber75th percentile for this group
result_gt_mediannumber1 if the result is greater than the median, 0 otherwise
result_gt_meannumber1 if the result is greater than the mean, 0 otherwise
result_lte_25pctlnumber1 if the result is less than or equal to the 25th percentile, 0 otherwise
result_gte_75pctlnumber1 if the result is greater than or equal to the 75th percentile, 0 otherwise
lresultnumberLog of measured value
lresult_group_stdnumberStandard deviation of log(result) for this group
lresult_group_meannumberMean of log(result) for this group
lresult_group_25pctlnumber25th percentile of log(result) for this group
lresult_group_mediannumberMedian of log(result) for this group
lresult_group_75pctlnumber75th percentile of log(result) for this group
lresult_gt_lmediannumber1 if the result is greater than the median of log(result) , 0 otherwise
lresult_gt_lmeannumber1 if the result is greater than the mean of log(result) , 0 otherwise
lresult_lte_25pctlnumber1 if the result is less than or equal to the 25th percentile of log(result) , 0 otherwise
lresult_gte_75pctlnumber1 if the result is greater than or equal to the 75th percentile of log(result) , 0 otherwise
labbatchstringIdentifier of the processing group in the lab
resultqualcodestringResult Qualifier code. See result_qual_cv documentation
qacodestringQA code. See qa_cv documentation
sampleagencystringCode for agency that took the sample
labagencystringCode for agency that analyzed sample
submittingagencystringCode for agency that submitted sample to lab