def _compute_rating(self, cand): """Return a rating for the candidate. The rating value is the Chi-square of the DM=0 profile divided by the chi-square of the best-fit DM's profile. Input: cand: A Candidate object to rate. Output: value: The rating value. """ fvph = cand.freq_vs_phase pfd = cand.pfd prof_avg = np.sum(pfd.stats[:, :, 4][:pfd.npart]) prof_var = np.sum(pfd.stats[:, :, 5][:pfd.npart]) fvph.dedisperse(DM=0) prof_dm0 = fvph.get_profile() chisqr_dm0 = presto.chisqr(prof_dm0, pfd.proflen, prof_avg, prof_var) fvph.dedisperse(DM=cand.pfd.bestdm) prof_bestdm = fvph.get_profile() chisqr_bestdm = presto.chisqr(prof_bestdm, pfd.proflen, prof_avg, prof_var) return chisqr_dm0 / chisqr_bestdm
def _compute_rating(self, cand): """Return a rating for the candidate. The rating value is the Chi-square of the DM=0 profile divided by the chi-square of the best-fit DM's profile. Input: cand: A Candidate object to rate. Output: value: The rating value. """ fvph = cand.get_from_cache('freq_vs_phase') pfd = cand.get_from_cache('pfd') prof_avg = np.sum(pfd.stats[:,:,4][:pfd.npart]) prof_var = np.sum(pfd.stats[:,:,5][:pfd.npart]) fvph.dedisperse(DM=0) prof_dm0 = fvph.get_profile() chisqr_dm0 = presto.chisqr(prof_dm0, pfd.proflen, prof_avg, prof_var) fvph.dedisperse(DM=pfd.bestdm) prof_bestdm = fvph.get_profile() chisqr_bestdm = presto.chisqr(prof_bestdm, pfd.proflen, prof_avg, prof_var) return chisqr_dm0/chisqr_bestdm
def _compute_rating(self, cand): """Return a rating for the candidate. The rating value is the prepfold sigma value. Input: cand: A Candidate object to rate. Output: value: The rating value. """ tvph = cand.get_from_cache('time_vs_phase') prof = tvph.get_profile() pfd = cand.get_from_cache('pfd') prof_avg = np.sum(pfd.stats[:, :, 4][:pfd.npart]) prof_var = np.sum(pfd.stats[:, :, 5][:pfd.npart]) #chisqr = presto.chisqr(prof, pfd.proflen, prof_avg, prof_var) # Below is adapted for presto v2.1 chisqr = presto.chisqr(prof, prof_avg, prof_var) df = pfd.proflen - 1 redchisqr = chisqr / df off_redchisqr = pfd.estimate_offsignal_redchi2() rescaled_redchisqr = redchisqr / off_redchisqr #print "DEBUG: prof_avg, prof_var, chisqr/df", prof_avg, prof_var, chisqr/df prob = sp.stats.chi2.sf(rescaled_redchisqr * df, df) sig = -sp.stats.norm.ppf(prob) return sig
def _compute_rating(self, cand): """Return a rating for the candidate. The rating value is the prepfold sigma value. Input: cand: A Candidate object to rate. Output: value: The rating value. """ tvph = cand.get_from_cache('time_vs_phase') prof = tvph.get_profile() pfd = cand.get_from_cache('pfd') prof_avg = np.sum(pfd.stats[:,:,4][:pfd.npart]) prof_var = np.sum(pfd.stats[:,:,5][:pfd.npart]) chisqr = presto.chisqr(prof, pfd.proflen, prof_avg, prof_var) df = pfd.proflen - 1 redchisqr = chisqr/df off_redchisqr = pfd.estimate_offsignal_redchi2() rescaled_redchisqr = redchisqr / off_redchisqr #print "DEBUG: prof_avg, prof_var, chisqr/df", prof_avg, prof_var, chisqr/df prob = sp.stats.chi2.sf(rescaled_redchisqr*df, df) sig = -sp.stats.norm.ppf(prob) return sig
def _compute_rating(self, cand): """Return a rating for the candidate. The rating value is the prepfold sigma value. Input: cand: A Candidate object to rate. Output: value: The rating value. """ prof = cand.time_vs_phase.get_profile() pfd = cand.pfd prof_avg = np.sum(pfd.stats[:,:,4][:pfd.npart]) prof_var = np.sum(pfd.stats[:,:,5][:pfd.npart]) chisqr = presto.chisqr(prof, pfd.proflen, prof_avg, prof_var) df = pfd.proflen - 1 #print "DEBUG: prof_avg, prof_var, chisqr/df", prof_avg, prof_var, chisqr/df prob = sp.stats.chi2.sf(chisqr, df) sig = -sp.stats.norm.ppf(prob) return sig