The UFZ services GitLab and Mattermost will be unavailable on Monday, January 24 from 06:00 AM to 08:00 AM due to maintenance work.

Want to get a quick-start introduction to Shell, Git and GitLab? Join the next beginners course on 28/31 January. Register now!

Commit b5c15fdf authored by Johannes Leins's avatar Johannes Leins
Browse files

fixed distance calc for clim interpol: distances >= size returned 0 resulting...

fixed distance calc for clim interpol: distances >= size returned 0 resulting in zero weight as well
parent 1caaba59
Pipeline #22292 passed with stage
in 27 seconds
......@@ -259,9 +259,9 @@ CSVHandlerGrassland::CSVHandlerGrassland(string filename, bool climInterpolate,
* Constants::STRAIN_FACTOR_GRASSLAND_Y
- Constants::OFFSET_GRASSLAND_Y;
float distGrasslandToX = abs(xCoord.second - centerInterpolClimX);
distGrasslandToX = distGrasslandToX > sizeX ? sizeX : distGrasslandToX;
distGrasslandToX = distGrasslandToX >= sizeX ? sizeX - 1 : distGrasslandToX;
float distGrasslandToY = abs(yCoord.second - centerInterpolClimY);
distGrasslandToY = distGrasslandToY > sizeY ? sizeY : distGrasslandToY;
distGrasslandToY = distGrasslandToY >= sizeY ? sizeY - 1 : distGrasslandToY;
float area = (sizeX - distGrasslandToX) * (sizeY - distGrasslandToY);
interpolFactByClimCoord[pairClimCoordInterpolRatio.first] = area;
totalArea += area;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment