Skip to content

Conversation

@oddvarlia
Copy link
Collaborator

@oddvarlia oddvarlia commented Aug 15, 2025

The script is initially using Drogon case from this summer.
The distance-based localization depends on having position for observations (well prod observations and seismic points for 4D)
This is currently not available in ERT and storage directories created by ERT so the information must be taken from the FMU setup for seismic observations and the RMS forward model.

A script to extract position data from wells using RMS project is included
The plan is to get position data for the seismic observations as well by loading files with seismic data points including position from ERT project.

Main goal of this branch is to test and evaluate performance of distance-based localization before the method is implemented in ERT code.

This branch is built on the branch Distance-based localization per 15.08.2025

@oddvarlia oddvarlia marked this pull request as draft August 15, 2025 12:22
@oddvarlia oddvarlia requested a review from dafeda August 15, 2025 12:23
groups = list(param_config_all.keys())
realizations = ensemble.get_realization_list_with_responses()
group_number = 0
for group_name in groups:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use enumerate to avoid having to increment group_number manually.
for group_number, group_name in enumerate(groups)

smoother = DistanceESMDA(
covariance=C_D, observations=observations, alpha=alpha, seed=seed
)
smoother.prepare_assimilation(Y, truncation=0.99)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can as part of the assimilate_batch function and only do the actual calculations if self.X3 and self.D` are not already set.

# Turn on/off export of field parameters into 3D parameter files in ROFF format to be read by RMS.
WRITE_STATS_PARAMS = True

# Common definition of ERTBOX for all zones in Drogon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the grid file specified using the GRID keyword in the Drogon project contain all this information?

OBS_FILE_PATH = (
"/project/fmu/users/olia/drogon_20250623_11-50/resmod/ff/25.0.0/rms/model/"
)
OBS_FILE = "summary_obs_with_localization_attributes.csv"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you push this file to the repo as well or is it perhaps too big?

OBS_SUMMARY_WITH_LOCAL_ATTRIBUTES_FILE = OBS_FILE_PATH + OBS_FILE

# Hard-coded a classification of parameter groups into scalars, 2D or 3D field parameters
# NOTE: This should be available from ERT storage (ERT knows about the source the keyword FIELD, SURFACE GEN_KW)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's one way to get the parameter type:

with open_storage(storage_path, "r") as storage:
    experiment = storage.get_experiment_by_name(experiment_name)
    
print(experiment.parameter_configuration["COND"].type)
# >> field

print(experiment.parameter_configuration["INIT_TEMP_SCALE"].type)
# >> gen_kw

# (e.g for permeabilit or porosity) could be <zone_name>_<facies>_<petro_name>
# for petrophysical fields to be updated simultaneously with facies update from APS.
# For reservoir zones without facies modelling, the convention could be <zone_name>_<petro_name>
# NOTE: An additional parameter in FIELD keyword with zone name can solve the problem if naming convention
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue has been created on this that needs more information:

equinor/ert#11517

@dafeda
Copy link
Collaborator

dafeda commented Sep 5, 2025

I suggest we generate .csv files that are comma delimited and not delimited by space. This can avoid potential bugs if for example a zone name has a space in its name.

@oddvarlia oddvarlia force-pushed the real_case_test branch 3 times, most recently from a5846f6 to 0b1f9a9 Compare September 7, 2025 21:05
@oddvarlia oddvarlia force-pushed the real_case_test branch 3 times, most recently from 7505b9c to 14a73ba Compare September 23, 2025 10:59
@oddvarlia oddvarlia force-pushed the real_case_test branch 2 times, most recently from 6992e30 to c7e0d02 Compare October 4, 2025 08:57
update distance_based_on_real_case.py
Added seismic obs and RFT obs
Attempt to save update to ERT storage
Added tracer obs
Added tracer obs file
Added ESMDA update to scalars
Modified the path to where on scratch to find the ensemble
Ensure that updated ensemble in storage has iteration greater than 0
Added new scaling function
Changed seismic_range
Update scalar parameters
Updated document lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants