forked from euroargodev/seaice_profile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function with switch for the two sea ice time series
- Loading branch information
Showing
5 changed files
with
604 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
% In the excel file Romain send me, I created another sheet for extracting | ||
% the date in the format I needed it. I saved it as Text separated by Tabs. | ||
% then I had to replace commas by dots using a text editor. | ||
% Finally, I imported the data using the matlab import wizard (saved script | ||
% as ImportExcelData) | ||
clear variables; | ||
load listromain2 | ||
datev=[YEAR MONTH DAY]; | ||
lon=LONGITUDE; | ||
lat=LATITUDE; | ||
sat_dir='\\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\ICE\ice_im\'; | ||
|
||
warning('off','MATLAB:structOnObject') | ||
f=find(abs(lat)>60); | ||
for i=1:numel(f) | ||
disp([num2str(i) '/' num2str(numel(f))]) | ||
%[pix_ice(f(i)),dist_ice(f(i)),sat_ice(f(i))]=metaprof_satice(datev(f(i),:),lon(f(i)),lat(f(i)),sat_dir); | ||
[pix_ice(f(i)),dist_ice(f(i)),sat_ice(f(i))]=metaprof_satice_src(datev(f(i),:),lon(f(i)),lat(f(i)),sat_dir,'RT'); | ||
end | ||
save extr_romain3.mat | ||
|
||
%% | ||
|
||
for i=1:numel(sat_ice) | ||
if isempty(getfield(pix_ice,{i},'sic'))==0 | ||
sic(i)=getfield(pix_ice,{i},'sic'); | ||
else | ||
sic(i)=NaN; | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
%% Import data from text file | ||
% Script for importing data from the following text file: | ||
% | ||
% filename: \\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\ICE\202105_Romain\CompleteExport_GPS_fix0_20210416.txt | ||
% | ||
% Auto-generated by MATLAB on 05-May-2021 07:03:18 | ||
|
||
%% Setup the Import Options and import the data | ||
opts = delimitedTextImportOptions("NumVariables", 14); | ||
|
||
% Specify range and delimiter | ||
opts.DataLines = [2, Inf]; | ||
opts.Delimiter = "\t"; | ||
|
||
% Specify column names and types | ||
opts.VariableNames = ["PLATFORM_CODE", "CV_NUMBER", "LONGITUDE", "LATITUDE", "STATION_DATE", "PLATFORM_TYPE", "DAC", "FIRMWARE_VERSION", "TECH_FLAG_ICEDETECTION_NUMBER", "ICEALGORITHMACTIVATED_LOGICAL", "TRANSMISSIONDELAYED_NUMBER", "YEAR", "MONTH", "DAY"]; | ||
opts.VariableTypes = ["double", "double", "double", "double", "datetime", "categorical", "categorical", "categorical", "string", "string", "string", "double", "double", "double"]; | ||
|
||
% Specify file level properties | ||
opts.ExtraColumnsRule = "ignore"; | ||
opts.EmptyLineRule = "read"; | ||
|
||
% Specify variable properties | ||
opts = setvaropts(opts, ["TECH_FLAG_ICEDETECTION_NUMBER", "ICEALGORITHMACTIVATED_LOGICAL", "TRANSMISSIONDELAYED_NUMBER"], "WhitespaceRule", "preserve"); | ||
opts = setvaropts(opts, ["PLATFORM_TYPE", "DAC", "FIRMWARE_VERSION", "TECH_FLAG_ICEDETECTION_NUMBER", "ICEALGORITHMACTIVATED_LOGICAL", "TRANSMISSIONDELAYED_NUMBER"], "EmptyFieldRule", "auto"); | ||
opts = setvaropts(opts, "STATION_DATE", "InputFormat", ""); | ||
|
||
% Import the data | ||
tbl = readtable("\\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\ICE\202105_Romain\CompleteExport_GPS_fix0_20210416.txt", opts); | ||
|
||
%% Convert to output type | ||
PLATFORM_CODE = tbl.PLATFORM_CODE; | ||
CV_NUMBER = tbl.CV_NUMBER; | ||
LONGITUDE = tbl.LONGITUDE; | ||
LATITUDE = tbl.LATITUDE; | ||
STATION_DATE = tbl.STATION_DATE; | ||
PLATFORM_TYPE = tbl.PLATFORM_TYPE; | ||
DAC = tbl.DAC; | ||
FIRMWARE_VERSION = tbl.FIRMWARE_VERSION; | ||
TECH_FLAG_ICEDETECTION_NUMBER = tbl.TECH_FLAG_ICEDETECTION_NUMBER; | ||
ICEALGORITHMACTIVATED_LOGICAL = tbl.ICEALGORITHMACTIVATED_LOGICAL; | ||
TRANSMISSIONDELAYED_NUMBER = tbl.TRANSMISSIONDELAYED_NUMBER; | ||
YEAR = tbl.YEAR; | ||
MONTH = tbl.MONTH; | ||
DAY = tbl.DAY; | ||
|
||
%% Clear temporary variables | ||
clear opts tbl |
Oops, something went wrong.