Explore your stationary acoustic NABat data using this Rmd example

Get a token for NABat Database

library(nabatr)
# Enter your NABat username here
username = 'NABat_Username'
token = get_nabat_gql_token(username)
token

# Note: if you leave run token = get_nabat_gql_token(),
#   it will prompt you for a username and then a password

Get Project dataframe which contains all of your NABat projects in the NABat Database

# Refresh token
token = get_refresh_token(token)
# Get your projects lookup table
project_df = get_projects(token)
# Display your projects lookup table
project_df

Get all Stationary Acoustic Surveys within a single Project set with project_id

# Refresh token
token = get_refresh_token(token)
# Fill in project id using the project_df lookup table
project_id = 000 # Set equal to one of your project ids

# Get survey dataframe 
sa_survey_df = get_sa_project_summary(token, 
                                      project_df, 
                                      project_id)

sa_proj_dates = unique(sa_survey_df$year)
# Display survey dataframe
sa_survey_df

Get all Stationary Acoustic Survey wav file data. Format: Stationary Acoustic Bulk Upload Template

# Select Year for project (defaults to 1st available year)
year = sa_proj_dates[1]

# Refresh token
token = get_refresh_token(token)
# Get stationary acoustic bulk upload format dataframe
sa_bulk_df = get_sa_bulk_wavs(token, 
                               sa_survey_df,
                               year)
# Display stationary acoustic bulk upload format dataframe
sa_bulk_df


usgs/nabatr documentation built on Jan. 28, 2024, 7:10 a.m.