function [tp]=get_campbell_WxStat(fn)

fid=fopen(fn);
if (fid~=0)
    for n=1:4
        junk=fgetl(fid);
    end
    clear junk
    cc=0;
    while (~feof(fid))
        junk=fgetl(fid);
        ix=strfind(junk,'"');
        if ~isempty(ix)
            cc=cc+1;
            DT=junk(ix(1)+1:ix(2)-1);
            if ~isempty(DT)
                tp.PC_TIME(cc,1)=str2num(DT(1:4));  tp.PC_TIME(cc,2)=str2num(DT(6:7));  tp.PC_TIME(cc,3)=str2num(DT(9:10));
                tp.PC_TIME(cc,4)=str2num(DT(12:13));tp.PC_TIME(cc,5)=str2num(DT(15:16));tp.PC_TIME(cc,6)=str2num(DT(18:19));
            else
                tp.PC_TIME(cc,:)=ones(1,6).*NaN;
            end
            
            clear ix
            ix=strfind(junk,',');
            rec=junk(ix(1)+1:ix(2)-1);
            if ~isempty(rec)
                tp.record_number(cc)=str2num(rec);
            else
                tp.record_number(cc)=NaN;
            end 
           
            PSP2=junk(ix(2)+1:ix(3)-1);
            if ((~isempty(PSP2))&(strcmp('"NAN"',PSP2)~=1))
                tp.PSP2(cc)=str2num(PSP2);
            else
                tp.PSP2(cc)=NaN;
            end 
            
            PIR1NET=junk(ix(3)+1:ix(4)-1);
            if ((~isempty(PIR1NET))&(strcmp('"NAN"',PIR1NET)~=1))
                tp.PIR1NET(cc)=str2num(PIR1NET);
            else
                tp.PIR1NET(cc)=NaN;
            end
            
            PIR1=junk(ix(4)+1:ix(5)-1);
            if ((~isempty(PIR1))&(strcmp('"NAN"',PIR1)~=1))
                tp.PIR1(cc)=str2num(PIR1);
            else
                tp.PIR1(cc)=NaN;
            end
            
            PTU_T=junk(ix(5)+1:ix(6)-1);
            if ((~isempty(PTU_T))&(strcmp('"NAN"',PTU_T)~=1))
                tp.PTU_T(cc)=str2num(PTU_T);
            else
                tp.PTU_T(cc)=NaN;
            end
            
            PTU_RH=junk(ix(6)+1:ix(7)-1);
            if ((~isempty(PTU_RH))&(strcmp('"NAN"',PTU_RH)~=1))
                tp.PTU_RH(cc)=str2num(PTU_RH);
            else
                tp.PTU_RH(cc)=NaN;
            end
            
            PTU_P=junk(ix(7)+1:ix(8)-1);
            if ((~isempty(PTU_P))&(strcmp('"NAN"',PTU_P)~=1))
                tp.PTU_P(cc)=str2num(PTU_P);
            else
                tp.PTU_P(cc)=NaN;
            end
        
            WSPD=junk(ix(8)+1:ix(9)-1);
            if ((~isempty(WSPD))&(strcmp('"NAN"',WSPD)~=1))
                tp.WSPD(cc)=str2num(WSPD);
            else
                tp.WSPD(cc)=NaN;
            end
            
            WSDIR=junk(ix(9)+1:length(junk));
            if ((~isempty(WSDIR))&(strcmp('"NAN"',WSDIR)~=1))
                tp.WSDIR(cc)=str2num(WSDIR);
            else
                tp.WSDIR(cc)=NaN;
            end
            
            clear junk DT rec PSP2 PIR1NET PIR1 PTU_T PTU_RH PTU_P WSDIR WSPD
        end
    end
else
    tp=[];
end

 fclose('all');