src/operators/processing/meteosat/gccthermthresholddetection.cpp
/**
 * This function detects a cloud peak merged into a land peak
 */
This function detects a cloud peak merged into a land peak
This function detects a cloud peak merged into a land peak
int phase2FindMergedPeaksBucket(Histogram *histogram, const int minimum_soft_falling_buckets, const int land_peak_bucket, const double bucket_ratio_bound_lower,  const double bucket_ratio_bound_higher){
	int merged_peeks_soft_falling_bucket = 0;
	int soft_falling_buckets = 0;
	for(int i = land_peak_bucket-1; i >= 0; i--){
		double bucket_ratio = static_cast<double>(histogram->getCountForBucket(i)) / static_cast<double>(histogram->getCountForBucket(i+1));
			if((bucket_ratio > bucket_ratio_bound_lower) & (bucket_ratio <=bucket_ratio_bound_higher)){
				soft_falling_buckets += 1;
			if(soft_falling_buckets >= minimum_soft_falling_buckets){
				merged_peeks_soft_falling_bucket = i + soft_falling_buckets; 
				break;
			}
		}
		else{
			soft_falling_buckets = 0;
		}
	}
	return (merged_peeks_soft_falling_bucket);
}
int phase2FindMergedPeaksBucket ( Histogram * histogram , const int minimum_soft_falling_buckets , const int land_peak_bucket , const double bucket_ratio_bound_lower , const double bucket_ratio_bound_higher ) { int merged_peeks_soft_falling_bucket = 0 ; int soft_falling_buckets = 0 ; for ( int i = land_peak_bucket - 1 ; i >= 0 ; i -- ) { double bucket_ratio = static_cast < double > ( histogram -> getCountForBucket ( i ) ) / static_cast < double > ( histogram -> getCountForBucket ( i + 1 ) ) ; if ( ( bucket_ratio > bucket_ratio_bound_lower ) & ( bucket_ratio <= bucket_ratio_bound_higher ) ) { soft_falling_buckets += 1 ; if ( soft_falling_buckets >= minimum_soft_falling_buckets ) { merged_peeks_soft_falling_bucket = i + soft_falling_buckets ; break ; } } else { soft_falling_buckets = 0 ; } } return ( merged_peeks_soft_falling_bucket ) ; }
This function detects a cloud peak merged into a land peak
This function detects a cloud peak merged into a land peak
//go back to the start of the matching buckets