remove_lk_bias

peebee.utils.remove_lk_bias(psr_l, psr_b, flux, px, px_err, n_bins=500, plot=False)

Compute the Lutz-Kelker bias correction for a pulsar, according to the method from Verbiest, Lorimer, & McLaughlin (2010).

psr_l (float):

Galactic longitude (degrees)

psr_b (float):

Galactic latitude (degrees)

flux (float):

Integrated flux density (mJy, typically at 1.4 GHz)

px (float):

Measured parallax (mas)

px_err (float):

Measured parallax error (mas)

n_bins (int, optional):

Number of bins in the parallax grid. Default is 500. Higher values give more precise results but take longer to compute.

plot (bool, optional):

If True, generates plots of the priors and parallax distributions for visualization. Default is False.

Returns:

lk_correction (tuple) - Corrected parallax (mas), lower error (mas), upper error (mas)