function [gwindm,gdirm,gtempm,ghumm,gpressm]=airmar()

fid=fopen(char(uipickfiles),'r')
C=fread(fid,'*char');
fclose(fid)
C=C';
A=C(1:2:length(C));
clear C
indstar=findstr(A,'*');
indwimda=findstr(A,'$WIMDA');
indwimv=findstr(A,'$WIMVA');
start=1;
for j=1:length(indstar)
    finish=indstar(j);
    size(A)
    B(j,start:finish)=A(1,start:finish);
    start=finish+1;
end
i=1;
k=1;
for j=1:length(indstar)
    C=B(j,:);
    if findstr(C,'$WIMDA')>0
        ind=findstr(C,',');
        pressure(i)=str2num(C(ind(1)+1:ind(2)-1));
        gtemp(i)=str2num(C(ind(5)+1:ind(6)-1));
        ghum(i)=str2num(C(ind(9)+1:ind(10)-1));
        clear ind
        i=i+1;
    elseif findstr(C,'$WIMWV')>0
        ind=findstr(C,',');
        gwind(k)=str2num(C(ind(3)+1:ind(4)-1));
        gdir(k)=str2num(C(ind(1)+1:ind(2)-1));
        clear ind
        k=k+1;
    else
%        timestamp_air=datenum(C,'yyyymmdd_HHMMSS');
    end
end
gwindm=mean(gwind);
gdirm=mean(gdir);
gtempm=mean(gtemp);
ghumm=mean(ghum);
gpressm=mean(pressure);
%C = textscan(fid, '%s %n %s %n ','delimeter',',')
return