%
% DESCRIPTION: Program to create the Water height GDF file in the Matlab format.
% 
% [TimeZone] and [Description] have text format so the values give in ''


clear;clc;
[FormatName] = 'GDF';
[FormatVersion] = 2.1;
[CRS] = 'n/a'%['EPSG:' num2str(input('[CRS] EPSG code (just number) = '))];
[TimeZone] = 'UTC' %input('TimeZone (char) = ');
[Description] = 'Description of the dataset' %input('Description of data (char) = ');
         
[FieldDescription] = {
    'Date','Date of water height measure'
    'Water_height_min','Yearly minimum water height'
    'Water_height_max','Yearly maximum water height'
    'Water_height_mean','Yearly mean water height'
    };
[FieldType] = {
    'Date',5
    'Water_height_min',23
    'Water_height_max',23
    'Water_height_mean',23
    };
[FieldUnit] = {
    'Date','datenum'
    'Water_height_min','m'
    'Water_height_max','m'
    'Water_height_mean','m'
    };
[d] = struct();

d.Date = [datenum({
'1965-01-01'
'1970-01-01'
'1975-01-01'
'1980-01-01'
'1985-01-01'},'yyyy-mm-dd')];



d.Water_height_min = [];

d.Water_height_max = [];

d.Water_height_mean = [];

save('GDF_EpisodeName_Water_Height_example.mat')