SOGLOBEC Limeburner floats 2003 LMG-0302 dmo: Copley 20110418: downloaded and extracted .mat files for 4 floats deployed on cruise LMG0302. got one float data into jgofs format with excel but it was time consuming. 20110520: wrote an mfile to reformat the .mat files (below) then imported text files into excel, replaced NaN's with nd's. Concatenated them in TextPad, saved as "floats2003_ctd.dat. Having hard time getting ind file to run - timedateparams with julian date is issue. Need to conver julian date to human readable. 20110523: Sent email to Dick to learn of his convention for julian date base - what date and time ---> midnight. Used gregarian.m to get year, month, day, hours, minutes, seconds from the gdate. I copied the whole column of jdates from the excel file to the command window: jjj=[paste here]; ggg=gregorian_limeburner(jjj); save('floats2003_gregdate_all.dat','ggg','-ascii') - I used the version Dick sent in an email which was basically same as the gregorian.m I already had. - Remember to create path to the directory with the mfiles, plus subroutines, e.g., C:\matbak\plotmaps\atsee %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %float2003.m %reformat Limeburner float data from 2003, SOGLOBEC %manually load the .mat files into matlab one at a time. % fid=[7900026_prof.mat, 7900027_prof.mat, 7900028_prof.mat, 7900029_prof.mat] % 7900026_prof.mat = 54 depths x 28 days % 7900027_prof.mat = 56 depths x 136 days % 7900028_prof.mat = 54 depths x 24 days % 7900029_prof.mat = 0 x 0 %for n=1:4 % load fid(n) [deps,datesnum]=size(P) %deps=56; % edit this number %datesnum=136; % edit this number length=deps * datesnum s1=reshape(S,deps*datesnum,1); t1=reshape(T,deps*datesnum,1); p1=reshape(P,deps*datesnum,1); pts=[p1,t1,s1]; % end %format long; meta=[dates,lat,lon]; % ============== % Repeat the date for the each row of pts for one depth (#deps) % copy each date/lat/lon (56) times = #deps list=zeros(1,3); for x=1:datesnum %number of dates for z=1:deps %number of depths list=[list;meta(x,:)]; end end list=list(2:end,:); %================ % combine the date/lon/lon array with the depth/temp/sal array: alldatafile = [list,pts]; % save the file - ** rename manually this next line first: %save('7900028-reformated2.dat','alldatafile','-ascii', '-double','-tabs') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [gtime]=gregorian_limeburner(julian) %GREGORIAN Converts digital Julian days to Gregorian calendar dates. % Although formally, % Julian days start and end at noon, here Julian days % start and end at midnight for simplicity. % % In this convention, Julian day 2440000 begins at % 0000 hours, May 23, 1968. % % Usage: [gtime]=gregorian(julian) % % julian... input decimal Julian day number % % gtime is a six component Gregorian time vector % i.e. gtime=[yyyy mo da hr mi sec] % gtime=[1989 12 6 7 23 23.356] % yr........ year (e.g., 1979) % mo........ month (1-12) % d........ corresponding Gregorian day (1-31) % h........ decimal hours % % calls S2HMS julian=julian+5.e-9; % kludge to prevent roundoff error on seconds % if you want Julian Days to start at noon... % h=rem(julian,1)*24+12; % i=(h >= 24); % julian(i)=julian(i)+1; % h(i)=h(i)-24; secs=rem(julian,1)*24*3600; j = floor(julian) - 1721119; in = 4*j -1; y = floor(in/146097); j = in - 146097*y; in = floor(j/4); in = 4*in +3; j = floor(in/1461); d = floor(((in - 1461*j) +4)/4); in = 5*d -3; m = floor(in/153); d = floor(((in - 153*m) +5)/5); y = y*100 +j; mo=m-9; yr=y+1; i=(m<10); mo(i)=m(i)+3; yr(i)=y(i); [hour,min,sec]=s2hms(secs); gtime=[yr(:) mo(:) d(:) hour(:) min(:) sec(:)]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%