%
% @file driv1.m
%
% @brief
%
% @copyright
% Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
% SPC (Swiss Plasma Center)
%
% SPClibs is free software: you can redistribute it and/or modify it under
% the terms of the GNU Lesser General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% SPClibs is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public License
% along with this program. If not, see .
%
% @author
% (in alphabetical order)
% @author Trach-Minh Tran
%
file='driv1.h5';
x = hdf5read(file, '/X');
knotsx = hdf5read(file, 'KNOTSX');
splinesx = hdf5read(file, '/splinesx','V71Dimensions', true);
y = hdf5read(file, '/Y');
knotsy = hdf5read(file, 'KNOTSY');
splinesy = hdf5read(file, '/splinesy','V71Dimensions', true);
c=['b','g','r','c','m','y','k'];
nc=size(c,2);
figure
%subplot(211)
hold on
ns = size(splinesx,1);
attr=hdf5read(file,'/splinesx/title'); title_ann=attr.Data;
for i = 1:ns
cc = mod(i-1,nc)+1;
plot(x,splinesx(i,:),c(cc))
end
yk=zeros(size(knotsx));
plot(knotsx,yk,'ro');
grid on
title(title_ann)
ylabel('Splines')
figure
%subplot(212)
hold on
ns = size(splinesy,1);
attr=hdf5read(file,'/splinesy/title'); title_ann=attr.Data;
for i = 1:ns
cc = mod(i-1,nc)+1;
plot(y,splinesy(i,:),c(cc))
end
yk=zeros(size(knotsy));
i1=find(knotsy==y(1));
i2=find(knotsy>=y(size(y,1)),1);
plot(knotsy(i1:i2),yk(i1:i2),'ro');
grid on
title(title_ann)
ylabel('Splines')