Skip to content

Commit

Permalink
Merge commit '373846a1b1a53a994eef904a07b41e811919292f'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Sep 10, 2024
2 parents 0afdac1 + 373846a commit ac3226f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions agrolib/interpolation/interpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ void localSelection(vector <Crit3DInterpolationDataPoint> &inputPoints, vector <
inputPoints[i].distance = gis::computeDistance(x, y, float((inputPoints[i]).point->utm.x), float((inputPoints[i]).point->utm.y));

unsigned int nrValid = 0;
float stepRadius = 2500; // [m]
float stepRadius = 1000; // [m]
float r0 = 0; // [m]
float r1 = stepRadius; // [m]
unsigned int i;
Expand All @@ -1103,7 +1103,6 @@ void localSelection(vector <Crit3DInterpolationDataPoint> &inputPoints, vector <
int maxDistance = 0;
while (nrValid < minPoints || (mySettings.getUseLapseRateCode() && nrPrimaries < minPoints))
{
maxDistance = 0;
for (i=0; i < inputPoints.size(); i++)
{
if (inputPoints[i].distance != NODATA && inputPoints[i].distance > r0 && inputPoints[i].distance <= r1)
Expand All @@ -1125,7 +1124,7 @@ void localSelection(vector <Crit3DInterpolationDataPoint> &inputPoints, vector <
for (i=0; i< selectedPoints.size(); i++)
{
selectedPoints[i].regressionWeight = MAXVALUE(1 - selectedPoints[i].distance / maxDistance, EPSILON);
//selectedPoints[i].regressionWeight = MAXVALUE(std::exp(-std::pow(selectedPoints[i].distance/((4/5*maxDistance)),7.0)),EPSILON);
//selectedPoints[i].regressionWeight = MAXVALUE(std::exp(-selectedPoints[i].distance*selectedPoints[i].distance/((0.5*maxDistance)*(0.5*maxDistance))),EPSILON);
//selectedPoints[i].regressionWeight = float(MAXVALUE((-(1/std::pow(maxDistance,4)*(std::pow(selectedPoints[i].distance,4)))+1),EPSILON));
//selectedPoints[i].regressionWeight = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion agrolib/interpolation/interpolationSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ TFittingFunction Crit3DInterpolationSettings::getChosenElevationFunction()

void Crit3DInterpolationSettings::setChosenElevationFunction(TFittingFunction chosenFunction)
{
const double H0_MIN = -200; //height of inversion point (double piecewise) or first inversion point (triple piecewise)
const double H0_MIN = -350; //height of single inversion point (double piecewise) or first inversion point (triple piecewise)
const double H0_MAX = 2500;
const double DELTA_MIN = 300; //height difference between inversion points (for triple piecewise only)
const double DELTA_MAX = 1000;
Expand Down
3 changes: 2 additions & 1 deletion agrolib/proxyWidget/localProxyWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,15 @@ void Crit3DLocalProxyWidget::modelLRClicked(int toggled)
else
{
//TODO: local proxy graph for other proxies
interpolationSettings->setCurrentCombination(interpolationSettings->getSelectedCombination());
/*interpolationSettings->setCurrentCombination(interpolationSettings->getSelectedCombination());
interpolationSettings->clearFitting();
std::string errorStr;
if (! multipleDetrendingOtherProxiesFitting(proxyPos, subsetInterpolationPoints, interpolationSettings, myVar, errorStr)) return;
std::vector<std::vector<double>> parameters = interpolationSettings->getFittingParameters();
if (!interpolationSettings->getFittingParameters().empty() && !interpolationSettings->getFittingFunction().empty())
detrendingOtherProxies(3, outInterpolationPoints, interpolationSettings);
*/

}
chartView->drawModelLapseRate(point_vector);
Expand Down

0 comments on commit ac3226f

Please sign in to comment.