Skip to content

Commit

Permalink
Fixed a bug when field_scale keyword is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
oddvarlia committed Nov 10, 2023
1 parent a3f007c commit 93398f0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions semeio/workflows/localisation/local_script_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}. "
Expand Down Expand Up @@ -999,7 +1013,7 @@ def __call__(self, data_index):
class ConstantScalingFactor:
value: float

def __call__(self, data_index):
def __call__(self, _):
return self.value


Expand Down Expand Up @@ -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: "
Expand Down

0 comments on commit 93398f0

Please sign in to comment.