Coder Social home page Coder Social logo

acp-mapping's Introduction

Lifecycle: experimental

Arctic Coastal Plain Waterfowl and Waterbird Spatial and Temporal Trends

Overview

This project aims to estimate spatial and temporal trends of waterfowl and waterbirds on the Arctic Coastal Plain (ACP) of Alaska from 2007 to present. The main approach is motivated by Amundson et al. (2019) using space-time generalized additive models (GAMs, Wood 2017) but with some improvements to handle observer effects and to associate sampling effort to specific spatial locations along a sampled transect similar to Miller et al. (2013). As part of this effort, a major data quality control process was begun in March 2022 that led to the correction of many data errors and re-formatting of the original 2007 to 2023 data to make it more accessible and usable to outside partners (original raw data available here). Because of the errors present in the raw data, the newer data products associated with the project on this page should be distributed for use. The original raw data should not be used for population estimates, mapping, or trend analyses. Major data errors found include mislabeled transects, location points outside of North America, duplicate data observations, a transect numbering system that does not correspond to sample units, and etc. The full data quality control process is detailed in the R code file ACPmapping.R and new problems should be reported on the project GitHub site as issues or bugs (link here). The data, including geographic polygon design files, have also been re-formatted and simplified to be easier to use, understand, and produce simple design-based population indexes. A major new data product is a geographic lines data set that connects transect start and end points and bird observations into lines that approximate airplane flight tracks to measure survey effort. This was necessary because the original flight tracks have been lost or have not been curated into usable products. These are needed because airplane flight paths often deviate from the designed transects due to weather or other factors. The full data set associated with this project is available here.

Following Miller et al. (2013), GAMs are fit to data assigned to transect segments, and after a process of model checking and development, relative density predictions are made across a grid (currently 750m cells) for each year after removing any effect of observer, which are treated as random effects. Currently, species detection is not incorporated in these predictions (as it is in Miller et al. 2019), so these are not strict density or population estimates but display the relative variation after statistically removing observer effects. From these predictions, relative density maps and associated uncertainty can be produced for any year, and population estimates can be made by summing predicted population size over the entire map or sub-region of interest, potentially incorporating a detection rate estimate. Population temporal trends for specific locations or the entire map are estimated as the geometric mean of expected population size over a specific time interval. Uncertainty is estimated by simulation from the posterior distribution of model parameters. Because the GAM estimates a continuous function of space and time, predictions can be made at any resolution or into unsampled locations (between transects) or unsampled years (2020). If the interpolation distance is not too great, the model should provide reasonable estimates.

Spectacled eider relative density across the Arctic Coastal Plain in 2020 as predicted from a space-time GAM. Predictions are expected number of eiders per kilometer squared seen by an average observer.

The main uses for these data products are for ESA Section 7 consultations and Species Status Assessments, as well as general avian distribution and trend maps. Harvest management is also based on some of these data, but as of 2023 those rely on design-based population estimates, which can easily be produced from the bird observation data in combination with transect design data. Because of the data quality errors discussed above, estimates documented in the Pacific Flyway Council Databook available here or the USFWS Alaska Region 7 waterfowl status memo, or historical estimates reported in the R package AKaerial will not match estimates obtained from this version of the data (as of 2024). Please report any data errors or quality issues on this GitHub page.

Currently only for the spectacled eider has a GAM been fit and predicted densities estimated. Other species will be added as time or demand allow. If there is a specific request, contact the project maintainer or submit an issue.

Amundson, C. L., P. L. Flint, R. A. Stehn, R. M. Platte, H. M. Wilson, W. W. Larned and J. B. Fischer. 2019. Spatio-temporal population change of Arctic-breeding waterbirds on the Arctic Coastal Plain of Alaska. Avian Conservation and Ecology 14(1):18, https://doi.org/10.5751/ACE-01383-140118

Miller, D. L., Burt, M. L., Rexstad, E. A., & Thomas, L. (2013). Spatial models for distance sampling data: recent developments and future directions. Methods in Ecology and Evolution, 4(11), 1001-1010, https://doi.org/10.1111/2041-210X.12105

Wood, S.N. (2017) Generalized Additive Models: An Introduction with R (2nd edition). Chapman and Hall/CRC.

Installation

R v4.3.1 or higher is required. Necessary packages are documented in code files.

Usage

Code is presented only for documentation purposes. Download individual code files and data to a local directory, then run using R v4.3.1. Documentation for R functions and scripts are mostly presented as comments in the code files.

