Ejemplo n.º 1
0
 def to_sngl(self):
     # All numerical values are initiated as 0 and all strings as ''
     row = SnglInspiralTable()
     row.mass1 = self.m1
     row.mass2 = self.m2
     row.mtotal = self.m1 + self.m2
     row.mchirp = self._mchirp
     row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
     row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.flow)
     row.template_duration = self.dur
     row.spin1x = self.spin1x
     row.spin1y = self.spin1y
     row.spin1z = self.spin1z
     row.spin2x = 0
     row.spin2y = 0
     row.spin2z = 0
     row.alpha1 = self.theta
     row.alpha2 = self.phi
     row.alpha3 = self.iota
     row.alpha4 = self.psi
     row.alpha5 = self.orb_phase
     row.sigmasq = self.sigmasq
     if self.bank.flow_column:
         setattr(row, self.bank.flow_column, self.flow)
     return row
Ejemplo n.º 2
0
 def to_sngl(self):
     # All numerical values are initiated as 0 and all strings as ''
     row = SnglInspiralTable()
     row.mass1 = self.m1
     row.mass2 = self.m2
     row.mtotal = self.m1 + self.m2
     row.mchirp = self._mchirp
     row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
     row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.flow)
     row.template_duration = self.dur
     row.spin1x = self.spin1x
     row.spin1y = self.spin1y
     row.spin1z = self.spin1z
     row.spin2x = 0
     row.spin2y = 0
     row.spin2z = 0
     row.alpha1 = self.theta
     row.alpha2 = self.phi
     row.alpha3 = self.iota
     row.alpha4 = self.psi
     row.alpha5 = self.orb_phase
     row.sigmasq = self.sigmasq
     if self.bank.flow_column:
         setattr(row, self.bank.flow_column, self.flow)
     return row
Ejemplo n.º 3
0
    def to_sngl(self):
        # note that we use the C version; this causes all numerical values to be initiated
        # as 0 and all strings to be '', which is nice
        row = SnglInspiralTable()
        row.mass1 = self.m1
        row.mass2 = self.m2
        row.mtotal = self.m1 + self.m2
        row.mchirp = self._mchirp
        row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
        row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.bank.flow)
        row.f_final = self._f_final
        row.template_duration = self._dur
        row.sigmasq = self.sigmasq

        return row
Ejemplo n.º 4
0
    def to_sngl(self):
        # All numerical values are initiated as 0 and all strings as ''
        row = SnglInspiralTable()

        row.mass1 = self.m1
        row.mass2 = self.m2
        row.mtotal = self.m1 + self.m2
        row.mchirp = self._mchirp
        row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
        row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.bank.flow)
        row.f_final = self.f_final
        row.template_duration = self._dur
        row.spin1z = self.spin1z
        row.spin2z = self.spin2z
        row.sigmasq = self.sigmasq

        return row
Ejemplo n.º 5
0
    def to_sngl(self):
        # All numerical values are initiated as 0 and all strings as ''
        row = SnglInspiralTable()

        row.mass1 = self.m1
        row.mass2 = self.m2
        row.mtotal = self.m1 + self.m2
        row.mchirp = self._mchirp
        row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
        row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.bank.flow)
        row.f_final = self.f_final
        row.template_duration = self._dur
        row.spin1z = self.spin1z
        row.spin2z = self.spin2z
        row.sigmasq = self.sigmasq

        return row
Ejemplo n.º 6
0
    def to_sngl(self):
        # note that we use the C version; this causes all numerical
        # values to be initiated as 0 and all strings to be '', which
        # is nice
        row = SnglInspiralTable()

        row.mass1 = self.m1
        row.mass2 = self.m2
        row.mtotal = self.m1 + self.m2
        row.mchirp = self._mchirp
        row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
        row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.bank.flow)
        row.f_final = self.f_final
        row.template_duration = self._dur
        row.spin1z = self.spin1z
        row.spin2z = self.spin2z
        row.sigmasq = self.sigmasq

        return row
Ejemplo n.º 7
0
 def to_sngl(self):
     # note that we use the C version; this causes all numerical values to
     # be initiated as 0 and all strings to be '', which is nice
     row = SnglInspiralTable()
     row.mass1 = self.m1
     row.mass2 = self.m2
     row.mtotal = self.m1 + self.m2
     row.mchirp = self._mchirp
     row.eta = row.mass1 * row.mass2 / (row.mtotal * row.mtotal)
     row.tau0, row.tau3 = m1m2_to_tau0tau3(self.m1, self.m2, self.bank.flow)
     row.f_final = self.f_final
     row.template_duration = self._dur
     row.spin1x = self.spin1x
     row.spin1y = self.spin1y
     row.spin1z = self.spin1z
     row.spin2x = 0
     row.spin2y = 0
     row.spin2z = 0
     row.alpha1 = self.theta
     row.alpha2 = self.phi
     row.alpha3 = self.iota
     row.alpha4 = self.psi
     row.sigmasq = self.sigmasq
     return row
