Skip to main content
U.S. flag

An official website of the United States government


An official USGS software project is code reviewed and approved at the bureau-level for distribution.

Filter Total Items: 523

Code for: Leveraging local efforts to solve regional-scale ecological questions: using multiple sources of data and a multi-species occupancy model to explore bee-plant interactions

This repository contains all of the scripts to reproduce the analyses, figures, and tables associated with the manuscript Lee et al. in prep. The scripts are organized in the order in which they should be run. Briefly, the files do the following: format the data, fit the model, create the figures, and create the tables.


DataRetrieval.jl is a Julia alternative to the R dataRetrieval package for obtaining USGS water data directly from web services.


This repository contains code for the analysis from a study that examined mortality and qPCR detection in 4 groups of fish: an uninfected control group, an infected control group, and two treatment groups. The main goals were to determine if their were differences in mortality and qPCR detection of the parasite among the differing groups. Mortality was addressed using a Generalized Linear Mixed M

Software for SIR 'Effect of Data Pooling on Predictions From the Three-Part Method for Quantitative Mineral Resource Assessment-An Investigation of a Previous U.S. Geological Survey Assessment'

The Three-Part Method for Quantitative Mineral Resource Assessment has been used by the USGS to predict mineral resources since at least 1975. These predictions use pooled data, and the effects of the pooling on the predictions is investigated and reported in the forthcoming USGS publication. The calculations and figures for this report are performed with software that will be permanently stored i

Per- and Polyfluoroalkyl Substances (PFAS) in U.S. Tapwater: Comparison of Public-Supply and Underserved Private-Well Exposures and Associated Health Implications

This software involves files to fit the statistical models described in Smalling et al. Specifically, there are R scripts and associated stan model files (when appropriate) for comparing PFAS concentrations among public-supply and private-wells and as a function of geospatial predictor variables. There is also an R script for modeling the number of PFAS chemicals detected among water sources and


Heavy is a Fortran program for calculating the change in gravity caused by the change in groundwater storage as predicted by a MODFLOW groundwater-flow model. Gravity change is calculated relative to the initial time step at user-specified locations (e.g., measurement locations). At each location, the gravitational attraction is the sum of the attraction caused by storage change (confined or uncon

Golden Eagle Survival in the Great Plains, Nestlings, with Territory and Time Random Effects - Supplemental Code

R code for modeling survival of nestling and fledgling golden eagles. It is supplemental material for a manuscript submitted to Journal of Raptor Research.


The R package precompute is used to perform periodic computations to set up data for loading and rendering in Shiny applications. These computations typically take too long to conduct on the fly, which is why they are performed with some frequency using this package.

SYNthetic DEPTH Phase Modeling (SYNDEPTH)

This python code models event depths by comparing high-frequency (~0.5-0.04 Hz) teleseismic body-wave waveforms to synthetics. High-frequency body waves contain depth information, primarily in the form of depth phases. While lower frequencies are used to generate moment tensor solutions, high-frequency body waves allow for more accurate estimates of source depth. A moment tensor solution must exis

fluvial-particle, U.S. Geological Survey software release

This Python package provides functions to simulate advection and dispersion of numerical particles using a lagrangian particle-tracking algorithm for 2 and 3-dimensionl hydraulic simulation results. Users may customize particle subclasses to provide custom particle classes. For example, the drift of larval fish, by creating classes to add behavior to particles. (McDonald and Nelson, 2021).

WREG: Weighted Least Squares Regression for Streamflow Frequency Statistics

Software package to support regression-based regionalization of streamflow frequency statistics that follow a log-Pearson type III distribution.