WARNING: DO NOT KNIT THIS DOCUMENT! Run chunks individually.

Introduction

This markdown document contains code used for processing and aligning irradiance data collected using trawl-mounted archival tags (Wildlife Computers TDR-MK9) during AFSC bottom trawl surveys. This code should be run for one vessel/cruise combination at a time.

1. Setup local processing directory

Create a new directory for processing data.

library(trawllight)

channel <- trawllight:::get_connected(schema = "AFSC")
vessel <- 94 # Replace with vessel
cruise <- 202101 # Replace with cruise
survey <- "BS" # Region ("BS", "NBS", "GOA", "AI", or "SLOPE")

# Setup directory
source_path <- "G:/RACE_LIGHT/LightData/Data/year_21/ebs/v_94/" # Replace with the source directory
trawllight::mk9_setup_dir(source_path = source_path,
                          overwrite = TRUE,
                          survey = survey,
                          vessel = vessel,
                          cruise = cruise)

2. Decode .wch file

Use WC-DAP software to decode binary (.wch) files and setup input csv files, as described in decode_mk9_wcdap.Md.

3. Offset

trawllight::mk9_time_offset(channel = channel,
                        survey = survey,
                        cruise = cruise,
                        vessel = vessel)

4. Retrieve haul events and set up cast times

trawllight::mk9_cast_times(channel = channel,
                       survey = survey,
                       cruise = cruise,
                       vessel = vessel)

5. Align data and write output to CSV

trawllight::mk9_extinction(channel = channel,
                       survey = survey,
                       cruise = cruise,
                       vessel = vessel)

6. Calculate surface offset

trawllight::mk9_find_surface_offset(channel = channel, 
                                    survey = survey,
                                    cruise = cruise,
                                    vessel = vessel)

7. Move to storage

Move the processed files to the storage directory.



sean-rohan/trawllight documentation built on Jan. 13, 2023, 10:43 p.m.