def fromPostSamp(self, burn=None, skipHeader=12):
'''
This method uses lalinference samples. If not burn value is given then the
entire posterior sample is used. If the burn option is supplied then the
initial part of the chain (upto iteration number = burn) is ignored.
Output is a list whose first two elements are the probability that the primary
and secondary object is a NS respectively. The third element gives the remnant
mass outside the black hole in access of the threshold mass supplied.
'''
data = np.recfromtxt(self.inputFile, names=True, skip_header=skipHeader)
burnin = 0
if burn: burnin = burn
mc = data['mc'][burnin:]
massRatio = data['q'][burnin:]
self.chi = data['a1'][burnin:]
self.eta = massRatio/((1 + massRatio)**2)
self.mPrimary = (massRatio**(-0.6)) * mc * (1. + massRatio)**0.2
self.mSecondary = (massRatio**0.4) * mc * (1. + massRatio)**0.2
NS_prob_2 = np.sum(self.mSecondary < self.max_ns_g_mass)*100./len(self.mSecondary) # RE: Max NS mass was hardcoded as 3.0. Should be gotten from class variable
NS_prob_1 = np.sum(self.mPrimary < self.max_ns_g_mass)*100./len(self.mPrimary)
return [NS_prob_1, NS_prob_2, self.computeRemMass()]
评论列表
文章目录