function hr=get_argos_hr(file_loc,mlab)

file_name = fullfile(file_loc, char(mlab), 'hr3');
%file_name=sprintf('%s%s/hr3',file_loc,char(mlab));
%file_name=sprintf('%s%s/argos/hr3',file_loc,char(mlab));

fid=fopen(file_name);

% If we can't open the file then we'll exit
if fid == -1
    hr = [];
    fprintf(1, 'WARNING!! Unable to open %s\n', file_name);
    return
end

%get rid of the oasis header and start reading in
Dat_Loc = rm_oasis_header(fid);
fseek(fid, Dat_Loc, 'bof');

X=fscanf(fid,'%f %f %f %f');

Time=X(1:4:length(X));
Chan=X(2:4:length(X));
Wave=X(3:4:length(X));
RatePix=X(4:4:length(X));

lambda=[412 443 490 510 555];
timex=unique(Time);

for timer = 1:length(timex)
    time_ind=find(Time==timex(timer));
    
    
    for chan = 0:2
    channel_ind=find(Chan(time_ind) == chan);
    
        for wave = 1:length(lambda)
        wave_ind=find(Wave(time_ind(channel_ind))==lambda(wave));
        switch chan,
        case 0
            hr.Zero(wave,timer)=mean(RatePix(time_ind(channel_ind(wave_ind))));
        case 1
            hr.One(wave,timer)=mean(RatePix(time_ind(channel_ind(wave_ind))));
        case 2
            hr.Two(wave,timer)=mean(RatePix(time_ind(channel_ind(wave_ind))));
        end %switch chan
        end %for wave
    
    end; %for chan
end;

hr.time=dy2date(timex+1900)-gmtoffset(where(char(mlab)));
