ITAS Automatic Weather Stations: Difference between revisions
From gfi
No edit summary |
No edit summary |
||
| Line 31: | Line 31: | ||
Routines are available at GFI to convert from the ASCII format files to netCDF files will full metadata information. | Routines are available at GFI to convert from the ASCII format files to netCDF files will full metadata information. | ||
'''Matlab routines''' | |||
<pre>% read_AWS.m | |||
%-------------------------------- | |||
% Description | |||
% read AWS data | |||
% station: Station serial number, e.g. 1432 | |||
% startdate: datenum of first day | |||
% enddate: optional: datenum of last day | |||
%-------------------------------- | |||
% HS, Thu Feb 28 16:30:27 CET 2019 | |||
%-------------------------------- | |||
function data=read_AWS(station,startdate,varargin) | |||
if nargin==2, | |||
enddate=startdate; | |||
elseif nargin==3, | |||
enddate=varargin{1}; | |||
else | |||
error('Wrong number of arguments in read_AWS.m'); | |||
end | |||
for dat=startdate:enddate, | |||
% open file and read variables | |||
fname=sprintf('AWS_%4d/CR1000_%4d_Minutt_%s.nc',station,station,datestr(dat,'yyyymmdd')); | |||
ncid=netcdf.open(fname,'NOWRITE'); | |||
% check that file exists | |||
if ncid<0, | |||
error('File %s not found.',fname); | |||
end | |||
% get all variable IDs | |||
varids=netcdf.inqVarIDs(ncid); | |||
% loop through all variables | |||
for i=varids, | |||
[varname,xtype,dimids,natts] = netcdf.inqVar(ncid,i); | |||
if dat==startdate, | |||
data.(varname)=netcdf.getVar(ncid,i,'double'); | |||
else | |||
data.(varname)=[data.(varname); netcdf.getVar(ncid,i,'double')]; | |||
end | |||
end | |||
netcdf.close(ncid); | |||
end | |||
% set missing data if T<-98 | |||
midx=find(data.T<-98); | |||
fnames=fields(data); | |||
for f=1:length(fnames), | |||
data.(fnames{f})(midx)=NaN; | |||
end | |||
end | |||
% fin | |||
</pre> | |||
Revision as of 10:21, 13 January 2020
GFI has a set of 6 automatic weather stations composed of robust standard instrumentation. Measured parameters include pressure, air temperature, relative humidity, wind speed and direction, precipitation and global radiation.
In detail, the AWS includes the following instruments:
| Instrument name | Function |
|---|---|
| Campbell Scientific | CR1000 datalogger |
| RM Young 61302V | trykksensor |
| S+S Regeltechnik HTF 100 Pt100 | temperatursensor |
| Vaisala HMP155 | temperatur- og fuktighetssensor |
| RM Young 5106-45 Alpine | vindhastighets- og vindretningssensor |
| Pessl IM523 | nedbørssensor |
| Apogee SP110 | strålingssensor |
The weather station configuration is fully documented in the attached manual:
File:ITAS_GFI_Manual_20160518.pdf (in Norwegian)
The weather stations are configured to acquire 10 min measurements, and transfer the logger files to GFI via mobile network once per day at 11:00 UTC.
Routines are available at GFI to convert from the ASCII format files to netCDF files will full metadata information.
Matlab routines
% read_AWS.m
%--------------------------------
% Description
% read AWS data
% station: Station serial number, e.g. 1432
% startdate: datenum of first day
% enddate: optional: datenum of last day
%--------------------------------
% HS, Thu Feb 28 16:30:27 CET 2019
%--------------------------------
function data=read_AWS(station,startdate,varargin)
if nargin==2,
enddate=startdate;
elseif nargin==3,
enddate=varargin{1};
else
error('Wrong number of arguments in read_AWS.m');
end
for dat=startdate:enddate,
% open file and read variables
fname=sprintf('AWS_%4d/CR1000_%4d_Minutt_%s.nc',station,station,datestr(dat,'yyyymmdd'));
ncid=netcdf.open(fname,'NOWRITE');
% check that file exists
if ncid<0,
error('File %s not found.',fname);
end
% get all variable IDs
varids=netcdf.inqVarIDs(ncid);
% loop through all variables
for i=varids,
[varname,xtype,dimids,natts] = netcdf.inqVar(ncid,i);
if dat==startdate,
data.(varname)=netcdf.getVar(ncid,i,'double');
else
data.(varname)=[data.(varname); netcdf.getVar(ncid,i,'double')];
end
end
netcdf.close(ncid);
end
% set missing data if T<-98
midx=find(data.T<-98);
fnames=fields(data);
for f=1:length(fnames),
data.(fnames{f})(midx)=NaN;
end
end
% fin
