function [time,o3] = read_ozone(path,period)
%% Initialize variables.
filename = [path 'brw_2018_all_minute.dat'];
startRow = 14;

%% Format for each line of text:
%   column2: double (%f)
%	column3: double (%f)
%   column4: double (%f)
%	column5: double (%f)
%   column6: double (%f)
%	column7: double (%f)
% For more information, see the TEXTSCAN documentation.
formatSpec = '%*3s%5f%5f%4f%4f%6f%f%[^\n\r]';

%% Open the text file.
fileID = fopen(filename,'r');

%% Read columns of data according to the format.
% This call is based on the structure of the file used to generate this
% code. If an error occurs for a different file, try regenerating the code
% from the Import Tool.
textscan(fileID, '%[^\n\r]', startRow-1, 'WhiteSpace', '', 'ReturnOnError', false, 'EndOfLine', '\r\n');
dataArray = textscan(fileID, formatSpec, 'Delimiter', '', 'WhiteSpace', '', 'TextType', 'string', 'EmptyValue', NaN, 'ReturnOnError', false);

%% Close the text file.
fclose(fileID);

%% Post processing for unimportable data.
% No unimportable data rules were applied during the import, so no post
% processing code is included. To generate code which works for
% unimportable data, select unimportable cells in a file and regenerate the
% script.

%% Create output variable
dataArray = [dataArray{1:end-1}];
time = datenum([dataArray(:,1:5) zeros(size(dataArray,1),1)]);
o3 = dataArray(:,6);
o3(o3 == 9999.99) = NaN;

o3(time < datenum(period(1,:)) | time > datenum(period(2,:)) + 1 - 1/24/60,:) = [];
time(time < datenum(period(1,:)) | time > datenum(period(2,:)) + 1 - 1/24/60,:) = [];

%% qc
time(isnan(o3)) = [];
o3(isnan(o3)) = [];

[time,it] = unique(time);
o3 = o3(it);
