An official website of the United States government
Here's how you know
Official websites use .gov
A .gov website belongs to an official government organization in the United States.
Secure .gov websites use HTTPS
A lock or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.
This site is not designed for mobile use.
For the best experience, please visit on a desktop or laptop.
Email yourself the link!San Francisco Estuary Generalized Additive Model:
Visualizing a data driven approach to modeling water quality trends in the San Francisco Bay
- GAM Visualization
- Surface Data
- Profile Data
- Parameter Plots
- Data Exploration
- References and Supplemental Information
About the Generalized Additive Model
A generalized additive model (GAM) is an extension of generalized linear models (GLM) that more accurately model complex relationships between the predictor variables (variables that can affect the response variables, or be used to predict or explain them) and response variables (variables of interest that are measured or observed). This makes them especially powerful in environmental modelling, where the relationships between variables are often non-linear and non-additive. This GAM uses a single spline, the continuous day of the water year (where October 1st is day 1 and September 30th is day 365), to generate the curve. The upper limit for the knots in this model is 12 times the number of years in the selected date range. Knots are points along the spline between which the curve must adhere to a single function. At each knot, the behavior of the curve may change. See Beck and others (2022) for in-depth information about the GAM approach to water quality trend analysis.
About the Data
This data visualization application contains data from two independent data sources. The first is the United States Geological Survey’s (USGS)
Water Quality of San Francisco Bay Research and Monitoring Project that has been measuring changes in water quality for over 50 years (Schraga and Cloern, 2017).
The data is publicly available at the San Francisco Bay Water Quality Database.
For the past five decades the USGS has conducted ship-based measurements of water quality along a 145-kilometer-deep water transect that spans the length of the entire system from ocean to inland delta.
USGS scientists sample the full salinity gradient on monthly cruises, measuring the basic elements of water quality that define the sustainability of the bay as habitat for fish and organisms of the lower trophic levels.
Using both oceanographic sensors and discrete water collection, the USGS measures salinity, temperature, light extinction coefficient, chlorophyll-α, dissolved oxygen, suspended particulate matter, nitrate, nitrite,
ammonium, silicate, and phosphate.
The second dataset is the product of the Interagency Ecological Program’s
Environmental Monitoring Program (EMP), for which the discrete water quality data can be sourced from the Environmental Data Initiative.
Since 1975 they have monitored discrete water quality and nutrients in the upper San Francisco Estuary. The objectives of the EMP are to obtain consistent and accurate monthly data at established monitoring stations,
provide and document information necessary to achieve compliance with salinity, flow, and dissolved oxygen standards, and to report this information for the purpose of management and conservation of the upper San Francisco Estuary (Battey and Perry, 2024).
The EMP dataset is only represented on this generalized additive model page as an option for users to view GAMs at more stations throughout the estuary. The surface, profile, and data exploration pages reflect only the USGS dataset.
This web application is an extension of the original San Francisco Estuary Institute Nutrient Management System's San Francisco Bay Trends webtool.
For the purposes of this application, and only on the data fed directly into the GAM, a simple interpolation is performed for any gap measuring more than 90 days. In this case, the average value for that measurement, station, and month combination is inserted.
GAM Plot Controls
GAM Seasonal Plot Controls
Units of Measurement
Data Citations
Please use these references to cite data from this page used in your publications.
USGS data from 2022 and after must be considered preliminary.
USGS data from 2016–2021:
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
USGS data from 1969–2015:
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
EMP data from 1975–2023:
Battey, M. and Perry, S., 2024, Interagency Ecological Program: Discrete water quality monitoring in the Sacramento-San Joaquin Bay-Delta, collected by the Environmental Monitoring Program, 1975-2023 ver 12. Environmental Data Initiative, https://doi.org/10.6073/pasta/86f51c3d906e26fbbaf1d112a74f8507.
Surface Observation Controls
About this Plot:
The plot to the right is a geospatial representation of individual transects taken over the selected date and season ranges. The x- and y-axes represent position (decimal longitude and latitude), while the z-axis is time (T), increasing from the first transect. Transects are spaced evenly along the z-axis regardless of their temporal variation. The individual points are colored on a logarithmic color scale based on the selected parameter. Additionally, the data in this plot represents only observations taken between the surface and 3 meters of depth.
Units of Measurement
Data Citations
Please use these references to cite data from this page used in your publications.
USGS data from 2022 and after must be considered preliminary.
USGS data from 2016–2021:
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
USGS data from 1969–2015:
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
Contour Plot Controls
NOTE: Not all parameter/date combinations will produce a plot due to limited data
About this Plot:
The plot to the right shows a contour of the selected parameter over a single transect. The x-axis represents the distance from station 36 (the southernmost station) in kilometers while the y-axis is the depth in meters. The plot is colored by the value of the selected parameter, and the contours are calculated around five equally sized 'bins' between the parameter minimum and maximum. The data is linearly interpolated with the dotted grey lines representing where actual profiles were taken.
Units of Measurement
Data Citations
Please use these references to cite data from this page used in your publications.
USGS data from 2022 and after must be considered preliminary.
USGS data from 2016–2021:
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
USGS data from 1969–2015:
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
Parameter over Time Controls
Parameter over Transect Controls
Units of Measurement
Data Citations
Please use these references to cite data from this page used in your publications.
USGS data from 2022 and after must be considered preliminary.
USGS data from 2016–2021:
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
USGS data from 1969–2015:
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
Table Controls
Selection Metadata
Hover column headers to see parameter descriptions.
Selection View
Hover column headers to see parameter descriptions.
Units of Measurement
Data Citations
Please use these references to cite data from this page used in your publications.
USGS data from 2022 and after must be considered preliminary.
USGS data from 2016–2021:
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
USGS data from 1969–2015:
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
Suggested Citation
Hernes, A.A., Nejad, E.S., Beck, M.W., Senn, D.B., Bernal, J.V., and Bergamaschi, B., 2025, San Francisco Estuary Generalized Additive Model: Visualizing a data driven approach to modeling water quality trends in the San Francisco Bay. U.S. Geological Survey web application, https://doi.org/10.5066/P1ANEDGB
References
Battey, M. and Perry, S., 2024, Interagency Ecological Program: Discrete water quality monitoring in the Sacramento-San Joaquin Bay-Delta, collected by the Environmental Monitoring Program, 1975-2023 ver 12. Environmental Data Initiative, https://doi.org/10.6073/pasta/86f51c3d906e26fbbaf1d112a74f8507.
Beck, M. W., De Valpine, P., Murphy, R., Wren, I., Chelsky, A., Foley, M., & Senn, D. B., 2022, Multi-scale trend analysis of water quality using error propagation of generalized additive models. The Science of the Total Environment, 802, 149927. https://doi.org/10.1016/j.scitotenv.2021.149927
Cloern, J.E., and Schraga, T.S., 2016, USGS Measurements of Water Quality in San Francisco Bay (CA), 1969-2015 (ver. 4.0, March 2023): U. S. Geological Survey data release, https://doi.org/10.5066/F7TQ5ZPR.
Schraga, T.S., Nejad, E.S., Martin, C.A., and Cloern, J.E., 2018, USGS Measurements of Water Quality in San Francisco Bay (CA), 2016-2021 (ver. 4.0, March 2023): U.S. Geological Survey data release, https://doi.org/10.5066/F7D21WGF.
Schraga, T.S. and Cloern, J.E., 2017, Water quality measurements in San Francisco Bay by the U.S. Geological Survey, 1969-2015, Scientific Data, 4:170098, https://doi.org/10.1038/sdata.2017.98.
Vihtakari, Mikko, 2020, PlotSvalbard - Plot research data from Svalbard on maps. R package version 0.9.2. https://github.com/MikkoVihtakari/PlotSvalbard.
Contact
Alexander Hernes
USGS | California Water Science Center
Email: ahernes@usgs.gov
Supplemental Information
Table 1: Glossary of Abbreviations
Header photo: A view of the Golden Gate Bridge with the mouth of the bay and city of San Francisco behind it.