function LTMon_data(fflfile, outfile, startday, endday) %LTMon_data Creates TimeMon data file for LLO S5 run. % % LTMon_data(fflfile, outfile, startday, endday) reads frame list from % fflfile for data from startday to endday (time unit: time passed in % days since the beginning of S5), and creates a data file for % S5 LLO data for the time channels. % % The output file has following vectors holding time-data: % 'L1PM_mean', 'L1PM_max', 'L1PM_min', 'L1PM_n', 'L1PM_rms','L0EX_mean', % 'L0EX_max', 'L0EX_min', 'L0EX_n', 'L0EX_rms', 'L1EY_mean','L1EY_max', % 'L1EY_min', 'L1EY_n', 'L1EY_rms'. % % Also, a time channel created by this script is saved as vector 'H_time', % while the GPS start and end time are save as variables tHStart and % tHLength. % % To create ffl: ls /archive/S5/TimeMon/LLO/L-M-816/*.gwf > temp.ffl % ls /archive/S5/TimeMon/LLO/L-M-817/*.gwf > temp.ffl % ... % /bin/FrDump -d 0 -i temp.ffl > HTimeMon.ffl % % Example: LTMon_data('LTimeMon.ffl', 'LTimeMon_all.mat', 1, 143) % % See also: LTMon_plots, HTMon_data % % Rubab Khan, GECo, Columbia % https://geco.phys.columbia.edu/~rubab/ % March 28, 2006. warning off all; if startday > 1000 startday = (startday - 816026400)/(60*60*24); end if endday > 1000 endday = (endday - 816026400)/(60*60*24); end stD = (startday - 1); enD = endday; %tA=816026413; % official S5 start at LLO tLStart = 816026400 + stD*24*60*60; % aligned with frames tLLength = (enD-stD)*24*60*60; % tLLength = 878644800 - tLStart; % To get all data available till end L_time = (tLStart:60:(tLStart+tLLength)-1)'; % Create time channel. % Original channel names ChanData=[ 'L1:DMT-TIME_PEM.'; 'L0:DMT-TIME_EX. '; 'L1:DMT-TIME_EY. ']; % Channelname variations DataType=[ 'mean '; 'max '; 'min '; 'n '; 'rms ']; CD = cellstr(ChanData); DT = cellstr(DataType); % Initiate the vectors to be used inside for loops L1PM_mean = []; L1PM_max = []; L1PM_min = []; L1PM_n = []; L1PM_rms = []; L0EX_mean = []; L0EX_max = []; L0EX_min = []; L0EX_n = []; L0EX_rms = []; L1EY_mean = []; L1EY_max = []; L1EY_min = []; L1EY_n = []; L1EY_rms = []; for i = 1:3 % For three channels for j = 1:5 % For five variations Chn = sprintf('%s', char(CD(i)), char(DT(j))); % Specific channnel name t = frgetvect(fflfile, Chn, tLStart, tLLength); % Read frame if i == 1 if j == 1 L1PM_mean = t; elseif j == 2 L1PM_max = t; elseif j == 3 L1PM_min = t; elseif j == 4 L1PM_rms = t; elseif j == 5 L1PM_n = t; end elseif i ==2 if j == 1 L0EX_mean = t; elseif j == 2 L0EX_max = t; elseif j == 3 L0EX_min = t; elseif j == 4 L0EX_rms = t; elseif j == 5 L0EX_n = t; end elseif i ==3 if j == 1 L1EY_mean = t; elseif j == 2 L1EY_max = t; elseif j == 3 L1EY_min = t; elseif j == 4 L1EY_rms = t; elseif j == 5 L1EY_n = t; end end end end save(outfile, 'tLStart', 'tLLength', 'L_time', 'L1PM_mean', 'L1PM_max', 'L1PM_min', 'L1PM_n', 'L1PM_rms', 'L0EX_mean', 'L0EX_max', 'L0EX_min', 'L0EX_n', 'L0EX_rms', 'L1EY_mean', 'L1EY_max', 'L1EY_min', 'L1EY_n', 'L1EY_rms', '-MAT'); return;