OpenEarthTools has a matlab package for reading DONAR ascii dia files. Please join Openearth to be able to access the svn repository . With just 4 lines of Matlab code you can work with a virtual aggregate of many dia files:
Code Block |
---|
File = donar.open_file({'a1.dia','a2.dia',...,'a11.dia'})
donar.disp(File) % show contents of 1 or many files
-----+----+------+--------+--------+-----------------------------------------------------------------+...
File |WNS | # of | # of | DONAR| CF |
index|code|blocks| values| name| standard_name [UDunits] |
-----+----+------+--------+--------+-----------------------------------------------------------------+...
1|1926| 11| 46414| INSLG| downwelling_radiance_in_sea_water [microEinstein] |
2| 209| 11| 69671| %O2| fractional_saturation_of_oxygen_in_sea_water [0.01] |
3|2392| 11| 52981| GELDHD| sea_water_electrical_conductivity [mS/m] |
4| 360| 11| 167320| O2| mass_concentration_of_oxygen_in_sea_water [mg/l] |
5| 377| 11| 162096| pH| sea_water_ph_reported_on_total_scale [1] |
6| 44| 11| 81036| T| sea_water_temperature [degree_Celsius] |
7|5108| 11| 143827| TROEBHD| sea_water_turbidity [NTU] |
8| 555| 11| 166163|FLUORCTE| sea_water_fluorescence [1] |
9| 559| 11| 167318| SALNTT| sea_water_salinity [1] |
10|7647| 11| 2259| GELSHD| speed_of_sound_in_sea_water [m/s] |
11|7788| 11| 46392| INSLG| downwelling_longwave_radiance_in_air [microEinstein] |
-----+----+------+--------+--------+-----------------------------------------------------------------+...
[Data,...
Meta] = donar.read(File,1,6) % variable resides in 6th column
[CTD,...
CTDm] = donar.ctd_struct(Data,Meta)
|
Here we display the contents.m
, for the rest of the documentation refer to the Matlab documentation convention: help donar
and proceed with the clickable links.
Code Block |
---|
donar toolbox package - Matlab package to inquire and read donar dia ascii files
MAIN FUNCTIONS:
open_files - open and scan multiple donar files
open_file - scan internal blocks of 1 donar dia file + aggregate into variables
read - read one variable from donar dia file (aggregating blocks)
disp - displays overview of contents of donar (blocks + variables)
Post-read functions: interpret as CTD profile or FerryBox/ScanFish trajectory:
open_file_test - test donar.open_file, to test delivered dia batches
open_files_test - test donar.open_file, to test aggregated variables
trajectory_struct - convert matrix output from read to struct
trajectory2nc - write 2D FerryBox or 3D Meetvis trajectory to netCDF
trajectory_overview_plot - plot maps and timeseries of trajectory
ncwrite_trajectory - write trajectory to netCDF-CF file
ctd_struct - convert matrix output from read to struct
ctd_timeSeriesProfile - merge timeseries of profiles at 1 location
from random collection of profile/locations
ctd_timeSeriesProfile2nc - write timeSeriesProfile to netCDF
ctd_timeSeriesProfile_plot - plot timeseries of profiles at 1 location
ncwrite_profile - write trajectory to netCDF-CF file
Low-level functions (only for developers):
scan_block - fast scan donar dia data block without reading data
scan_file - scans an entire donar file: all blocks
read_header - reads donar header from file
merge_headers - compiles variable information from blocks
read_block - reads one block of donar data
squeeze_block - squeezes out data flagged as 999999999999
parse_coordinates - convert donar value to coordinate [degrees]
parse_time - parse time in block into decimal days since reference day
flag_block - flag donar values for unrealistic values
headercode2attribute - translate donar datamodel property to global netCDF attribute
resolve_clim - get clim for a WNS
resolve_ehd - convert donar units code to english long_name, CF UDUNITS units,...
resolve_wns - convert donar code to english long_name, CF standard name, ...
Example:
F = donar.open_file(diafile<s>)
donar.disp(File) % show contents of 1 or many files
[D,M] = donar.read(File,1,6) % variable resides in 6th column
See also: rws_waterbase_get_url
http://www.rws.nl/water/waterdata_waterberichtgeving/watergegevens/
http://www.helpdeskwater.nl/onderwerpen/kust-zee/scheepvaart/historische-gegevens/
https://data.overheid.nl/data/dataset/rws-donar-metis-service-rijkswaterstaat
|