%==========================================================================
% Get scan data and write it to a mat file, so the load/time can be moved
% around and processed without the full scan files
% This is operates independently from the rest of the data collection
% routines, and requires padWithZeros, month2number, and getScanHDFdata
%
% -------------------------------------------------------------------------
% History - Orion L. Kafka
% 12-13-2017 - written
%
%==========================================================================

for ii = 148:153

    if ii <= 110
        scanFileTLD = '/media/APS4/APS_2BM_2017_11';
    else
        scanFileTLD = '/media/APS3/APS_2BM_2017_11';
    end
    scanFileTLD = 'D:\APS_2BM_2017_11';
    
    fileName = dir(fullfile(scanFileTLD,['Exp',padWithZeros(3,ii),'*']));
    scanFile = fullfile(scanFileTLD,fileName.name,['proj_',padWithZeros(4,ii),'.hdf']);
    
    if exist(scanFile,'file') == 2
        [loadDuringScan,startTime,timeDuringScan] =...
            getScanHDFdata(scanFile);
        
        saveLoc = fullfile('/home/olk335/Desktop/Research/APS/loadDataProcessing/data/2017_11/scanFileData',...
            ['Exp',padWithZeros(3,ii)]);
        saveLoc = fullfile('C:\Users\ender\Desktop\Northwestern\Research\APS\loadDataProcessing\data\2017_11\scanFileData',['Exp',padWithZeros(3,ii)]);
        save(saveLoc, 'loadDuringScan','startTime','timeDuringScan');
    end
end