Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to write surfaces to the trends folder in RMS #1236

Open
tnatt opened this issue Aug 28, 2024 · 0 comments
Open

Add functionality to write surfaces to the trends folder in RMS #1236

tnatt opened this issue Aug 28, 2024 · 0 comments

Comments

@tnatt
Copy link
Contributor

tnatt commented Aug 28, 2024

From RMS v.14.2 the rmsapi supports writing surfaces to the trends folder.

This enables the removal of the workaround here

elif stype == "trends":
if name not in proj.trends.surfaces:
logger.info("Name %s is not present in trends", name)
raise ValueError(
f"Name {name} is not within Trends (it must exist in advance!)"
)
# here a workound; trends.surfaces are read-only in Roxar API, but is seems
# that load() in RMS is an (undocumented?) workaround...
try:
import roxar
except ImportError as err:
raise ImportError(
"roxar not available, this functionality is not available"
) from err
roxsurf = proj.trends.surfaces[name]
with tempfile.TemporaryDirectory() as tmpdir:
logger.info("Made a tmp folder: %s", tmpdir)
self.to_file(os.path.join(tmpdir, "gxx.gri"), fformat="irap_binary")
roxsurf.load(os.path.join(tmpdir, "gxx.gri"), roxar.FileFormat.ROXAR_BINARY)

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

No branches or pull requests

1 participant