insertInst: Insert data from alternate instrument

View source: R/adcpToolbox.R

insertInstR Documentation

Insert data from alternate instrument

Description

*PRESSURE Use the measured pressure from an alternate instrument positioned on the same moooring as the ADCP This has benefits of a more accurate pressure reading which can be translated to depth Note: If the pressure sensor is below the ADCP the mooring separation distance (offset) should be negative.

Usage

insertInst(adp, var, file = adp[["alternate_pressure_file"]],
  offset = adp[["vertical_separation"]])

Arguments

adp

adp object into which to insert data

var

variable you wish to pull from other instrument

file

file where data from alternate instrument is stored

offset

the mooring separation between the instruments (in metres)

Details

Extreme caution should be used when applying this function to anything other than pressure as there may be significant differences in values despite only a few metres separation.

*COMPASS HEADING This function can be used to insert compass headings from an alternate source in extreme high latitude cases. Compass heading data with magnetic declination applied should be in .csv form. Use the argument var = 'heading'. Please double check data after using this function, best done by plotting UV scatter plots or progressive vector plots. Ensure that headings are correct and current directionality is logical. This function is designed to read a csv with columns ensemble number and heading. Please format csv in this way to avoid errors. Please see ADCP processing guide for instructions on how to calculate alternate headings.

*NOTE If attempting to use this function and the times of the instruments are at different sampling intervals, it may be necessary to manually insert the data using oceSetData. In this case the user can pull the data into the chosen oce object and edit it manually which may include removing data points or averaging data points to match the sampling interval of the ADCP. There may be other cases where a similar method is required, if there is a consistent specific case which requires an extra function please suggest to developers. More information can also be found in the Moored ADCP processing guide https://gccode.ssc-spc.gc.ca/dfo-mar-odis/MooredDataProcessing/Documentation

Value

adp object with data set completed from alternate sources

Examples


      #list odf files
odflist <- list.files(path = ".", pattern =  "MADCP*...*00.ODF")

      #read list of odf files into adp object
adp <- odf2adp(odflist)



      #add in raw and netCDF metadata and data to adp objecct
raw <- list.files(path = '.', pattern = "*.000")
nc <- list.files(path = '.', pattern = "*.nc")
adp <- adpCombine(adp, raw, nc)


       #insert microcat pressure data
file <- list.files(path = '.', pattern = "MCTD*...*.ODF")
adp <- insertInst(adp, var = 'pressure', file = file)



Echisholm21/mooredDataProcessing_adcp documentation built on March 29, 2022, 2:22 p.m.