function out = ep_ordering(ep) % EP_ORDERING - get the data from EP_CMPL into the a matrix set up like % the specprr data file % Brian Schlining % 31 Aug 1999 ep_ini; if ep == 1 lon = ep1.east_longitude; else lon = ep2.east_longitude; end e = ep_cmpl; % This variable contains the columns present in the specprr file as of 31 Aug 1999 col = ep_specprr_ini; % ni = strmatch('Time',ColumnS); row = find(e(ep).dat(:,ni) == 1200); out = ones(length(row),length(col))*NaN; di = strmatch('Decimal_Year', ColumnS); d = dy2date(e(ep).dat(row,di)+1900); [Year Month Day] = datevec(d); out(:,1) = date2jul(d) + 0.5 - gmtoffset(lon); out(:,end) = Year; for i = 1:length(col) j = strmatch(col(i),ColumnS); if ~isempty(j) out(:,i) = e(ep).dat(row,j); end end