Skip to content
Snippets Groups Projects
Commit 193e342d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Added test for remapknn_rbf

parent 1e60790b
No related branches found
No related tags found
1 merge request!331M214003/develop
Pipeline #97603 passed
......@@ -328,6 +328,7 @@ remapknn_get_parameter()
else if (key == "kmin") knnParams.kMin = parameter_to_int(value);
else if (key == "weighted") knnParams.weighted = string_to_weightingMethod(parameter_to_word(value));
else if (key == "gauss_scale") knnParams.gaussScale = parameter_to_double(value);
else if (key == "rbf_scale") knnParams.rbfScale = parameter_to_double(value);
else if (key == "extrapolate") knnParams.extrapolate = parameter_to_bool(value);
else if (key == "grid") params.gridString = parameter_to_word(value);
else cdo_abort("Invalid parameter key >%s<!", key);
......@@ -356,7 +357,8 @@ print_knn_parameter(KnnParams const &knnParams, std::string const &prefix)
outbuffer << "k=" << knnParams.k;
outbuffer << ", kmin=" << knnParams.kMin;
outbuffer << ", weighted=" << weightingMethod_to_string(knnParams.weighted);
outbuffer << ", gauss_scale=" << knnParams.gaussScale;
if (knnParams.weighted == WeightingMethod::gaussWeighted) outbuffer << ", gauss_scale=" << knnParams.gaussScale;
if (knnParams.weighted == WeightingMethod::rbf) outbuffer << ", rbf_scale=" << knnParams.rbfScale;
outbuffer << ", extrapolate=" << knnParams.extrapolate;
cdo_verbose("%s", outbuffer.str());
......
......@@ -25,7 +25,7 @@ string_to_weightingMethod(const std::string &methodStr)
if (methodStr == "gauss") return WeightingMethod::gaussWeighted;
if (methodStr == "rbf") return WeightingMethod::rbf;
cdo_abort("method=%s unsupported (available: avg|dist|linear|gauss)", methodStr);
cdo_abort("method=%s unsupported (available: avg|dist|linear|gauss|rbf)", methodStr);
return WeightingMethod::undefined;
}
......
......@@ -60,6 +60,7 @@ REMAPHEALPIX = temp_remapcon_global_2_to_hp16_nest_ref temp_remapcon_hp16_nest_t
temp_remapdis_global_2_to_hp16_nest_ref temp_remapdis_hp16_nest_to_hp16_nest_ref temp_remapdis_hp32_nest_to_global_5_ref \
temp_remapnn_global_2_to_hp16_nest_ref temp_remapnn_hp16_nest_to_hp16_nest_ref temp_remapnn_hp32_nest_to_global_5_ref
REMAPKNN = temp_remapknn_gauss_global_2_to_global_5_ref temp_remapknn_gauss_global_5_to_global_5_ref temp_remapknn_gauss_global_5_to_global_2_ref \
temp_remapknn_rbf_global_2_to_global_5_ref temp_remapknn_rbf_global_5_to_global_5_ref temp_remapknn_rbf_global_5_to_global_2_ref \
temp_remapknn_avg_global_5_to_global_2_ref temp_remapknn_avg_global_5_to_global_5_ref temp_remapknn_avg_global_2_to_global_5_ref
REMAPGRID = temp_remapbic_global_2_to_global_5_ref temp_remapdis_global_2_to_global_5_ref temp_remapnn_global_2_to_global_5_ref \
temp_remapbil_global_2_to_global_5_ref temp_remaplaf_global_2_to_global_5_ref temp_remapcon_global_2_to_global_5_ref \
......
......@@ -8,6 +8,9 @@ FORMAT="-f srv -b F32"
#
# remapknn
#
cdo -f srv -b 32 remapknn,grid=global_5,k=4,weighted=rbf,rbf_scale=2 -temp,global_2 temp_remapknn_rbf_global_2_to_global_5_ref
cdo -f srv -b 32 remapknn,grid=global_5,k=4,weighted=rbf,rbf_scale=2 -temp,global_5 temp_remapknn_rbf_global_5_to_global_5_ref
cdo -f srv -b 32 remapknn,grid=global_2,k=4,weighted=rbf,rbf_scale=2 -temp,global_5 temp_remapknn_rbf_global_5_to_global_2_ref
cdo -f srv -b 32 remapknn,grid=global_5,k=16,weighted=gauss,gauss_scale=2 -temp,global_2 temp_remapknn_gauss_global_2_to_global_5_ref
cdo -f srv -b 32 remapknn,grid=global_5,k=16,weighted=gauss,gauss_scale=2 -temp,global_5 temp_remapknn_gauss_global_5_to_global_5_ref
cdo -f srv -b 32 remapknn,grid=global_2,k=16,weighted=gauss,gauss_scale=2 -temp,global_5 temp_remapknn_gauss_global_5_to_global_2_ref
......
File added
File added
File added
......@@ -10,8 +10,8 @@ OPERATOR="remapknn"
test_module=TestModule()
KNNNAMES=["remapnn", "remapdis", "remapknn_avg", "remapknn_gauss"]
KNNPARAMS=["k=1,weighted=dist,extrapolate=1", "k=4,kmin=1,weighted=dist,extrapolate=1", "k=9,weighted=avg", "k=16,weighted=gauss,gauss_scale=2"]
KNNNAMES=["remapnn", "remapdis", "remapknn_avg", "remapknn_gauss", "remapknn_rbf"]
KNNPARAMS=["k=1,weighted=dist,extrapolate=1", "k=4,kmin=1,weighted=dist,extrapolate=1", "k=9,weighted=avg", "k=16,weighted=gauss,gauss_scale=2", "k=4,weighted=rbf,rbf_scale=2"]
SRCGRIDS=["global_2", "global_5", "global_5"]
TGTGRIDS=["global_5", "global_2", "global_5"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment