Skip to content

Commit

Permalink
add variables lai degreeDays
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Nov 24, 2023
1 parent ecbb5b0 commit 3ff3845
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
Binary file modified DATA/PROJECT/Montue/DATA/crop_Montue.db
Binary file not shown.
13 changes: 13 additions & 0 deletions agrolib/gis/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ bool setDTMScale(Crit3DColorScale* myScale)
}


bool setLAIScale(Crit3DColorScale* myScale)
{
myScale->initialize(4, 256);

myScale->keyColor[0] = Crit3DColor(150, 75, 0); /*!< brown */
myScale->keyColor[1] = Crit3DColor(200, 150, 0); /*!< yellow */
myScale->keyColor[2] = Crit3DColor(32, 150, 32); /*!< dark green */
myScale->keyColor[3] = Crit3DColor(0, 255, 0); /*!< green */

return(myScale->classify());
}


bool setTemperatureScale(Crit3DColorScale* myScale)
{
myScale->initialize(5, 256);
Expand Down
1 change: 1 addition & 0 deletions agrolib/gis/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
bool setGrayScale(Crit3DColorScale* myScale);
bool setBlackScale(Crit3DColorScale* myScale);
bool setSurfaceWaterScale(Crit3DColorScale* myScale);
bool setLAIScale(Crit3DColorScale* myScale);


#endif // CRIT3DCOLOR_H
8 changes: 8 additions & 0 deletions agrolib/meteo/meteo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ bool setColorScale(meteoVariable variable, Crit3DColorScale *colorScale)
case dailyAirTemperatureMin: case dailyAirTemperatureRange:
case airDewTemperature:
case snowSurfaceTemperature:
case dailyHeatingDegreeDays:
setTemperatureScale(colorScale);
break;
case elaboration:
Expand Down Expand Up @@ -803,6 +804,9 @@ bool setColorScale(meteoVariable variable, Crit3DColorScale *colorScale)
case atmPressure:
setWindIntensityScale(colorScale);
break;
case leafAreaIndex:
setLAIScale(colorScale);
break;
case anomaly:
setAnomalyScale(colorScale);
break;
Expand Down Expand Up @@ -912,6 +916,10 @@ std::string getVariableString(meteoVariable myVar)
return "Sensible heat (kJ m-2)";
else if (myVar == latentHeat)
return "Latent heat (kJ m-2)";
else if (myVar == dailyHeatingDegreeDays)
return "Heating degree days (°D)";
else if (myVar == leafAreaIndex)
return "Leaf area index (m2 m-2)";

else if (myVar == noMeteoTerrain)
return "Elevation (m)";
Expand Down
2 changes: 1 addition & 1 deletion agrolib/meteo/meteo.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
dailyBIC, monthlyBIC, dailyHeatingDegreeDays, dailyCoolingDegreeDays,
snowWaterEquivalent, snowFall, snowSurfaceTemperature, snowInternalEnergy, snowSurfaceEnergy,
snowAge, snowLiquidWaterContent, snowMelt, sensibleHeat, latentHeat,
dailyWaterTableDepth,
dailyWaterTableDepth, leafAreaIndex,
anomaly, elaboration, noMeteoTerrain,
noMeteoVar};

Expand Down
6 changes: 2 additions & 4 deletions bin/CRITERIA3D/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,7 @@ void MainWindow::on_actiondegree_days_triggered()
return;
}

// TODO add variable
setOutputMeteoVariable(airTemperature, &(myProject.degreeDaysMap));
setOutputMeteoVariable(dailyHeatingDegreeDays, &(myProject.degreeDaysMap));
}


Expand All @@ -1515,8 +1514,7 @@ void MainWindow::on_actionView_Crop_LAI_triggered()
return;
}

// TODO add variable
setOutputMeteoVariable(airTemperature, &(myProject.laiMap));
setOutputMeteoVariable(leafAreaIndex, &(myProject.laiMap));
}


Expand Down

0 comments on commit 3ff3845

Please sign in to comment.