Commit 35275eb5 authored by Tobias Steinhoff's avatar Tobias Steinhoff

Update readme.md

parent a9c35f74
......@@ -68,6 +68,54 @@ dship. | course | deg | course over ground
| wind_dir_r | deg | wind direction, relative to the ship
| wind_speed_r | m/s | wind speed, relative to the ship
In order to convert the .mat file into .txt file I used teh following Matlab code:
´´´
% mat2text.m
% converts the .mat file with structures into text file
[file,path_in]=uigetfile(cd,'choose file ','*.mat');
cd(path_in)
load(file);
clear path_in file
txtdata=[datevec(mtime), lat,lon];
clear mtime lat lon
s1=' \t \t \t \t \t \t \t \t';
s2='Year\tMonth\tDay\tHour\tMinute\tSecond\tLatitude\tLongitude\t';
s3='%d\t %d\t %d\t %d\t %d\t %d\t %8.5f\t %8.5f\t';
w=whos;
names=char(w.name);
matches= strcmp({w.class}, 'struct');
for i=1:size(matches,2)
if matches(i)==1
st=names(i,:);
eval(['sa=table2array(struct2table(',st,'));'])
eval(['saf=fieldnames(',st,');'])
txtdata=[txtdata, sa];
saf=char(saf);
for j=1:size(saf,1)
s1=[s1,st,'\t'];
s2=[s2, saf(j,:),'\t'];
s3=[s3, ' %8.2f\t'];
end
end
end
s1(end)='n';
s2(end)='n';
s3(end)='n';
outname='uw_data_pos519.txt';
fid=fopen(outname,'wt');
fprintf(fid,s1);
fprintf(fid,s2);
fprintf(fid,s3,txtdata');
fclose(fid);
clear
´´´
### import dship data
Downloaded data from shipd DSHIP system in 30 s interval ([POS519_UW_dship.dat](https://git.geomar.de/tobias-steinhoff/Poseidon-POS519/blob/master/data%20processing/data/POS519_UW_dship.dat):
......
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