Skip to content

Commit

Permalink
Dropping duplicate nodes in salvus model exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Jun 24, 2024
1 parent 4080650 commit c3ab5d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion seismic/ASDFdatabase/xdmf2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,20 @@ def process(input_file, output_folder):

df['lon'] = lons
df['lat'] = lats
df['depth_km'] = depths
df['depth_m'] = depths
#df['x'] = xyz[:, 0]
#df['y'] = xyz[:, 1]
#df['z'] = xyz[:, 2]

for key in rkeys:
df[key] = valsDict[key]
# end for

# drop duplicates
#df.drop_duplicates(inplace=True)
# drop nodes from shadow cells, as well as those from coarser mesh
df.drop_duplicates(subset=['lon', 'lat', 'depth_m'], inplace=True)

print('Writing output file: {}'.format(ofn))
df.to_csv(ofn, header=True, index=False)
# end func
Expand Down

0 comments on commit c3ab5d7

Please sign in to comment.