Skip to content

Commit

Permalink
Use better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeda committed Dec 1, 2022
1 parent 12ac2fd commit 91bb1da
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/ert/analysis/_es_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def analysis_ES(
] = observation_handle.update_snapshot
observation_values = observation_handle.observation_values
observation_errors = observation_handle.observation_errors
if len(observation_values) == 0:

nobservations = len(observation_values)
if nobservations == 0:
raise ErtAnalysisError(
f"No active observations for update step: {update_step.name}."
)
Expand All @@ -203,13 +205,13 @@ def analysis_ES(
)

if A is not None:
noise = rng.standard_normal(size=(len(observation_values), Y.shape[1]))
nrealizations = A.shape[1]
nparameters = A.shape[0]
noise = rng.standard_normal(size=(nobservations, nrealizations))
if module.localization():
A_ES_loc = []
N = A.shape[1]
p = A.shape[0]
for i in range(A.shape[0]):
A_chunk = A[i, :].reshape(-1, N)
for i in range(nparameters):
A_chunk = A[i, :].reshape(1, nrealizations)
corr_idx_Y = _correlated_parameter_response_pairs(
A_chunk,
Y,
Expand Down Expand Up @@ -291,7 +293,7 @@ def analysis_IES(
# Looping over local analysis update_step
for update_step in updatestep:

S, observation_handle = update.load_observations_and_responses(
Y, observation_handle = update.load_observations_and_responses(
source_fs,
obs,
alpha,
Expand All @@ -307,16 +309,18 @@ def analysis_IES(
observation_values = observation_handle.observation_values
observation_errors = observation_handle.observation_errors
observation_mask = observation_handle.obs_mask
if len(observation_values) == 0:

nobservations = len(observation_values)
if nobservations == 0:
raise ErtAnalysisError(
f"No active observations for update step: {update_step.name}."
)

A = _get_A_matrix(temp_storage, update_step.parameters)

noise = rng.standard_normal(size=(len(observation_values), S.shape[1]))
nrealizations = A.shape[1]
noise = rng.standard_normal(size=(nobservations, nrealizations))
A = iterative_ensemble_smoother.update_step(
S,
Y,
A,
observation_errors,
observation_values,
Expand Down

0 comments on commit 91bb1da

Please sign in to comment.