Skip to content

Commit

Permalink
On write, for created LAS, update step vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dcslagel committed Apr 19, 2021
1 parent 48f1a24 commit 051f6dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lasio/las.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def __init__(self, file_ref=None, **read_kwargs):
super(LASFile, self).__init__()
self._text = ""
self.index_unit = None
self.index_name = None
self.index_org = None
self.index_initial = None
default_items = defaults.get_default_items()
self.sections = {
"Version": default_items["Version"],
Expand Down Expand Up @@ -371,8 +370,7 @@ def read(
self.index_unit = None

if len(self.curves) > 0:
self.index_name = self.curves[0].mnemonic
self.index_org = self[self.index_name].copy()
self.index_initial = self.index.copy()

def update_start_stop_step(self, STRT=None, STOP=None, STEP=None, fmt="%.5f"):
"""Configure or Change STRT, STOP, and STEP values
Expand Down
4 changes: 2 additions & 2 deletions lasio/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def write(
# if there is a curve index name and the index curve has changed
# then update the step variables
# -------------------------------------------------------------------------
if las.index_name and not (las.index_org==las[las.index_name]).all():
las.update_start_stop_step()
if not (las.index_initial==las.index).all():
las.update_start_stop_step(STRT, STOP, STEP)

# Write each section.
# get_formatter_function ( ** get_section_widths )
Expand Down

0 comments on commit 051f6dc

Please sign in to comment.