function [ RelevantData,Xstep,Ystep ] = Osc2Ang_TSL6( OscFile )
% [RelevantData,Xstep,Ystep] = Osc2Ang_TSL6( OscFile )
% This function is used to decode the .osc format 
% 
% Input: 'OscFile' is a string containing the path and directory of the osc file to decode (from version 6) 
% Outputs:
%          RelevantData is a [N x 10] array containing the information in a standard .ANG file
%          Xstep and Ystep are the step sizes, in microns, in each direction
% 
% Function coded by Adam Shiveley, USAF AFRL/RXCM
% 
            
            fid = fopen(OscFile,'rb');
            data = transpose( fread( fid, '*bit8' ) );
            start_euler_indices = strfind(data,[-71 11 -17 -1 2]);
            end_euler_indices = strfind(data, [-71 11 -17 -1]);
            end_euler = end_euler_indices(find(end_euler_indices == start_euler_indices)+1);
            euler_angles_ascii = data(start_euler_indices:end_euler-1);

            final_euler_angles = reshape(euler_angles_ascii,[4,length(euler_angles_ascii)/4]);
            RelevantData = typecast(final_euler_angles(:), 'single');

            Xstep = RelevantData(4);
            Ystep = RelevantData(5);

            RelevantData(1:5) = [];

            RelevantData = reshape(RelevantData, [10,length(RelevantData)/10])';
            
            fclose(fid);

end