DyNET - Ajax select page

This page allows you to get data from the DyNET database in CSV format.

Usage

Make an http request to this URL, specifying the following GET parameters:

Example: http://duri.tk/DyNET/ajax/select.php?table=meteomonte&vars=date,T&start=2018-12-01 00:00:00&stop=2018-12-01 01:00:00

Available tables and vars

TableVarsUnitDescription
arpafalcade date-Date
prcpmmDaily precipitation depth at the Falcade Arpav station
radsolMJ/m2Daily global solar radiation at the Falcade Arpav station
nevecmHeight of snow on ground at the Cima Pradazzo arpav station
Tmin°CMinimum daily temperature at the Falcade Arpav station
Tmean°CDaily mean temperature at the Falcade Arpav station
Tmax°CMaximum daily temperature at the Falcade Arpav station
RHminmmMinimum daily relative humidity at the Falcade Arpav station
RHmaxmmMaximum daily relative humidity at the Falcade Arpav station
windspeedm/sMean daily wind speed (aritmetic mean) at the Falcade Arpav station
TableVarsUnitDescription
meteomonte, meteovalle date-Date and time
T, Tavg, Tmin, Tmax°CTemperature
RH, RHavg, RHmin, RHmax%Relative humidity
RAD, RADavg, RADmin, RADmaxW/m2Net solar radiation
WS, WSavg, WSmin, WSmaxm/sWind speed
PRCPmmInstantaneous precipitaion
PRCPdaymmCumulated precipitaion, resets every midnight
BPimbarBarometric pressure
BATVBattery voltage
TableVarsUnitDescription
trasdenel,
trasdenelbis,
trasdeneltris,
trasdenelquater,
trasdenelquint,
trasdmonte,
trasdmontebis,
trasdmontetris
date-Date and time
P1, P2mbarAthmospheric and water pressure
deltaPmbarPressure difference, i.e. water level in cm
TOB1, TOB2°CAtmospheric and water temperature
validated-True if data has been manually validated, false if manually rejected, NULL otherwise
TableVarsUnitDescription
ultrasuoni date-Date and time
stagemDistance between sensor and water surface
BATVBattery voltage
SOLVSolar panel voltage (to be checked)
validated-True if data has been manually validated, false if manually rejected, NULL otherwise
TableVarsUnitDescription
piezodownstream,
piezodxdown,
piexodxup,
piezosxdown,
piezosxup,
piezoupstream
date-Date and time
P1mbarCompensated water pressure
TOB1°CWater temperature
TableVarsUnitDescription
moistcenter,
moistdownstream,
moistdx,
moistsx,
moistupstream
date-Date and time
T1, T2, T3, T4, T5, T6°CTemperature
A1, A2, A3, A4, A5, A6mmSoil water content
TableVarsUnitDescription
ysimonte,
ysienel
date-Date and time
NH3mg/lConcentration of ammonia
CondµS/cmElectrical conductivity
fDOM_QSUQSUFluorescent organic matter
NH4_mVmVRaw ammonia concentration
fDOM_RFURFUFluorescent organic matter
NO3_mVmVRaw nitrate concentration
NO3mg/lNitrate concentration
nLF_CondµS/cmConductivity
ODO_sat%Dissolved oxigen, percentage on saturation
ODO_local%Dissolved oxigen, percentage on local conditions
ODOmg/lDissolved oxigen
NH4mg/lAmmonia concentration
ORPmVRed-ox potential
SalPSUSalinity?
SpCondµS/cm???
TDSmg/lTotal dissolved solids
TSSmg/lTotal suspended solids
pH-pH
pH_mVmVRaw pH value
T°CTemperature
BATVBattery voltage
CBLVCable voltage
WiperVWiper posistion
TableVarsUnitDescription
hikes date-Date
description-Description of the hike
TableVarsUnitDescription
notes start-Starting datetime of validity of the note
stop-Ending datetime of validity of the note. Can be null "0000-00-00 00:00:00".
tablename-Table of reference of the note. Can be one of the tables in this list, or null.
note-The note regarding data in the specified table and time interval.

Matlab

tbl = 'meteomonte';
vars = {'date', 'T'}; % or [] for all variables
start = datetime(2019, 01, 01); % from this midnight, or [] for no start limit
stop = datetime(2019, 01, 02); % to this midnight, so only 24h, or [] for no stop limit

data = select(tbl, vars, start, stop);

function data = select(tbl, vars, start, stop)

% tbl: the table
% vars: list of variables like {'var1', 'var2'}, or nothing ~ or empty {} to select all variables
% start: staring datetime, or nothing ~ or []
% stop: stop datetime, or nothing ~ or []
% note: there is no check for errors

datefmt = 'yyyy-mm-dd HH:MM:SS';

url = 'http://duri.tk/DyNET/ajax/selectCSV.php';
url = [url '?table=' tbl];

if exist('vars', 'var') && ~isempty(vars)
url = [url '&vars=' strjoin(vars, ',')];
end
if exist('start', 'var') && ~isempty(start)
url = [url '&start=' datestr(start, datefmt)];
end
if exist('stop', 'var') && ~isempty(stop)
url = [url '&stop=' datestr(stop, datefmt)];
end

data = webread(url, weboptions('Timeout', 30));

nl = strfind(data,newline);
nl = nl(1) - 1;
fields = string(strsplit(data(1:nl), ';'));
fields = fields(1:end-1);

dataFormat = repmat("%f", 1, numel(fields));
for f = 1:numel(dataFormat)
switch fields{f}
case 'date'
dataFormat(f) = "%{yyyy-MM-dd HH:mm:ss}D";
end
end

dataFormat = strjoin([dataFormat "%s"], '');

data = textscan(data, dataFormat, 'Headerlines', 1, 'EndOfLine', newline, 'Delimiter', ';');
data = data(1:end-1);
data = table(data{:}, 'VariableNames', fields);

end