src/operators/processing/meteosat/gccthermthresholddetection.cpp
/**
 * This function determines the bucket of the minimum between a land and cloud peak (and the number of increasing buckets):
 * The minimum is indicated by at least 'minimum_increasing_buckets_for_rising_trend' buckets with greater values on the cloud peak side.
 */
This function determines the bucket of the minimum between a land and cloud peak (and the number of increasing buckets):
The minimum is indicated by at least 'minimum_increasing_buckets_for_rising_trend' buckets with greater values on the cloud peak side.
This function determines the bucket of the minimum between a land and cloud peak ( and the number of increasing buckets ) : The minimum is indicated by at least ' minimum_increasing_buckets_for_rising_trend ' buckets with greater values on the cloud peak side .
std::pair<int,int> phase1FindMinimumWithRisingTrendBetweenLandAndCloudPeak(Histogram *histogram, const double minimum_increasing_buckets_for_rising_trend, const int land_peak_bucket){
	int minimum_between_land_and_cloud_peak_bucket = land_peak_bucket;
	int increasing_buckets = 0;
	for(int i = land_peak_bucket-1; i >= 0; i--){
		int bucket_count = histogram->getCountForBucket(i);
		if(bucket_count > histogram->getCountForBucket(i+1)){
			increasing_buckets += 1;
			if(increasing_buckets >= minimum_increasing_buckets_for_rising_trend)
				break;
		}
		else{
			increasing_buckets = std::max(increasing_buckets-1, 0);
			if(bucket_count < histogram->getCountForBucket(minimum_between_land_and_cloud_peak_bucket))
				 minimum_between_land_and_cloud_peak_bucket = i;
		}
	}
	return (std::pair<int,int>{minimum_between_land_and_cloud_peak_bucket, increasing_buckets});
}
std :: pair < int , int > phase1FindMinimumWithRisingTrendBetweenLandAndCloudPeak ( Histogram * histogram , const double minimum_increasing_buckets_for_rising_trend , const int land_peak_bucket ) { int minimum_between_land_and_cloud_peak_bucket = land_peak_bucket ; int increasing_buckets = 0 ; for ( int i = land_peak_bucket - 1 ; i >= 0 ; i -- ) { int bucket_count = histogram -> getCountForBucket ( i ) ; if ( bucket_count > histogram -> getCountForBucket ( i + 1 ) ) { increasing_buckets += 1 ; if ( increasing_buckets >= minimum_increasing_buckets_for_rising_trend ) break ; } else { increasing_buckets = std :: max ( increasing_buckets - 1 , 0 ) ; if ( bucket_count < histogram -> getCountForBucket ( minimum_between_land_and_cloud_peak_bucket ) ) minimum_between_land_and_cloud_peak_bucket = i ; } } return ( std :: pair < int , int > { minimum_between_land_and_cloud_peak_bucket , increasing_buckets } ) ; }
This function determines the bucket of the minimum between a land and cloud peak (and the number of increasing buckets):
 The minimum is indicated by at least 'minimum_increasing_buckets_for_rising_trend' buckets with greater values on the cloud peak side.
This function determines the bucket of the minimum between a land and cloud peak ( and the number of increasing buckets ) : The minimum is indicated by at least ' minimum_increasing_buckets_for_rising_trend ' buckets with greater values on the cloud peak side .
/** starting from land peak bucket we are searching buckets at lower positions with rising counts.
	 ** TODO: this approach is strange as it allows a pattern like 10 11 12 -10 9 8 7 with minimum_increasing_buckets_for_rising_trend = 4.
	 ** 	One solution would be: if there is a new minimum -> increasing_buckets should be reset to 0....
	 **/