Read data
See the JarKus tutorial on reading data for a detailed explanation of this
url = jarkus_url; id = nc_varget(url,'id'); transect_nr = find(id==6001200)-1; year = 1970 + floor(nc_varget(url,'time')/365); year_nr = find(year == 1969)-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_MKL (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
As we want to calculate the MKL position, we need information on the mean low water level. The upper boundary is the dune foot position defined as the 3m NAP line
MLW = nc_varget(url, 'mean_low_water',transect_nr,1)
Calculating the MKL
To find out what JarKus funtions are available, just enter 'jarkus' in the command prompt or text editor and press tab. Matlab gives suggestions to complete the line. To figure out how the funtion works use help.
help jarkus
jarkus_getMKL will do the job
UpperBoundary = 3;
LowerBoundary = MLW-(3-MLW);
xMKL = jarkus_getMKL(x,z,UpperBoundary,LowerBoundary,'plot')