meteoio merge requestshttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests2021-05-25T12:19:31Zhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/1Inlcuding curvature length scale in listonwind, and fixing the calculation of...2021-05-25T12:19:31ZNander WeverInlcuding curvature length scale in listonwind, and fixing the calculation of curvatureThis fixes the calculation of curvature by including the distance between points. It also implements the curvature length scale ETA in the ListonWind algorithm (see eta in Eq. 14 in [Liston et al., 2006](https://journals.ametsoc.org/view...This fixes the calculation of curvature by including the distance between points. It also implements the curvature length scale ETA in the ListonWind algorithm (see eta in Eq. 14 in [Liston et al., 2006](https://journals.ametsoc.org/view/journals/hydr/7/2/jhm486_1.xml?tab_body=fulltext-display)).
To be specified in the configuration via:
```
VW::algorithms = LISTON_WIND
VW::liston_wind::eta = 5000
```https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/2Fix for safeGet, where instead of nodata, it would return the boundary grid...2021-08-18T06:45:02ZNander WeverFix for safeGet, where instead of nodata, it would return the boundary grid...Fix for safeGet, where instead of nodata, it would return the boundary grid cell. Prevents unwanted discontinuities in calculations of curvature.
When using ListonWind, using a value of ETA that exceeds a few grid cells, noticeable disc...Fix for safeGet, where instead of nodata, it would return the boundary grid cell. Prevents unwanted discontinuities in calculations of curvature.
When using ListonWind, using a value of ETA that exceeds a few grid cells, noticeable discontinuities occur in wind speed. See the attached example for interpolated wind speed on a digital elevation model. X and Y units are hectometers. ETA was set to 5000m, so within 5km of the boundary (at X and Y=50), discontinuties occur (left figure). Right figure is after the proposed fix.
![bugfix_safeget](/uploads/5519a6aa3764e4c5df1ec11acf70375e/bugfix_safeget.png)https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/3Fixing the case where rounding errors make the isSameGeolocalization test...2021-08-23T07:10:36ZNander WeverFixing the case where rounding errors make the isSameGeolocalization test...Fixing the case where rounding errors make the isSameGeolocalization test fail, even though the two grids are basically the same Geolocalization.
Example:
the following test for two grids failed, even though it's clear that it's relate...Fixing the case where rounding errors make the isSameGeolocalization test fail, even though the two grids are basically the same Geolocalization.
Example:
the following test for two grids failed, even though it's clear that it's related to floating point rounding errors (see bold)
- grid2D.getNx()==target.grid2D.getNx() ---> 486 == 486
- grid2D.getNy()==target.grid2D.getNy() ---> 200 == 200
- llcorner: <Coords>
Altitude -999
Lat/Long (-4°45'0.000000" , -12°15'0.000000")
Lat/Long (-4.7500000000 , -12.2500000000)
X/Y_coords (-2416423 , 11129371)
Projection PROJ (3031)
EPSG 3031
</Coords>
- target.llcorner: <Coords>
Altitude -999
Lat/Long (-4°45'0.000000" , -12°15'0.000000")
Lat/Long (-4.7500000000 , -12.2500000000)
X/Y_coords (-2416423 , 11129371)
Projection PROJ (3031)
EPSG 3031
</Coords>
- cellsize==target.cellsize ---> -999 != 5528.85
- **ur_lat==target.ur_lat ---> 5.20000000000000017764 != 5.19999980926513671875**
- **ur_lon==target.ur_lon ---> 12.00000000000000177636 != 12.00000000000000000000**https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/4Change to have IDW automatically interpolate wind speed components when...2021-12-17T10:22:27ZNander WeverChange to have IDW automatically interpolate wind speed components when...Change to have IDW automatically interpolate wind speed components when applied on VW, VW_MAX, VW_DRIFT or DW, and then recalculate wind speed or direction from the interpolated components.
Not sure if this should be controlled by a key...Change to have IDW automatically interpolate wind speed components when applied on VW, VW_MAX, VW_DRIFT or DW, and then recalculate wind speed or direction from the interpolated components.
Not sure if this should be controlled by a key, or that there needs to be a separate IDW_WIND interpolation But it's important to realize that interpolating wind speed or direction using IDW without applying it on the wind speed components leads to erroneous results, so there is no use case where it is justified to apply IDW on wind speed and/or direction directly I think. So in that light, I think it's okay to not give users control over this.https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/5Adding option NAMING to the USER spatialInterpolations algorithm2022-01-10T07:37:12ZNander WeverAdding option NAMING to the USER spatialInterpolations algorithmAdding option NAMING to the USER spatialInterpolations algorithm, which allows to specify the file naming convention using YYYY for year, MM for month, DD for day, hh for hour, mm for minute, ss for seconds (optional) and PARAM for meteo...Adding option NAMING to the USER spatialInterpolations algorithm, which allows to specify the file naming convention using YYYY for year, MM for month, DD for day, hh for hour, mm for minute, ss for seconds (optional) and PARAM for meteo parameter.
So for example:
```
TA::algorithms = USER
TA::user::naming = YYYY-MM-DDThh.mm_PARAM
```
would search for files 2018-12-31T23.00_TA.ext
The default is set to YYYYMMDDhhmmss_PARAM in order to not break existing setups (this was the previous required naming scheme for the USER algorithm).https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/6Bug fix for IDWLapseLocalAlgorithm: a global detrend of the station data was...2022-02-01T16:42:39ZNander WeverBug fix for IDWLapseLocalAlgorithm: a global detrend of the station data was...Bug fix for IDWLapseLocalAlgorithm: a global detrend of the station data was performed before doing the local interpolation, followed by a global retrend afterwards. This doesn't seem to be consistent with the local interpolation, which ...Bug fix for IDWLapseLocalAlgorithm: a global detrend of the station data was performed before doing the local interpolation, followed by a global retrend afterwards. This doesn't seem to be consistent with the local interpolation, which should detrend/retrend only on the local scale.
Also adding the option MAXD to be able to specify the maximum allowed distance between stations and the grid point to interpolate to. I have a use case for it, so others may have too!https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/7Pipeline: build into build folder and reuse in tests2022-04-29T07:07:21ZbuergissPipeline: build into build folder and reuse in testshttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/8GitLab CI Pipeline (Build, Tests, Release)2022-05-04T10:26:23ZbuergissGitLab CI Pipeline (Build, Tests, Release)GitLab CI Pipeline (Build, Tests, Release)GitLab CI Pipeline (Build, Tests, Release)Mathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/9Fedora release build2022-05-05T16:28:21ZbuergissFedora release buildMathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/10Improvements for tests and pipeline2022-05-30T16:32:07ZbuergissImprovements for tests and pipelineMathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/11era5 request update2022-06-03T09:22:29ZFrancesca Carlettiera5 request updateThis provides an up to date code example to download ERA5 netcdf files
for use by the Netcdf pluginThis provides an up to date code example to download ERA5 netcdf files
for use by the Netcdf pluginFrancesca CarlettiFrancesca Carlettihttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/12ERA5 request: code usage guide2022-06-15T11:00:48ZFrancesca CarlettiERA5 request: code usage guideThe ERA5 up to date code example to download ERA5 netcdf files from the CDS has been completed with a guide for the code usage.The ERA5 up to date code example to download ERA5 netcdf files from the CDS has been completed with a guide for the code usage.Francesca CarlettiFrancesca Carlettihttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/13Feature/ci without manual zipping2022-06-10T12:48:09ZbuergissFeature/ci without manual zippingMathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/15Fixed the writing of varying number of parameters in SMET2022-06-15T16:25:50ZMathias BavayFixed the writing of varying number of parameters in SMETHandling varying number of parameters over a large time range has always
been tricky, as it was necessary to figure out the exact list of
parameters before allocating the memory as well as before writing the
data. The memory allocation p...Handling varying number of parameters over a large time range has always
been tricky, as it was necessary to figure out the exact list of
parameters before allocating the memory as well as before writing the
data. The memory allocation part was done in a previous commit, but the
SMET plugin did not manage to reliably write such data.
This is now fixed, knowing that the parameters are now writen in
alphabetic order.Mathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/16Implementing new PROJ API2022-06-24T22:23:22ZNander WeverImplementing new PROJ APIImplementing the new PROJ API, which is the only one supported with libproj version 8.0.0 or higher. If an older version of the library is used, the old PROJ4 API is used.Implementing the new PROJ API, which is the only one supported with libproj version 8.0.0 or higher. If an older version of the library is used, the old PROJ4 API is used.Nander WeverNander Weverhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/17Fix read-in of a NetCDF dates list2023-02-01T15:15:48ZMichael ReiseckerFix read-in of a NetCDF dates listI'm trying to read dates from a NetCDF file.
Presumably this worked for some kind of Null-terminated data in some files? For me and simple date strings it didn't and behaved like this minimal example:
```c++
char *data = (char*)calloc(l...I'm trying to read dates from a NetCDF file.
Presumably this worked for some kind of Null-terminated data in some files? For me and simple date strings it didn't and behaved like this minimal example:
```c++
char *data = (char*)calloc(length, sizeof(char));
data[0] = 'a'; data[1] = 'b'; data[2] = 'c';
std::string res(&data[1]);
```
(Giving "bc", or in the case of MeteoIO the first string would be all dates after each other, the next one all dates again but truncated by length `strMaxLen`, etc.)
Here is how `ncdump` displays the strings:
```
dimensions:
(...)
DateStrLen = 19 ;
(...)
data:
Times =
"2022-09-18_06:00:00",
"2022-09-18_07:00:00",
(...)
"2022-09-19_02:00:00",
"2022-09-19_03:00:00" ;
```
So, is `strMaxLen` really just an upper limit, and with this fix do we need to take care of string termination before reaching this length afterwards?Mathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/18Add Eigen 3.4.02023-02-09T13:47:57ZEvan Thomasevan.thomas@epfl.chAdd Eigen 3.4.0Eigen (at [3.4.0/3147391d](https://gitlab.com/libeigen/eigen/-/tree/3.4)) has been added to support Vapour Transport functionality within the SNOWPACK project.
See discussion at https://code.wsl.ch/snow-models/snowpack/-/merge_requests/8Eigen (at [3.4.0/3147391d](https://gitlab.com/libeigen/eigen/-/tree/3.4)) has been added to support Vapour Transport functionality within the SNOWPACK project.
See discussion at https://code.wsl.ch/snow-models/snowpack/-/merge_requests/8Evan Thomasevan.thomas@epfl.chEvan Thomasevan.thomas@epfl.chhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/19Update naming of constants in functions relating to Vapor Saturation Pressure2023-02-24T15:49:51ZEvan Thomasevan.thomas@epfl.chUpdate naming of constants in functions relating to Vapor Saturation PressureHi @bavay, is this how you had imagined these functions to be modified?
In response to https://code.wsl.ch/snow-models/snowpack/-/merge_requests/8?diff_id=972&start_sha=1301145e60f0f7dc6dc0518f97601776a2735f12#note_7977Hi @bavay, is this how you had imagined these functions to be modified?
In response to https://code.wsl.ch/snow-models/snowpack/-/merge_requests/8?diff_id=972&start_sha=1301145e60f0f7dc6dc0518f97601776a2735f12#note_7977Mathias BavayMathias Bavayhttps://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/20Allowing to specify virtual station names2023-05-02T08:04:33ZNander WeverAllowing to specify virtual station namesAdding the possibility to specify a name for the virtual stations, by using the key VNAME#, like:
```
VSTATION2 = latlon 46.793031 9.831572 1577
VID2 = MAT
VNAME2 = Mattenwald
```Adding the possibility to specify a name for the virtual stations, by using the key VNAME#, like:
```
VSTATION2 = latlon 46.793031 9.831572 1577
VID2 = MAT
VNAME2 = Mattenwald
```https://gitlabext.wsl.ch/snow-models/meteoio/-/merge_requests/21Also report when negative air pressure is encountered, because that would...2023-08-17T16:54:05ZNander WeverAlso report when negative air pressure is encountered, because that would...I encountered multiple cases where users accidentally have pressure in hPa instead of Pa, which propagates through MeteoIO and can cause negative pressure values in the Sun object. This causes a floating point exception, which may not be...I encountered multiple cases where users accidentally have pressure in hPa instead of Pa, which propagates through MeteoIO and can cause negative pressure values in the Sun object. This causes a floating point exception, which may not be easy for users to debug and uncover.
So I propose just an additional check on pressure and throwing a proper error message. Made a merge request, not to interfere with the current ongoing release process.