The file ACPmapping.R is the main block of code that documents the data error discovery process, the fixes, and produces new data files. These include: bird observations, geographic survey area polygons, geographic transect lines, and approximate flight line paths. Bird observation are distributed as a single CSV, and geographic files are distributed as SQLite GeoPackage databases at ScienceBase. A zip folder containing all data, data products, and metadata is available at the link above.

The file map_eiders.R documents developmental code used to explore models and maps for spectacled and Steller's eider. The file map_density_functions.R contains various helper functions to fit models, make maps, and produce population estimates from a fitted GAM model. The files of the structure fit_[four letter code].R, e.g. fit_SPEI.R, contain species-specific model development and checking code that writes a fitted GAM object to a .RDS file used for predictions. As shown by Amundson et al. (2019) model fit details tend to differ somewhat for each species; thus, the development process is documented separately. The file write_map.R reads the .RDS model object, produces density estimates, and writes predictions to an SQLite GeoPackage database. Importantly, this database contains a data table with the git commit information identifying the code version (date, time, ssh hash, name and email) that was used to create density estimates.

These files will change frequently over time as model development is ongoing.

Getting help

Contact Erik Osnas for questions about this repository, source data, data products, or to report bugs or data errors.

Contribute

Contact the project maintainer for information about contributing to this repository. Submit a GitHub Issue to report bug, request a feature or enhancement, or to report a data quality problem.

acp-mapping's People

Contributors

eosnas avatar

Watchers

 avatar  avatar  avatar

acp-mapping's Issues

"nibblets" in transect data file

There are very small sections of design transects for one stratum that fall over a stratum boundary and end in another stratum--"nibblets" as they have been named. There are 84 of these < 1 m in length and some much larger. As far as I can tell, these only affect design-based estimates and not the model-based density calculations that are the focus of this repo. They were discovered, however, while attempting to calculated design-based estimates from the QC'ed data for comparison to AKaerial. AKaerial deals with "nibblets" internally but applies "programmatic rules" to data not implemented here and has not caught all errors fixed here. Design-based estimates will not be the same between those calculated here and AKaerial.

SCOT and BLSC as code for Black Scoter

Discovered both SCOT and BLSC are in bird data set:

table(scoters$Species)

BLSC SCOT SUSC UNSC WWSC
31 1 26 2913 607

According to the data dictionary SCOT is for black scoter. Discussion with Chuck indicates that SCOT is used on the NA survey, But this does not make sense for the ACP, as there seems to be an attempt identify scoters to species and there is only one observer in all years of SCOT. Should change to BLSC and update the data dictionary.

typo in observer initials

On 2024-03-20 while writing a metadata data dictionary record for the bird observation, I discovered observer initials RMD and RDM. RMD is R. MacDonald but there is no record of an observer name flying the ACP that could correspond to RDM (see excel file "2007-Present ACP Crew and Dates Table_Wilson.xlsx" or ACP report). Most likely a typo.

This effects the statistical estimation of observer effects and thus, temporal trends and density estimates. Will need to change and update QC process in ACPmapping.R and re-run model and maps.

> dat <- read_csv(file = "Data/ACP_2023/analysis_output/Bird_QC_Obs2024-02-15.csv")
Rows: 131563 Columns: 15                                                                                                     
── Column specification ──────────────────────────────────────────────────────────────────
Delimiter: ","
chr  (5): Stratum, Observer, Seat, Species, Obs_Type
dbl (10): Year, Month, Day, Time, Transect, NavTransect, Num, Code, Lon, Lat

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
> table(dat$Observer)

  DES   HMW   KSB   RDM   RMD   WGS   WWL 
10998 41300  1832  5384  9655  8363 54031 
> table(dat$Year, dat$Observer)
      
        DES  HMW  KSB  RDM  RMD  WGS  WWL
  2007    0    0    0    0 3774    0 4678
  2008    0    0    0    0 5881    0 4477
  2009    0    0    0 5384    0    0 4295
  2010    0    0 1832    0    0 4056 1812
  2011    0    0    0    0    0 4307 5030
  2012    0 4728    0    0    0    0 5792
  2013    0 3136    0    0    0    0 4894
  2014    0 2929    0    0    0    0 4845
  2015    0 4036    0    0    0    0 5689
  2016    0 4635    0    0    0    0 6279
  2017    0 4641    0    0    0    0 6240
  2018    0 4642    0    0    0    0    0
  2019 3916 3986    0    0    0    0    0
  2022 3770 4767    0    0    0    0    0
  2023 3312 3800    0    0    0    0    0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.