Commit 5a9e7ed5 authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

Interpolate function included for F

parent 59b948a0
function idata=interpolate_F(time,data)
% Check if subsequent values are the same
p=find(data.Fsc~=data.Fsc(1),1,'first')-1;
for i=2:p
if any(data.Fsc(1:p:end)~=data.Fsc(i:p:end))
p=0; break;
end
end
% Interpolate if subsequent values are the same
end
function idata=interpolate_F(time,data)
% Check if subsequent values are the same
p=find(data~=data(1),1,'first')-1;
for i=2:p
if any(data(1:p:end)~=data(i:p:end))
p=0; break;
end
end
% Interpolate
idata=interp1(time(1:p:end),data(1:p:end),time,'linear');
end
......@@ -2,9 +2,9 @@
# Shared
###########################################################################
PATH=O:\jmat\ # PATH TO FILES
#PATH=H:\WORK\SSH_MNT\ # PATH TO FILES
STATION=BFO1;NGK0; # Station name
DATE=2018-03-02 # Starting date of observations (YYYY-MM-DD)
PATH=C:\Users\mors\Documents\Matlab # PATH TO FILES
STATION=TTB0;NGK0; # Station name
###########################################################################
# Used by varlab01
......
......@@ -24,6 +24,9 @@ elseif strcmp(opsys(1:2), 'PC') == 1
if strcmp(pwd, 'O:\jmat\0programme_win') % ERKENNT KATRINS RECHNER
path1 = 'O:\jmat';
end
if strcmp(pwd, 'C:\Users\mors\Documents\Matlab\0programme_win') % ERKENNT KATRINS RECHNER
path1 = 'C:\Users\mors\Documents\Matlab';
end
bs = '\'; % backslash
else
diplay('operating system not recognised');
......@@ -37,7 +40,7 @@ for idate = startdate:enddate
[year, month, day, hhhour] = jd2date(idate)
cdf_file = [path_cdf bs station(1:4) bs 'cdf' bs station(1:4) '_' num2str(year, '%4.4d')...
num2str(month, '%2.2d') num2str(day, '%2.2d') '.cdf'];
cdf_file
if exist(cdf_file, 'file') == 2;
disp('Found cdf-data-file')
......
This diff is collapsed.
......@@ -738,6 +738,10 @@ function [PLOT,EDI,DAYSR]=read_data(STATION,DAYS)
% Close file
cdflib.close(cdfID);
% Interpolate F-values
%
data.Fsc=interpolate_F(data.time,data.Fsc);
% Store data to stack (TODO: Better store PLOT variable)
% Add filename to stack
if (STACK.SIZE<STACK.MAX_SIZE)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment