WSL/SLF GitLab Repository

Commit 3b62f4d5 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

A small bug has been found and fixed in the Gradient class (when a data range...

A small bug has been found and fixed in the Gradient class (when a data range is zero). A few extra output specifications have been added to PNGIO.
parent 0a259d4a
......@@ -381,7 +381,7 @@ void Gradient::getColor(const double& val, unsigned int& index) const
index=2;
return;
}
if(autoscale && delta==0) { //constant data throughout the grid & autoscale are no friends...
if(delta==0) { //otherwise constant data throughout the grid makes a division by zero...
index=nr_unique_cols/2 + reserved_idx;
return;
}
......
......@@ -524,6 +524,16 @@ void PNGIO::write2DGrid(const Grid2DObject& grid_in, const MeteoGrids::Parameter
min = 0.; max = 1.;
}
gradient.set(Gradient::bg_isomorphic, min, max, autoscale);
} else if(parameter==MeteoGrids::ISWR) {
if(!autoscale) {
min = 0.; max = 1000.;
}
gradient.set(Gradient::heat, min, max, autoscale);
} else if(parameter==MeteoGrids::ILWR) {
if(!autoscale) {
min = 200.; max = 500.;
}
gradient.set(Gradient::heat, min, max, autoscale);
} else if(parameter==MeteoGrids::SWE) {
if(!autoscale) {
min = 0.; max = 2000.;
......
Supports Markdown
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