JarKus volume calculations

This tutorial demonstrates how to calculate the volume of a certain JarKus profile.

Contents

Read some data

See the previous JarKus tutorial for a detailed explanation

url         = jarkus_url;
id          = nc_varget(url,'id');
transect_nr = find(id==8005700)-1;
year        = 1970 + floor(nc_varget(url,'time')/365);
year_nr     = find(year == 1979)-1;
xRSP        = nc_varget(url,'cross_shore');
z           = nc_varget(url,'altitude',[year_nr,transect_nr,0],[1,1,-1]);
x    = xRSP(~isnan(z));
z    =    z(~isnan(z));
Error using netcdflib
The NetCDF library encountered an error during execution of 'open' function - 'I/O failure (NC_EIO)'. If the data source was an  OPeNDAP URL, see the OPeNDAP Troubleshooting section in the Users Guide.

Error in netcdf.open (line 60)
        [varargout{:}] = netcdflib ( 'open', filename, varargin{1} );

Error in nc_varget_tmw>varget_nc (line 21)
ncid=netcdf.open(ncfile,'NOWRITE');

Error in nc_varget_tmw (line 5)
    [data,info] = varget_nc(ncfile,varname,varargin{:});

Error in nc_vargetr (line 38)
   		[data,info] = nc_varget_tmw(ncfile,varname,varargin{:});

Error in nc_varget (line 35)
[data,info] = nc_vargetr(ncfile,varname,varargin{:});

Error in jarkus_tutorial_calculate_volume (line 9)
id          = nc_varget(url,'id');

Error in evalinemptyworkspace>eval_fun (line 8)
eval(getappdata(0,'emptyworkspaceevaluation'));

Error in evalinemptyworkspace (line 3)
eval_fun();

Error in evalmxdom>instrumentAndRun (line 89)
text = evalc(evalstr);

Error in evalmxdom (line 20)
[data,text,laste] = instrumentAndRun(file,cellBoundaries,imageDir,imagePrefix,options);

Error in publish (line 164)
    dom = evalmxdom(file,dom,cellBoundaries,prefix,imageDir,outputDir,options);

Error in tutorials2html (line 234)
                htmlref{idr}{itutorials} = publish(tutorialname,publishopts);

Error in oetpublish (line 90)
    tutorials2html;

Error in tutorials_include_tutorial (line 26)
oetpublish all

Available options

First we want an overview of available jarkus functions

help jarkus

Apparently, there are two (competing) functions in the toolbox that can calculate volumes: jarkus_getVolume and jarkus_getVolumeFast to find out differences, click on the help links

jarkus_getVolumeFast

Firs an example using jarkus_getVolumeFast

We need to define a box within which the volume can be computed, as volume if not defined for a line.

UpperBoundary       =  1000;
LowerBoundary       =     3;
LandwardBoundary    =     0;
SeawardBoundary     = max(x);

and the we call the function. We use the additional 'plot' argument to get a plot of the result.

[Volume] = jarkus_getVolumeFast(x, z, UpperBoundary, LowerBoundary,...
    LandwardBoundary, SeawardBoundary,'plot')

jarkus_getVolume

to be added...

Volume difference between two transects

to be added...