Skip to content

Instantly share code, notes, and snippets.

@llondon6
Created September 19, 2017 09:54
Show Gist options
  • Save llondon6/82ff6c83097a2a14babd437b591667b7 to your computer and use it in GitHub Desktop.
Save llondon6/82ff6c83097a2a14babd437b591667b7 to your computer and use it in GitHub Desktop.
Quick example of using nrutils to find a simulation and load+plot data
# Import useful things
from nrutils import scsearch, gwylm, alert
# Find some simulations
alert('Finding simulations',header=True)
A = scsearch(q=[3,5],nonspinning=True,verbose=True,institute='gt')
# Choose one, and print its properties
alert('Printing props for a single simulation',header=True)
a = A[0];
for k in a.__dict__: print '>> %s = %s'%(k,str(a.__dict__[k]))
# Load select multipoles from this simulation and get rid of junk
alert('Load simulation data',header=True)
y = gwylm(a,lm=[(2,2),(2,1),(2,0),(3,3),(3,2)],verbose=True,clean=True)
# ... Note that the step above automatically calculates stain and news from psi4
# Plot the data in the time domain
alert('Plotting data ...',header=True)
y.plot()
# Plot the data in the frequency domain
y.plot(domain='freq')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment