HOBO rain gauges

From gfi
Revision as of 12:28, 13 January 2020 by Hso039 (talk | contribs) (Created page with "The HOBO precipitation gauges work on the tipping bucket principle. GFI has 6-8 HOBO rain gauges available for fieldwork. The data files need to be converted to units of mm p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The HOBO precipitation gauges work on the tipping bucket principle. GFI has 6-8 HOBO rain gauges available for fieldwork.

The data files need to be converted to units of mm precipitation per time interval in a reading routine.

Matlab routines

read HOBO data

% read_hobo.m
%--------------------------------
% Description
% read a data file from the HOBO logger
% and convert to units of mm
%--------------------------------
% HS, Wed Mar 20 17:00:23 CET 2019 
%--------------------------------

% use function like this:
%fpath='/Data/gfi/scratch/metdata/HOBO/GEOF232_2019/';
%fname=[fpath,'HOBO Rain Gauge snr 20542.txt'];
%hobo=read_hobo(fname,fpath);

function hobo=read_hobo(fname,fpath);

  fid=fopen(fname,'r');
  data=textscan(fid,'%s%s%*d','Headerlines',3,'Delimiter',{' ','\t'});
  fclose(fid);

  hobo.tim=[];
  hobo.RR=[];
  hobo.RRSUM=[];

  for i=1:length(data{1}),
    dat=[data{1}{i},' ',data{2}{i}];
    strrep(dat,',','.');
    hobo.tim(i)=datenum(dat,'mm/dd/yy HH:MM:SS');
    hobo.RR(i)=0.2;
    if i==1,
      hobo.RRSUM(i)=RR(i);
    else
      hobo.RRSUM(i)=RRSUM(i-1)+RR(i);
    end
  end

end

% fin