Skip to content

The bathy structure

Eric Swanson edited this page Apr 6, 2023 · 17 revisions

The bathy variable that is returned by the cBathy algorithms is a compact structure that contains all of the relevant analysis results in one place. The overall structure contains six initial fields that document the analysis details, followed by three sub-structures, one for each phase in the analysis. An example of the format of the bathy structure is shown below for a specific size of analysis array, xm-ym:

bathy = 
epoch: '1285174800'
sName: [1x64 char]
params: [1x1 struct]
ver: [1x1 double]
matVer: [string]
tide: [1x1 struct]
xm: [1x43 double]
ym: [1x41 double]
timex: [41x43 double]
bright: [41x43 double]
dark: [41x43 double]
fDependent: [1x1 struct]
fCombined: [1x1 struct]
runningAverage: [1x1 struct]
cpuTime: [1x1 double]

epoch

Epoch is simply the start time of the data run in standard Unix epoch time (seconds since midnight, January 1, 1970) but could be any time stamp you wish to use.

sName

sName is simply the name of the stack file that was analyzed. In the Argus case, we list the filename of the first camera encountered (usually stack data are collected across multiple cameras).

params

params is a sub-structure that contains all the input settings from the Settings file. This is stored both as a record of the parameters used and as a method to pass input variables into the analysis routines within analyzeBathyCollect.

ver and matVer

ver is the chosen version of cBathy while matVer is the chosen version of Matlab that was used.

tide

Tide is a small structure that contains the tide level estimate used to correct the local cBathy depth estimates (measured relative to the sea surface) to a local vertical reference frame, for example NGVD88 or AHD. If bathy.tide.zt == nan, its default value, then no tide level correction has been made, so this field is important for documenting whether this correction has or has not been made (similarly, a change of tidal reference level requires adding the old, documented level, subtracting the new level and updating the bathy.tide fields to reflect the new level).

xm and ym

xm and ym are the vectors of analysis points for which bathy is estimated and are determined by the settings file, discussed in the Settings file.

timex, bright, and dark

Timex, bright and dark are coarse time-exposure, brightest and darkest images that have been calculated directly from the stack data (i.e. at all xm, ym locations). These can be used to, for example, determine where wave breaking was occurring.

fDependent

The fDependent sub-structure contains output from cBathy phase 1 in which all results are expressed still as a function of frequency. It is discussed in detail here.

fCombined

The fCombined sub-structure contains the phase 2 results from the cBathy algorithm. It is discussed in detail here.

runningAverage

The runningAverage sub-­structure contains results from the Kalman filter stage, phase 3 of the cBathy algorithm. It is discussed in detail here.

cpuTime

`cpuTime documents the computation time taken, to aid in understanding code efficiency.