% url = 'http://opendap.deltares.nl/thredds/fileServer/opendap/rijkswaterstaat/waterbase/sea_surface_height/id1-HOEKVHLD.nc';
ncfile = 'id1-HOEKVHLD.nc';
% urlwrite(url,ncfile)

[D,M] = nc2struct(ncfile);

%% CET

hdr.loc             = D.platform_name;
hdr.lon             = D.lon;
hdr.lat             = D.lat;
hdr.datenumanalysis = datestr(now);
hdr.unit            = M.sea_surface_height.standard_name;
[~,tz]=udunits2datenum(M.time.units)
hdr.timezone        = tz;
hdr.source          = 'http://opendap.deltares.nl/thredds/fileServer/opendap/rijkswaterstaat/waterbase/sea_surface_height/id1-HOEKVHLD.nc';

%%

for myyear=[2007 2013]
    mask = year(D.datenum)==myyear;
    savestr(['measurements\HVH_noos_',num2str(myyear),'.txt'],...
            noos_write(D.datenum(mask), D.sea_surface_height(mask),...
            'headerlines',matroos_noos_header(hdr)))
end
