Skip to content

Commit

Permalink
Simplify records of radial position and momentum
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFP committed Sep 1, 2023
1 parent 6790251 commit 4e46b60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ def simplify_record(record_comps):
record_comps.remove('position/z')
record_comps.remove('positionOffset/z')
record_comps.append('z')
if ('position/r' in record_comps) and ('positionOffset/r' in record_comps):
record_comps.remove('position/r')
record_comps.remove('positionOffset/r')
record_comps.append('r')

# Replace the names of the momenta
if 'momentum/x' in record_comps:
Expand All @@ -218,6 +222,9 @@ def simplify_record(record_comps):
if 'momentum/z' in record_comps:
record_comps.remove('momentum/z')
record_comps.append('uz')
if 'momentum/r' in record_comps:
record_comps.remove('momentum/r')
record_comps.append('ur')

# Replace the name for 'weights'
if 'weighting' in record_comps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ def simplify_record(record_comps):
record_comps.remove('position/z')
record_comps.remove('positionOffset/z')
record_comps.append('z')
if ('position/r' in record_comps) and ('positionOffset/r' in record_comps):
record_comps.remove('position/r')
record_comps.remove('positionOffset/r')
record_comps.append('r')

# Replace the names of the momenta
if 'momentum/x' in record_comps:
Expand All @@ -195,6 +199,9 @@ def simplify_record(record_comps):
if 'momentum/z' in record_comps:
record_comps.remove('momentum/z')
record_comps.append('uz')
if 'momentum/r' in record_comps:
record_comps.remove('momentum/r')
record_comps.append('ur')

# Replace the name for 'weights'
if 'weighting' in record_comps:
Expand Down

0 comments on commit 4e46b60

Please sign in to comment.