Ejemplo n.º 8
0
    # get other useful quantities
    pid = find_process_id(h5file["/process"], u"lalapps_cbc_sbank_sim")
    flow = float(find_process_param(pparams, pid, u"--flow"))

# derived quantities
# NB: Named fields in dtypes (see ligolw_table_to_array in lalapps_cbc_sbank_sim)
# allow dict-like access to columns: e.g. arr["mass1"].
min_match = match[int(floor(len(match) * 0.9))]
inj_M = inj_arr["mass1"] + inj_arr["mass2"]  #total mass
inj_eta = inj_arr["mass1"] * inj_arr["mass2"] / (inj_arr["mass1"] +
                                                 inj_arr["mass2"])**2
tmplt_M = tmplt_arr["mass1"] + tmplt_arr["mass2"]
tmplt_eta = tmplt_arr["mass1"] * tmplt_arr["mass2"] / (tmplt_arr["mass1"] +
                                                       tmplt_arr["mass2"])**2
inj_tau0, inj_tau3 = m1m2_to_tau0tau3(inj_arr["mass1"], inj_arr["mass2"], flow)
tmplt_tau0, tmplt_tau3 = m1m2_to_tau0tau3(tmplt_arr["mass1"],
                                          tmplt_arr["mass2"], flow)
tmplt_mchirp = compute_mchirp(tmplt_arr["mass1"], tmplt_arr["mass2"])
inj_mchirp = compute_mchirp(inj_arr["mass1"], inj_arr["mass2"])

#
# compute effective/reduced spin parameter for templates
#
if tmplt_approx == "TaylorF2RedSpin":
    tmplt_chi_label = "\chi_\mathrm{red}"
    tmplt_chi = [
        SimInspiralTaylorF2ReducedSpinComputeChi(float(row["mass1"]),
                                                 float(row["mass2"]),
                                                 float(row["spin1z"]),
                                                 float(row["spin2z"]))
    inj_approx = find_process_param(pparams, pid, u"--injection-approx"),
    tmplt_approx = find_process_param(pparams, pid, u"--template-approx")

    # get other useful quantities
    pid = find_process_id(h5file["/process"], u"lalapps_cbc_sbank_sim")
    flow = float(find_process_param(pparams, pid, u"--flow"))

# derived quantities
# NB: Named fields in dtypes (see ligolw_table_to_array in lalapps_cbc_sbank_sim)
# allow dict-like access to columns: e.g. arr["mass1"].
min_match = match[int(floor(len(match)*0.9))]
inj_M = inj_arr["mass1"] + inj_arr["mass2"] #total mass
inj_eta = inj_arr["mass1"] * inj_arr["mass2"] / (inj_arr["mass1"] + inj_arr["mass2"])**2
tmplt_M = tmplt_arr["mass1"] + tmplt_arr["mass2"]
tmplt_eta = tmplt_arr["mass1"] * tmplt_arr["mass2"] / (tmplt_arr["mass1"] + tmplt_arr["mass2"])**2
inj_tau0, inj_tau3 = m1m2_to_tau0tau3(inj_arr["mass1"], inj_arr["mass2"], flow)
tmplt_tau0, tmplt_tau3 = m1m2_to_tau0tau3(tmplt_arr["mass1"], tmplt_arr["mass2"], flow)
tmplt_mchirp = compute_mchirp(tmplt_arr["mass1"], tmplt_arr["mass2"])
inj_mchirp = compute_mchirp(inj_arr["mass1"], inj_arr["mass2"])

#
# compute effective/reduced spin parameter for templates
#
if tmplt_approx == "TaylorF2RedSpin":
    tmplt_chi_label = "\chi_\mathrm{red}"
    tmplt_chi = [SimInspiralTaylorF2ReducedSpinComputeChi(float(row["mass1"]), float(row["mass2"]), float(row["spin1z"]), float(row["spin2z"])) for row in tmplt_arr]
else: # default to effective spin
    tmplt_chi_label = "\chi_\mathrm{eff}"
    tmplt_chi = [SimIMRPhenomBComputeChi(float(row["mass1"]), float(row["mass2"]), float(row["spin1z"]), float(row["spin2z"])) for row in tmplt_arr]

# FIXME hack