Skip to content

Commit

Permalink
FIX: Sorting the periods to always be ascending
Browse files Browse the repository at this point in the history
This is needed for later functions that need to have
increasing values. Previously, I made the incorrect assumption
that all data was sorted coming in.
  • Loading branch information
greglucas committed Apr 12, 2021
1 parent 493a0da commit 9f9e572
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bezpy/mt/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def read_xml(fname):

# Get all the data in a pandas dataframe
site.data = parse_data(root.find("Data"))
# Sort the index so periods are increasing
site.data = site.data.sort_index()

site.periods = np.array(site.data.index)
site.Z = np.vstack([site.data['z_zxx'], site.data['z_zxy'],
Expand Down

0 comments on commit 9f9e572

Please sign in to comment.