enterprise_extensions.deterministic.cw_delay uses the p_dist keyword argument to take in pulsar distance parameters, which are necessary for correctly including the pulsar term in the model. Currently, the model is hard-coded to scale and shift the input pulsar distance parameters by the mean and uncertainty of the pulsar distance attribute within the enterprise Pulsar object.
This functionality makes sense if you want to use a generic parameter as input, e.g. a Gaussian prior with zero mean and unit variance, and then scale that prior distribution by the values in the Pulsar object. However, with more sophisticated priors such as those in QuickCW it might be easier for users to calibrate all the initial prior distributions with pulsar distance means and variances in a separate script instead of using the distances in the Pulsar object itself. In this case there is no need to scale and shift the input prior. However, this scaling and shifting is hard coded, so the input distance parameters might be unintentionally affected depending on what is in the Pulsar.
The current workaround to avoid incorrect pulsar distance priors is to assign zero-mean and unit-variance values to the pulsar distance attribute in the Pulsar object. While this works, this PR implements a simpler and more user-friendly solution, which is to include a toggle allow users to turn off the scaling-and-shifting behavior in the cw_delay. Specifically, setting scale_shift_pdists=False will just use the input pulsar distance priors without any additional changes, while scale_shift_pdists=True will keep the old behavior, and is kept as the default so this change is backwards compatible.
enterprise_extensions.deterministic.cw_delay
uses thep_dist
keyword argument to take in pulsar distance parameters, which are necessary for correctly including the pulsar term in the model. Currently, the model is hard-coded to scale and shift the input pulsar distance parameters by the mean and uncertainty of the pulsar distance attribute within the enterprisePulsar
object.This functionality makes sense if you want to use a generic parameter as input, e.g. a Gaussian prior with zero mean and unit variance, and then scale that prior distribution by the values in the
Pulsar
object. However, with more sophisticated priors such as those in QuickCW it might be easier for users to calibrate all the initial prior distributions with pulsar distance means and variances in a separate script instead of using the distances in thePulsar
object itself. In this case there is no need to scale and shift the input prior. However, this scaling and shifting is hard coded, so the input distance parameters might be unintentionally affected depending on what is in thePulsar
.The current workaround to avoid incorrect pulsar distance priors is to assign zero-mean and unit-variance values to the pulsar distance attribute in the
Pulsar
object. While this works, this PR implements a simpler and more user-friendly solution, which is to include a toggle allow users to turn off the scaling-and-shifting behavior in thecw_delay
. Specifically, settingscale_shift_pdists=False
will just use the input pulsar distance priors without any additional changes, whilescale_shift_pdists=True
will keep the old behavior, and is kept as the default so this change is backwards compatible.