pint.models.stand_alone_psr_binaries package¶
This module contains implementations of independent pulsar timing binary models.
Submodules¶
pint.models.stand_alone_psr_binaries.BT_model module¶
-
class
pint.models.stand_alone_psr_binaries.BT_model.BTmodel(t=None, input_params=None)[source]¶ Bases:
pint.models.stand_alone_psr_binaries.binary_generic.PSR_BINARYThis is a class independent from PINT platform for pulsar BT binary model. It is a subclass of PSR_BINARY class defined in file binary_generic.py in the same dierectory. This class is desined for PINT platform but can be used as an independent module for binary delay calculation. To interact with PINT platform, a pulsar_binary wrapper is needed. See the source file pint/models/binary_bt.py Refence ——— The ‘BT’ binary model for the pulse period. Model as in: W.M. Smart, (1962), “Spherical Astronomy”, p35 Blandford & Teukolsky (1976), ApJ, 205, 580-591
A bt binary model class with paramters, delay calculations and derivatives. Example ———- >>> import numpy >>> t = numpy.linspace(54200.0,55000.0,800) >>> binary_model = BTmodel() >>> paramters_dict = {‘A0’:0.5,’ECC’:0.01} >>> binary_model.update_input(t, paramters_dict) Here the binary has time input and parameters input, the delay can be calculated.
@param PB: Binary period [days] @param ECC: Eccentricity @param A1: Projected semi-major axis (lt-sec) @param A1DOT: Time-derivative of A1 (lt-sec/sec) @param T0: Time of ascending node (TASC) @param OM: Omega (longitude of periastron) [deg] @param EDOT: Time-derivative of ECC [0.0] @param PBDOT: Time-derivative of PB [0.0] @param OMDOT: Time-derivative of OMEGA [0.0]
-
delayL1(*args, **kwargs)[source]¶ First term of Blandford & Teukolsky (1976), ApJ, 205, 580-591, eq 2.33/ First left-hand term of W.M. Smart, (1962), “Spherical Astronomy”, p35 delay equation.
alpha * (cosE-e) alpha = a1*sin(omega) Here a1 is in the unit of light second as distance
-
delayL2(*args, **kwargs)[source]¶ Second term of Blandford & Teukolsky (1976), ApJ, 205, 580-591, eq 2.33/ / Second left-hand term of W.M. Smart, (1962), “Spherical Astronomy”, p35 delay equation.
(beta + gamma) * sinE beta = (1-e^2)*a1*cos(omega) Here a1 is in the unit of light second as distance
-
delayR(*args, **kwargs)[source]¶ Third term of Blandford & Teukolsky (1976), ApJ, 205, 580-591, eq 2.33 / Right-hand term of W.M. Smart, (1962), “Spherical Astronomy”, p35 delay equation.
(alpha*(cosE-e)+(beta+gamma)*sinE)*(1-alpha*sinE - beta*sinE)/ (pb*(1-e*coeE)) (alpha*(cosE-e)+(beta+gamma)*sinE) is define in delayL1 and delayL2
-
pint.models.stand_alone_psr_binaries.DD_model module¶
-
class
pint.models.stand_alone_psr_binaries.DD_model.DDmodel(t=None, input_params=None)[source]¶ Bases:
pint.models.stand_alone_psr_binaries.binary_generic.PSR_BINARYThis is a class independent from PINT platform for pulsar DD binary model. Refence: T. Damour and N. Deruelle(1986) It is a subclass of PSR_BINARY class defined in file binary_generic.py in the same dierectory. This class is desined for PINT platform but can be used as an independent module for binary delay calculation. To interact with PINT platform, a pulsar_binary wrapper is needed. See the source file pint/models/pulsar_binary_dd.py
A dd binary model class with paramters, delay calculations and derivatives. Example ———- >>> import numpy >>> t = numpy.linspace(54200.0,55000.0,800) >>> binary_model = DDmodel() >>> paramters_dict = {‘A0’:0.5,’ECC’:0.01} >>> binary_model.update_input(t, paramters_dict) Here the binary has time input and parameters input, the delay can be calculated.
-
Dre(*args, **kwargs)[source]¶ Dre defined in T. Damour and N. Deruelle(1986)equation [48] Dre = alpha*(cos(E)-er)+(beta+gamma)*sin(E)
-
Drep(*args, **kwargs)[source]¶ Dervitive of Dre respect to E T. Damour and N. Deruelle(1986)equation [49] Drep = -alpha*sin(E)+(beta+gamma)*cos(E)
-
Drepp(*args, **kwargs)[source]¶ Dervitive of Drep respect to E T. Damour and N. Deruelle(1986)equation [50] Drepp = -alpha*cos(E)-(beta+GAMMA)*sin(E)
-
alpha(*args, **kwargs)[source]¶ Alpha defined in T. Damour and N. Deruelle(1986)equation [46] alpha = A1/c*sin(omega)
-
beta(*args, **kwargs)[source]¶ Beta defined in T. Damour and N. Deruelle(1986)equation [47] beta = A1/c*(1-eTheta**2)**0.5*cos(omega)
-
d_Dre_d_par(*args, **kwargs)[source]¶ Dre = alpha*(cos(E)-er)+(beta+gamma)*sin(E) dDre = alpha*(-der-dE*sin(E)) + (cos[E]-er)*dalpha +
(dBeta+dGamma)*sin(E) + (beta+gamma)*cos(E)*dE- dDre/dpar = alpha*(-der/dpar-dE/dpar*sin(E)) +
- (cos[E]-er)*dalpha/dpar + (dBeta/dpar+dGamma/dpar)*sin(E) + (beta+gamma)*cos(E)*dE/dpar
er = e + Dr
-
d_Drep_d_par(*args, **kwargs)[source]¶ Drep = -alpha*sin(E)+(beta+gamma)*cos(E) dDrep = -alpha*cos(E)*dE + cos(E)*(dbeta+dgamma)
-(beta+gamma)*dE*sin(E)-dalpha*sin(E)- dDrep/dPar = -sin(E)*dalpha/dPar
- -(alpha*cos(E)+(beta+gamma)*sin(E))*dE/dPar + cos(E)(dbeta/dPar+dgamma/dPar)
-
d_Drepp_d_par(*args, **kwargs)[source]¶ Drepp = -alpha*cos(E)-(beta+GAMMA)*sin(E) dDrepp = -(beta+gamma)*cos(E)*dE - cos(E)*dalpha
+alpha*sin(E)*dE - (dbeta+dgamma)*sin(E)- dDrepp/dPar = -cos(E)*dalpha/dPar
- +(alpha*sin(E)-(beta+gamma)*cos(E))*dE/dPar -(dbeta/dPar+dgamma/dPar)*sin(E)
-
d_alpha_d_par(*args, **kwargs)[source]¶ T. Damour and N. Deruelle(1986)equation [46] alpha = a1/c*sin(omega)
dAlpha/dA1 = 1.0/c*sin(omega)
dAlpha/dPar = a1/c*cos(omega)*dOmega/dPar
-
d_beta_d_ECC(*args, **kwargs)[source]¶ - dBeta/dECC = A1/c*((-(e+dtheta)/sqrt(1-(e+dtheta)**2)*cos(omega)*de/dECC-
- (1-eTheta**2)**0.5*sin(omega)*domega/dECC
de/dECC = 1
-
d_beta_d_EDOT(*args, **kwargs)[source]¶ dBeta/dEDOT = A1/c*((-(e+dtheta)/sqrt(1-(e+dtheta)**2)*cos(omega)*de/dEDOT- (1-eTheta**2)**0.5*sin(omega)*domega/dEDOT de/dEDOT = tt0
-
d_beta_d_par(*args, **kwargs)[source]¶ beta = A1/c*(1-eTheta**2)**0.5*cos(omega) eTheta = ecc+Dth ?? dBeta/dA1 = 1.0/c*(1-eTheta**2)**0.5*cos(omega) dBeta/dECC = A1/c*((-(e+dr)/sqrt(1-(e+dr)**2)*cos(omega)*de/dECC-
(1-eTheta**2)**0.5*sin(omega)*domega/dECC- dBeta/dEDOT = A1/c*((-(e+dr)/sqrt(1-(e+dr)**2)*cos(omega)*de/dEDOT-
- (1-eTheta**2)**0.5*sin(omega)*domega/dEDOT
dBeta/dDth = A1/c*(-(e+dr)/sqrt(1-(e+dr)**2)*cos(omega) Other parameters dBeta/dPar = -A1/c*(1-eTheta**2)**0.5*sin(omega)*dOmega/dPar
-
d_delayA_d_par(*args, **kwargs)[source]¶ aDelay = A0*(sin(omega+E)+e*sin(omega))+B0*(cos(omega+E)+e*cos(omega)) daDelay/dpar = daDelay/dA0*dA0/dPar+ (1)
daDelay/dB0*dB0/dPar+ (2) daDelay/domega*domega/dPar+ (3) daDelay/dnu*dnu/dPar+ (4) daDelay/decc*decc/dPar (5)
-
d_delayE_d_par(*args, **kwargs)[source]¶ eDelay = gamma*sin[E] deDelay_dPar = deDelay/dgamma*dgamma/dPar +
deDelay/dE*dE/dPar
-
d_delayS_d_par(*args, **kwargs)[source]¶ dsDelay/dPar = dsDelay/dTM2*dTM2/dPar+ dsDelay/decc*decc/dPar+ dsDelay/dE*dE/dPar+ dsDelay/domega*domega/dPar+ dsDelay/dSINI*dSINI/dPar
-
d_nhat_d_par(*args, **kwargs)[source]¶ nhat = n/(1-ecc*cos(E)) n = 2*pi/PB # should here be M()? dnhat = -2*pi*dPB/PB^2*(1-ecc*cos(E))
-2*pi*(-cos(E)*decc+ecc*sin(E)*dE)/PB*(1-ecc*cos(E))^2- dnhat/dPar = -2*pi/(PB*(1-ecc*cos(E))*((dPB/dPar)/PB -
- (-cos(E)*decc/dPar+ecc*sin(E)*dE/dpar)/(1-e*cos(E)))
-
d_omega_d_OMDOT(*args, **kwargs)[source]¶ dOmega/dOMDOT = 1/n*nu n = 2*pi/PB dOmega/dOMDOT = PB/2*pi*nu
-
d_omega_d_par(*args, **kwargs)[source]¶ derivative for omega respect to user input Parameter. if par is not ‘OM’,’OMDOT’,’PB’ dOmega/dPar = k*dAe/dPar k = OMDOT/n Parameters ———- par : string
parameter nameDerivitve of omega respect to par
-
delayA(*args, **kwargs)[source]¶ Binary Abberation delay T. Damour and N. Deruelle(1986)equation [27]
-
delayInverse(*args, **kwargs)[source]¶ DD model Inverse timing delay. T. Damour and N. Deruelle(1986)equation [46-52] This part is convert the delay argument from proper time to coordinate time. The Romoer delay and Einstein are included in the calculation. It uses there iterations to approximate the Roemer delay and Einstein delay. T. Damour and N. Deruelle(1986)equation [43]. The equation [52] gives a taylor expension of equation [43]. u - e*sin(u) = n(t-T0) nhat = du/dt nhatp = d^2u/dt^2 Drep = dDre/du Drepp = d^2Dre/du^2 Dre(t-Dre(t-Dre(t))) = Dre(u) - Drep(u)*nhat*Dre(t-Dre(t))
- = Dre(u) - Drep(u)*nhat*(Dre(u)-Drep(u)*nhat*Dre(t))
- 1/2 (Drepp(u)*nhat^2 + Drep(u) * nhat * nhatp) * (Dre(t)-...)^2
- = Dre(t)*(1 - nhat * Drep(u) + (nhat*Drep)^2 +
- 1/2*nhat^2* Dre*Drepp - 1/2*e*sin(u)/(1-e*cos(u)*nhat^2*Drep*Drep))
Here u is equivalent to E in the function.
-
pint.models.stand_alone_psr_binaries.ELL1_model module¶
-
class
pint.models.stand_alone_psr_binaries.ELL1_model.ELL1model[source]¶ Bases:
pint.models.stand_alone_psr_binaries.binary_generic.PSR_BINARYThis is a class for ELL1 pulsar binary model. ELL1 model is BT model in the small eccentricity case.
-
a1(*args, **kwargs)[source]¶ ELL1 model a1 calculation. This method overrides the a1() method in pulsar_binary.py. Instead of tt0, it uses ttasc.
-
d_Dre_d_par(par)[source]¶ Dre = delayR = a1/c.c*(sin(phi) - 0.5* eps1*cos(2*phi) + 0.5* eps2*sin(2*phi)) d_Dre_d_par = d_a1_d_par /c.c*(sin(phi) - 0.5* eps1*cos(2*phi) + 0.5* eps2*sin(2*phi)) +
d_Dre_d_Phi * d_Phi_d_par + d_Dre_d_eps1*d_eps1_d_par + d_Dre_d_eps2*d_eps2_d_par
-
d_Drep_d_par(par)[source]¶ Drep = d_Dre_d_Phi = a1/c.c*(cos(Phi) + eps1 * sin(Phi) + eps2 * cos(Phi)) d_Drep_d_par = d_a1_d_par /c.c*(cos(Phi) + eps1 * sin(Phi) + eps2 * cos(Phi)) +
d_Drep_d_Phi * d_Phi_d_par + d_Drep_d_eps1*d_eps1_d_par + d_Drep_d_eps2*d_eps2_d_par
-
d_Drepp_d_par(par)[source]¶ Drepp = d_Drep_d_Phi = a1/c.c*(-sin(Phi) + eps1 * cos(Phi) - eps2 * sin(Phi)) d_Drep_d_par = d_a1_d_par /c.c*(-sin(Phi) + eps1 * cos(Phi) - eps2 * sin(Phi)) +
d_Drepp_d_Phi * d_Phi_d_par + d_Drepp_d_eps1*d_eps1_d_par + d_Drepp_d_eps2*d_eps2_d_par
-
d_delayI_d_par(par)[source]¶ delayI = Dre*(1 - nhat*Drep + (nhat*Drep)**2 + 1.0/2*nhat**2*Dre*Drepp) d_delayI_d_par = d_delayI_d_Dre * d_Dre_d_par + d_delayI_d_Drep * d_Drep_d_par +
d_delayI_d_Drepp * d_Drepp_d_par + d_delayI_d_nhat * d_nhat_d_par
-
d_delayS_d_par(par)[source]¶ Derivative for bianry Shaprio delay. delayS = -2 * TM2 * np.log(1 - self.SINI * np.sin(Phi)) d_delayS_d_par = d_delayS_d_TM2 * d_TM2_d_par + d_delayS_d_SINI*d_SINI_d_par +
d_delayS_d_Phi * d_Phi_d_par
-
delayI()[source]¶ Inverse time delay formular. The treatment is similar to the one in DD model(T. Damour and N. Deruelle(1986)equation [46-52]) Dre = a1*(sin(Phi)+eps1/2*sin(Phi)+eps1/2*cos(Phi)) Drep = dDre/dt Drep = d^2 Dre/dt^2 nhat = dPhi/dt = 2pi/pb nhatp = d^2Phi/dt^2 = 0 Dre(t-Dre(t-Dre(t))) = Dre(Phi) - Drep(Phi)*nhat*Dre(t-Dre(t))
- = Dre(Phi) - Drep(Phi)*nhat*(Dre(Phi)-Drep(Phi)*nhat*Dre(t))
- 1/2 (Drepp(u)*nhat^2 + Drep(u) * nhat * nhatp) * (Dre(t)-...)^2
- = Dre(Phi)(1 - nhat*Drep(Phi) + (nhat*Drep(Phi))^2
- 1/2*nhat^2* Dre*Drepp)
-
pint.models.stand_alone_psr_binaries.binary_generic module¶
-
class
pint.models.stand_alone_psr_binaries.binary_generic.PSR_BINARY[source]¶ Bases:
objectA base (generic) object for psr binary models. In this class, a set of generally used binary paramters and several commonly used calculations are defined. For each binary model, the specific parameters and calculations are defined in the subclass.
A binary model takes the solar system barycentric time (ssb time) as input. When a binary model is instantiated, the parameters are set to the default values and input time is not initialized. The update those values, method .updata_input() should be used.
>>> from pint.models.stand_alone_psr_binaries.pulsar_binary import PSR_BINARY >>> import numpy >>> class foo(PSR_BINARY): def __init__(self): # This is to initialize the mother class attributes. super(foo, self).__init__() self.binary_name = 'foo' # Add parameter that specific for my_binary, with default value and units self.param_default_value.update({'A0':0*u.second,'B0':0*u.second, 'DR':0*u.Unit(''),'DTH':0*u.Unit(''), 'GAMMA':0*u.second,}) self.set_param_values() # This is to set all the parameters to attributes self.binary_delay_funcs += [self.foo_delay] self.d_binarydelay_d_par_funcs += [self.d_foo_delay_d_par] # If you have intermedia value in the calculation self.dd_interVars = ['er','eTheta','beta','alpha','Dre','Drep','Drepp', 'nhat', 'TM2'] self.add_inter_vars(self.dd_interVars)
- def foo_delay(self):
- pass
- def d_foo_delay_d_par(self):
- pass
>>> # To build a model instance >>> binary_foo = foo() >>> # binary_foo class has the defualt parameter value without toa input. >>> # Update the toa input and parameters >>> t = numpy.linspace(54200.0,55000.0,800) >>> paramters_dict = {'A0':0.5,'ECC':0.01} >>> binary_foo.update_input(t, paramters_dict) >>> # Now the binary delay and derivatives can be computed.
To acess the binary model class from pint platform, a pint pulsar binary wrapper is needed. See docstrings in the source code of pint/models/pul sar_binary class PulsarBinary.
Included general parameters: @param PB: Binary period [days] @param ECC: Eccentricity @param A1: Projected semi-major axis (lt-sec) @param A1DOT: Time-derivative of A1 (lt-sec/sec) @param T0: Time of ascending node (TASC) @param OM: Omega (longitude of periastron) [deg] @param EDOT: Time-derivative of ECC [0.0] @param PBDOT: Time-derivative of PB [0.0] @param XPBDOT: Rate of change of orbital period minus GR prediction @param OMDOT: Time-derivative of OMEGA [0.0]
Intermedia variables calculation method are given here: Eccentric Anomaly E (not parameter ECC) Mean Anomaly M True Anomaly nu Eccentric ecc Longitude of periastron omega projected semi-major axis of orbit a1 TM2
Generic methon provided: binary_delay() Binary total delay d_binarydelay_d_par() Derivatives respect to one parameter prtl_der() partial derivatives respect to some variable
-
binary_delay()[source]¶ Returns total pulsar binary delay. Return ———- Pulsar binary delay in the units of second
-
compute_eccentric_anomaly(*args, **kwargs)[source]¶ compute eccentric anomaly, solve for Kepler Equation, E - e * sin(E) = M Parameter ———- eccentricity : array_like
Eccentricity of binary system- mean_anomaly : array_like
- Mean anomaly of the binary system
- array_like
- The eccentric anomaly in radians, given a set of mean_anomalies in radians.
-
d_E_d_PB(*args, **kwargs)[source]¶ d(E-e*sinE)/dPB = dM/dPB dE/dPB(1-cosE*e)-de/dPB*sinE = dM/dPB dE/dPB(1-cosE*e) = dM/dPB
-
d_E_d_T0(*args, **kwargs)[source]¶ d(E-e*sinE)/dT0 = dM/dT0 dE/dT0(1-cosE*e)-de/dT0*sinE = dM/dT0 dE/dT0(1-cosE*e)+eDot*sinE = dM/dT0
-
d_binarydelay_d_par(*args, **kwargs)[source]¶ Get the binary delay derivatives respect to parameters. Parameter ——— par : str
Parameter name.
-
d_nu_d_ECC(*args, **kwargs)[source]¶ dnu(e,E)/dECC = dnu/de*de/dECC+dnu/dE*dE/dECC de/dECC = 1 dnu/dPBDOT = dnu/dE*dE/dECC+dnu/de
-
d_nu_d_PB(*args, **kwargs)[source]¶ dnu(e,E)/dPB = dnu/de*de/dPB+dnu/dE*dE/dPB de/dPB = 0 dnu/dPB = dnu/dE*dE/dPB
-
d_nu_d_PBDOT(*args, **kwargs)[source]¶ dnu(e,E)/dPBDOT = dnu/de*de/dPBDOT+dnu/dE*dE/dPBDOT de/dPBDOT = 0 dnu/dPBDOT = dnu/dE*dE/dPBDOT
-
d_omega_d_par(*args, **kwargs)[source]¶ derivative for omega respect to user input Parameter. Parameters ———- par : string
parameter nameDerivitve of omega respect to par
-
prtl_der(*args, **kwargs)[source]¶ Find the partial derivatives in binary model pdy/pdx Parameters ——— y : str
Name of variable to be differentiated- x : str
- Name of variable the derivative respect to
pdy/pdx : The derivatives
-
set_param_values(valDict=None)[source]¶ A function that sets the parameters and assign values If the valDict is not provided, it will set parameter as default value
-
update_input(barycentric_toa=None, param_dict=None)[source]¶ A function updates the toas and parameters
-
T0¶
-
t¶
-
tt0¶