This plugin reads the meteorological forecast data downscaled for each of the Swiss meteorological networks IMIS/ANETZ stations as preprocessed by the Operational Snow-Hydrological Service of the WSL. The data is written as Matlab binary files (.mat), one per meteorological parameter and per timestep, available on an access-controlled server after each new COSMO run. It therefore requires a third party library to read this file format: the Open Source MatIO library. This can be installed directly from the default repositories under Linux or installed by downloading the proper package for Windows or OsX.
- Note
- If non-ascii characters have been used and the file has been created under Windows, some of the strings might end up using the UTF-16 encoding. This requires a recent version of libmatio (see this issue). Another option would be to add at the begining of the Matlab routine a call to feature('DefaultCharacterSet', 'UTF8') in order to switch from the current default (which can be read by the same call, ommitting the 'UTF8' option) to the (partial) UTF-8 encoding of Matlab.
Data structure
The files are named with the following schema: {parameter}_{timestep}_{cosmo model version}_F_{run time}.mat with the following possible values:
- parameter is one of idif, idir, albd, ilwr, pair, prec, rhum, tcor, wcor, wdir;
- timestep is written as purely numeric ISO with minute resolution;
- cosmo model version could be any of cosmo7, cosmo2, cosmo1, cosmoE;
- run time is the purely numeric ISO date and time of when COSMO produced the dataset.
The files have the following internal data structure (represented as "name {data type}"):
stat {1x1 struct}
├── time {1x1 array of doubles}
├── data {1x623 array of doubles}
├── acro {1x623 array of arrays of char}
├── dunit {array of char}
├── type {array of char}
└── name {array of char}
The stations' acronyms follow a fixed order but their coordinates must be provided in a separate file, given as METAFILE key (see below). This file must have the following structure (the x and y coordinates being the CH1903 easting and northing, respectively):
statlist {1x1 struct}
├── acro {1x623 array of arrays of char}
├── name {1x623 array of arrays of char}
├── x {1x623 array of doubles}
├── y {1x623 array of doubles}
└── z {1x623 array of doubles}
Keywords
This plugin uses the following keywords:
- COORDSYS: coordinate system (see Coords); [Input] and [Output] section
- COORDPARAM: extra coordinates parameters (see Coords); [Input] and [Output] section
- METEOPATH: directory containing all the data files with the proper file naming schema; [Input] section
- METEOPATH_RECURSIVE: should meteopath be searched recursively for files? (default: no); [Input] section
- STATION#: input stations' IDs (in METEOPATH). As many meteofiles as needed may be specified
- METAFILE: file containing the stations' IDs, names and location; [Input] section (either within METEOPATH if not path is provided or within the provided path)
- OSHD_DEBUG: write out extra information to better show what is in the files
Example use
[Input]
METEO = OSHD
METEOPATH = /local/LATEST_03h_RUN
METEOPATH_RECURSIVE = true
METAFILE = STAT_LIST.mat ;another possibility could be /local/metadata/STAT_LIST.mat
STATION1 = ATT2
STATION2 = WFJ2