Commit efa4313b authored by dumoda01's avatar dumoda01

Ajout du script icec2gotm.m

parent f6be7fd1
function icec2gotm
% Load, interpolate in time and calculate extinction coefficient from
% ice concentration data of Amundsen Gulf for the year 2004.
% Dany DUMONT
% 01/08/2008: creation
% 01/10/2008: treatment of CIS weekly data for 2004-2008
% 01/03/2011: minor changes
% ______________________________________________________________________
% Format weekly ice concentration data from the Canadian Ice Service (CIS)
% 2004
init_date = datenum([2004 01 01 00 00 00]);
time = [init_date:1/24:init_date+366-1/24];
timevec = datevec(time);
load cis_icec_2004_weekly.txt
icec = cis_icec_2004_weekly(:,2);
% Interpolate weekly data to hourly frequency
icec = interp(icec,7);
icec(end+1) = icec(1);
icec(end+1) = icec(2); % leap year
icec = interp(icec,24);
fid = fopen('cis_icec_2004.dat', 'wt');
fprintf(fid, '%f\t%f\n', icec');
fclose(fid);
clear icec init_date time timevec
% 2005
init_date = datenum([2005 01 01 00 00 00]);
time = [init_date:1/24:init_date+365-1/24];
timevec = datevec(time);
load cis_icec_2005_weekly.txt
icec = cis_icec_2005_weekly(:,2);
% Interpolate weekly data to daily frequency
icec = interp(icec,7);
icec(end+1) = icec(1);
icec = interp(icec,24);
fid = fopen('cis_icec_2005.dat', 'wt');
fprintf(fid, '%f\n', icec');
fclose(fid);
clear icec init_date time timevec
% 2006
init_date = datenum([2006 01 01 00 00 00]);
time = [init_date:1/24:init_date+365-1/24];
timevec = datevec(time);
load cis_icec_2006_weekly.txt
icec = cis_icec_2006_weekly(:,2);
% Interpolate weekly data to daily frequency
icec = interp(icec,7);
icec(end+1) = icec(1);
icec = interp(icec,24);
fid = fopen('cis_icec_2006.dat', 'wt');
fprintf(fid, '%f\n', icec');
fclose(fid);
clear icec init_date time timevec
% 2007
init_date = datenum([2007 01 01 00 00 00]);
time = [init_date:1/24:init_date+365-1/24];
timevec = datevec(time);
load cis_icec_2007_weekly.txt
icec = cis_icec_2007_weekly(:,2);
% Interpolate weekly data to daily frequency
icec = interp(icec,7);
icec(end+1) = icec(1);
icec = interp(icec,24);
fid = fopen('cis_icec_2007.dat', 'wt');
fprintf(fid, '%f\n', icec');
fclose(fid);
clear icec init_date time timevec
% 2008
init_date = datenum([2008 01 01 00 00 00]);
time = [init_date:1/24:init_date+366-1/24];
timevec = datevec(time);
load cis_icec_2008_weekly.txt
icec = cis_icec_2008_weekly(:,2);
% Interpolate weekly data to daily frequency
icec = interp(icec,7);
icec(end+1) = icec(1);
icec(end+1) = icec(2); % leap year
icec = interp(icec,24);
fid = fopen('cis_icec_2008.dat', 'wt');
fprintf(fid, '%f\n', icec');
fclose(fid);
Markdown is supported
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