%
% DESCRIPTION: Program to create the Rock Temperature 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] = 'n/a' %input('TimeZone (char) = ');
[Description] = 'Description of the dataset' %input('Description of data (char) = ');
         
[FieldDescription] = {
    'Name','Code name of the well where the measurement took place'
    'Elevation','Elevation in metres above sea level of the rock temperature measurement'
    'Temperature','Rock temperature'
    };
[FieldType] = {
    'Name',3
    'Elevation',4
    'Temperature',22
    };
[FieldUnit] = {
    'Name','char'
    'Elevation','m'
    'Temperature','Celsius deg'
    };
[d] = struct();

k=1
d(k).Name = 'KhG-01';

d(k).Elevation = [274
264
254
244
234
224];

d(k).Temperature = [7.7000
8.8000
10.3000
12.1000
13.8000
15.6000];

k=2
d(k).Name = 'KgH-02';

d(k).Elevation = [214
204
194
184
174
164];

d(k).Temperature = [17.4000
19.2000
20.9000
22.7000
24.5000
26.2000];

k=3
d(k).Name = 'KgH-03';

d(k).Elevation = [144
134
124
114
104
94];

d(k).Temperature = [29.5000
31
32.5000
34
35.5000
37];


save('GDF_EpisodeName_Rock_Temperature_example.mat')