Example #1
0
    def __init__(self, eos, mass, viscosity='lessvisc', theta=0.0, phi=0.0,
            distance=20.0, noise_curve='aLIGO'):

        # waveform labels and directory setup
        self.theta = theta
        self.phi = phi
        self.distance=distance
        self.noise_curve = noise_curve

        # Create data object and identify the requested waveform
        wavedata = pmns_waveform_data.WaveData()
        this_waveform = wavedata.select_wave(eos=eos, mass=mass,
                viscosity=viscosity)
        if len(this_waveform)>1:
            print >> sys.stderr, "ERROR, too many files match the requested eos/mass/viscosity combination"
            sys.exit(-1)

        if len(this_waveform)==0:
            print >> sys.stderr, "ERROR, no waveform with selected EOS, mass and viscosity found"
            sys.exit(-1)

        self.eos = eos
        self.mass = mass
        self.data = this_waveform[0]['data']

        self.load_quadrupoles()
Example #2
0
#
# Build filename
#
filename = "snrs_%s_horizonsnr-%.2f_eos-%s_mass-%s_viscosity-%s.txt" % (
    noise_curve, horizon_snr, eos, mass, viscosity)

# XXX: should probably fix this at the module level..
if eos == "all": eos = None
if mass == "all": mass = None
if viscosity == "all": viscosity = None

#
# Create the list of dictionaries which comprises our catalogue
#
waveform_data = pdata.WaveData(eos=eos, viscosity=viscosity, mass=mass)

#
# Create Waveforms and compute SNRs
#

f = open(filename, "w")

f.writelines("# rho_full rho_post Dhor Dsens Rate\n")

rho_min = 100
rho_max = 0

for w, wave in enumerate(waveform_data.waves):

    print "SNR for %s, %s ,%s (%d of %d)" % (wave['eos'], wave['mass'],
Example #3
0
mass = "135135"
total_mass = 2 * 1.35
mass1 = 1.35
mass2 = 1.35

# Hardcoded, fixed delta_t is fine for Bauswein et al:
delta_t = 1. / 16384
f_lower_hz = 1000.0  # waveform not valid below here really; could put this on the
# pipeline to handle...
#startFreqHz = startFreq / (lal.TWOPI * massTotal * lal.MTSUN_SI)
f_lower = f_lower_hz * (lal.TWOPI * total_mass * lal.MTSUN_SI)

#
# Create waveform catalog (EOS, mass & file path)
#
waveform_data = pdata.WaveData(eos=eos, mass=mass, viscosity='lessvisc')

#
# Pull out quadrupole data
#
quadrupole_data = pwave.get_quadrupole_data(waveform_data.waves[0]['data'])

#
# Generate Hlm's
#

Hlm = pwave.construct_Hlm(*quadrupole_data[1:])

wavelen = len(Hlm['l=2, m=2'])
times = np.arange(0, wavelen * delta_t, delta_t)
times_M = times / (lal.MTSUN_SI * total_mass)
Example #4
0
# Compute Full SNR
#
full_snr = pycbc.filter.sigma(Hplus, psd=psd, low_frequency_cutoff=fmin)
Hplus.data *= target_sigma / full_snr

# Energy
signal_energy = pycbc.filter.sigmasq(Hplus, low_frequency_cutoff=fmin)

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Generate PCA template
#
#
# Create PMNS PCA instance for the reduced catalogue
#
waveform_data = pdata.WaveData(viscosity='lessvisc')

# Remove testwave_name from the catalogue:
reduced_waveform_data = waveform_data.copy()  # make a copy

# Grab the mass-eos waveform we want to study
for w, wave in enumerate(waveform_data.waves):
    if wave['mass'] == mass and wave['eos'] == eos:
        waveidx = w

#sigma_fpeak_fisher=sigma_fpeak[NPCs-1][waveidx]

if LOO:
    reduced_waveform_data.remove_wave(waveform_data.waves[waveidx])

pmpca = ppca.pmnsPCA(reduced_waveform_data,