From 93398f043892f5477ac1699a605c7c179e80081b Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Fri, 10 Nov 2023 17:43:32 +0100 Subject: [PATCH] Fixed a bug when field_scale keyword is missing --- .../localisation/local_script_lib.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/semeio/workflows/localisation/local_script_lib.py b/semeio/workflows/localisation/local_script_lib.py index 50ce3142f..1905c74e9 100644 --- a/semeio/workflows/localisation/local_script_lib.py +++ b/semeio/workflows/localisation/local_script_lib.py @@ -759,7 +759,21 @@ def add_ministeps( [node_name, row_scaling] ) else: + # The keyword for how to specify scaling parameter for field + # is not used. Use default: scaling factor = 1 everywhere + row_scaling = RowScaling() scaling_factor_default = 1.0 + (param_for_field, _) = apply_constant( + row_scaling, + grid_for_field, + scaling_factor_default, + user_config.log_level, + user_config.write_scaling_factors, + ) + update_step["row_scaling_parameters"].append( + [node_name, row_scaling] + ) + debug_print( f"No correlation scaling specified for node {node_name} " f"in {ministep_name}. " @@ -999,7 +1013,7 @@ def __call__(self, data_index): class ConstantScalingFactor: value: float - def __call__(self, data_index): + def __call__(self, _): return self.value @@ -1094,8 +1108,8 @@ def write_qc_parameter_surface( qc_surface[f_indx] = param_for_surface[c_indx] qc_surface.write(filename) print( - "Write calculated scaling factor with name: " - f"{scaling_surface_name} to file: {filename}" + "Write calculated scaling factor for SURFACE parameter " + f"in {cls.corr_name} to file: {filename}" ) debug_print( f"Write calculated scaling factor with name: "