From 7e341434e1b093844034aa074c4a30968521d799 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 | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/semeio/workflows/localisation/local_script_lib.py b/semeio/workflows/localisation/local_script_lib.py index 50ce3142f..539609e9f 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}. " @@ -798,7 +812,6 @@ def add_ministeps( ) surface = Surface(surface_file) - # data_size = surface.getNX() * surface.getNY() row_scaling = RowScaling() if corr_spec.surface_scale.method in _decay_methods_surf_all: ref_pos = corr_spec.surface_scale.ref_point @@ -855,8 +868,8 @@ def add_ministeps( ) else: debug_print( - "Surface parameter is specified, but no surface_scale " - "keyword is specified. Require that surface_scale " + "Surface parameter is specified, but no 'surface_scale' " + "keyword is specified. Require that 'surface_scale' " "keyword is specified.", LogLevel.LEVEL3, user_config.log_level, @@ -999,7 +1012,7 @@ def __call__(self, data_index): class ConstantScalingFactor: value: float - def __call__(self, data_index): + def __call__(self, _): return self.value @@ -1094,8 +1107,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: "