ncfile = 'F:\Sources\heijer\matlab\Reliability Methods\ActualSafety\run009\year_2008.nc';

x = nc_varget(ncfile, 'x');

id = nc_varget(ncfile, 'run_id');

D50 = x(:,:,2);
ws = getFallVelocity('D50', D50);
Hs = x(:,:,5);
Tp = x(:,:,6);

HpTw = Hs ./ Tp ./ ws;

%%
tr = jarkus_transects(...
    'year', 2010, 'output',...
    {'id' 'angle' 'areacode' 'x' 'y' 'cross_shore' 'altitude' 'time'});
[curvatures radii relativeAngle distances] = jarkus_curvature(tr);
radii(end+1) = radii(end);
radii(isinf(radii)|radii<0) = 2e4;
radii = round(radii);
netica_write_case_file('jarkus_curvature_ori2.cas',...
    'areacode', tr.areacode,...
    'radius', radii,...
    'wavedir', 270 + rand(size(radii))*50,...
    'theta', tr.angle);


%%
% create net
net = Net();
% create nodes
node1 = Node('node1', 0, net);
node1.setLevels(1:6)

node2 = Node('node2', 'true, false', net);
node1.addLink(node2)
% create streamer
stream = Streamer('test.dne');
% write net
net.write(stream);
% close net
net.finalize();