Core example for nrutils: Find a simulation, load and plot waveform data

Let's start by importing nrutils


In [1]:
# Setup enviroment to autoreload packages
%load_ext autoreload
%autoreload 2
# Turn on inline plotting with matplotlib, and import needed thigs from nrutils
%matplotlib inline
from nrutils import scsearch,gwylm


The highest level init for nrutils is located at: /Users/book/JOKI/Libs/KOALA/nrutils_dev/nrutils/__init__.pyc

>> Initiating nrutils ...

>> Sub-Packages to be imported:
   -> core
   -> manipulate
   -> tools
>> Please note style conventions:                  
   * lower case function/method/variable names                  
   * no underscore in names unless there are repeated letters, or counfounded syllables                  
   * information is implicitely in time domain unless explicitely stated.                  
   * frequency domain information will start with "fd".

nrutils:

  .core: 
      .basics*
      .basics
      .nrsc
  .manipulate: 
      .bundlers
  .tools: 
    .unit: 
      .conversion

Find a simulation using scsearch


In [4]:
# Search for simulations
# A = scsearch(institute='sxs',nonspinning=True,q=[1,10],verbose=True,unique=True)
# A = scsearch(precessing=True,q=[1,1.5],verbose=True,unique=True)
A = scsearch(keyword="base",unique=True,verbose=True)


[scsearch]>> Found keyword (='base') keyword.
[scsearch]>> Found unique (=True) keyword.
[scsearch]>> Found verbose (=True) keyword.
(scsearch)>> List of keywords or string keyword found: ALL scentry objects matching will be passed. To pass ANY entries matching the keywords, input the keywords using an iterable of not of type list.
## Found 1 unique simulations:
[0001][hogshead] q1.2_base: p-q1.20

Loading the desired multipoles -- A single multipole


In [5]:
# Convert a single simulation into a waveform object with desired multipoles
# y = gwylm( scentry_obj = A[0], lm=[2,2], dt=0.4, verbose=True )

# OR: 
y = gwylm( scentry_obj = A[0], lm=([2,2],[2,1]), dt=0.4, verbose=True )


(gwylm)>> Found clean (=False) keyword.
(gwylm)>> Found dt (=0.4) keyword.
(gwylm)>> Found lm (=([2, 2], [2, 1])) keyword.
(gwylm)>> Found load (=True) keyword.
(gwylm)>> Found scentry_obj (=<nrutils.core.nrsc.scentry instance at 0x1067c5950>) keyword.
(gwylm)>> Found verbose (=True) keyword.
(load)>> Loading: psi3col.r5.l5.l2.m2.gz
(load)>> Re-orienting waveform phase to be consistent with internal sign convention for Psi4, where sign(dPhi/dt)=1*sign(m). Note that the internal sign convention is defined in ... nrutils/core/__init__.py as "M_RELATIVE_SIGN_CONVENTION". This message has appeared becuase the waveform is determioned to obey and sign convention: sign(dPhi/dt)=-1*sign(m).
(load)>> Loading: psi3col.r5.l5.l2.m1.gz
(load)>> Re-orienting waveform phase to be consistent with internal sign convention for Psi4, where sign(dPhi/dt)=1*sign(m). Note that the internal sign convention is defined in ... nrutils/core/__init__.py as "M_RELATIVE_SIGN_CONVENTION". This message has appeared becuase the waveform is determioned to obey and sign convention: sign(dPhi/dt)=-1*sign(m).
(gwylm)>> Using w22 from a PN estimate to calculate strain multipoles [see pnw0 in basics.py, and/or arxiv:1310.1528v4].
* w0(w22) = 0.048726 (this is the lower frequency used for FFI method [arxiv:1006.1632v3])
* w0(w22) = 0.024363 (this is the lower frequency used for FFI method [arxiv:1006.1632v3])

Plot time domain strain. NOTE that strain is calculated automatically


In [7]:
# plot time domain strain
for e in y.hlm:
    e.plot(show=True,domain='time')



In [8]:
# plot time domain psi4
y.plot(kind='psi4',show=True,domain='time')


Out[8]:
[<matplotlib.axes._subplots.AxesSubplot at 0x107aa1b90>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1095eda10>,
 <matplotlib.axes._subplots.AxesSubplot at 0x107bb7890>]

In [9]:
# plot frequency domain psi4
y.plot(kind='psi4',show=True,domain='freq')


Out[9]:
[<matplotlib.axes._subplots.AxesSubplot at 0x107a48150>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1097a0150>,
 <matplotlib.axes._subplots.AxesSubplot at 0x107bd3110>]

In [10]:
# plot frequency domain strain
y.plot(kind='strain',show=True,domain='freq')


Out[10]:
[<matplotlib.axes._subplots.AxesSubplot at 0x1098665d0>,
 <matplotlib.axes._subplots.AxesSubplot at 0x107469310>,
 <matplotlib.axes._subplots.AxesSubplot at 0x107a69910>]

In [ ]: