def __init__(self): super(Spindown, self).__init__() self.add_param( floatParameter( name="F0", value=0.0, units="Hz", description="Spin-frequency", long_double=True, )) self.add_param( prefixParameter( name="F1", value=0.0, units="Hz/s^1", description="Spindown-rate", unit_template=self.F_unit, description_template=self.F_description, type_match="float", long_double=True, )) self.add_param( MJDParameter( name="PEPOCH", description="Reference epoch for spin-down", time_scale="tdb", )) self.phase_funcs_component += [self.spindown_phase] self.phase_derivs_wrt_delay += [self.d_spindown_phase_d_delay]
def __init__(self): super(Wave, self).__init__() self.add_param( floatParameter( name="WAVE_OM", description="Base frequency of wave solution", units="1/d", ) ) self.add_param( prefixParameter( name="WAVE1", units="s", description="Wave components", type_match="pair", long_double=True, parameter_type="pair", ) ) self.add_param( MJDParameter( name="WAVEEPOCH", description="Reference epoch for wave solution", time_scale="tdb", ) ) self.phase_funcs_component += [self.wave_phase]
def __init__(self): super(DispersionDM, self).__init__() self.add_param( floatParameter( name="DM", units="pc cm^-3", value=0.0, description="Dispersion measure", long_double=True, )) self.add_param( prefixParameter( name="DM1", value=0.0, units="pc cm^-3/yr^1", description= "First order time derivative of the dispersion measure", unit_template=self.DM_dervative_unit, description_template=self.DM_dervative_description, type_match="float", long_double=True, )) self.add_param( MJDParameter(name="DMEPOCH", description="Epoch of DM measurement", time_scale="tdb")) self.dm_value_funcs += [self.base_dm] self.delay_funcs_component += [self.constant_dispersion_delay]
def test_START_FINISH_in_par(self): """ Check that START/FINISH parameters set up/operate properly when from input file. """ m1 = self.m t1 = get_TOAs("B1855+09_NANOGrav_dfg+12.tim") start_preval = 53358.726464889485214 finish_preval = 55108.922917417192366 start_postval = 53358.7274648895 # from Tempo2 finish_postval = 55108.9219174172 # from Tempo2 # check parameter initialization assert hasattr(m1, "START") assert type(m1.START) == type(MJDParameter()) assert hasattr(m1, "FINISH") assert type(m1.FINISH) == type(MJDParameter()) self.assertEqual(m1.START.value, start_preval) self.assertEqual(m1.FINISH.value, finish_preval) self.assertEqual(m1.START.frozen, True) self.assertEqual(m1.FINISH.frozen, True) # fit toas and compare with expected/Tempo2 (for WLS) values fitters = [ pint.fitter.PowellFitter(toas=t1, model=m1), pint.fitter.WLSFitter(toas=t1, model=m1), pint.fitter.GLSFitter(toas=t1, model=m1), ] for fitter in fitters: fitter.fit_toas() self.assertEqual(m1.START.frozen, True) self.assertEqual(m1.FINISH.frozen, True) if fitter.method == "weighted_least_square": self.assertAlmostEqual( fitter.model.START.value, start_postval, places=9 ) self.assertAlmostEqual( fitter.model.FINISH.value, finish_postval, places=9 ) self.assertAlmostEqual( fitter.model.START.value, fitter.toas.first_MJD.value, places=9 ) self.assertAlmostEqual( fitter.model.FINISH.value, fitter.toas.last_MJD.value, places=9 )
def __init__(self): super(Astrometry, self).__init__() self.add_param( MJDParameter(name="POSEPOCH", description="Reference epoch for position") ) self.add_param( floatParameter(name="PX", units="mas", value=0.0, description="Parallax") ) self.delay_funcs_component += [self.solar_system_geometric_delay] self.register_deriv_funcs(self.d_delay_astrometry_d_PX, "PX")
def __init__(self): super().__init__() self.binary_model_name = "ELL1" self.binary_model_class = ELL1model self.add_param( MJDParameter(name="TASC", description="Epoch of ascending node", time_scale="tdb")) self.add_param( floatParameter( name="EPS1", units="", description= "First Laplace-Lagrange parameter, ECC x sin(OM) for ELL1 model", long_double=True, )) self.add_param( floatParameter( name="EPS2", units="", description= "Second Laplace-Lagrange parameter, ECC x cos(OM) for ELL1 model", long_double=True, )) self.add_param( floatParameter( name="EPS1DOT", units="1e-12/s", description= "First derivative of first Laplace-Lagrange parameter", long_double=True, )) self.add_param( floatParameter( name="EPS2DOT", units="1e-12/s", description= "Second derivative of first Laplace-Lagrange parameter", long_double=True, )) self.remove_param("ECC") self.remove_param("OM") self.remove_param("T0") self.warn_default_params = []
def __init__(self): super(AbsPhase, self).__init__() self.add_param( MJDParameter(name="TZRMJD", description="Epoch of the zero phase.")) self.add_param( strParameter( name="TZRSITE", description="Observatory of the zero phase measured.")) self.add_param( floatParameter( name="TZRFRQ", units=u.MHz, description="The frequency of the zero phase mearsured.", ))
def __init__(self,): super(PulsarBinary, self).__init__() self.binary_model_name = None self.barycentric_time = None self.binary_model_class = None self.add_param( floatParameter( name="PB", units=u.day, description="Orbital period", long_double=True ) ) self.add_param( floatParameter( name="PBDOT", units=u.day / u.day, description="Orbital period derivitve respect to time", unit_scale=True, scale_factor=1e-12, scale_threshold=1e-7, ) ) self.add_param( floatParameter( name="A1", units=ls, description="Projected semi-major axis, a*sin(i)" ) ) # NOTE: the DOT here takes the value and times 1e-12, tempo/tempo2 can # take both. self.add_param( floatParameter( name="A1DOT", aliases=["XDOT"], units=ls / u.s, description="Derivative of projected semi-major axis, da*sin(i)/dt", unit_scale=True, scale_factor=1e-12, scale_threshold=1e-7, ) ) self.add_param( floatParameter( name="ECC", units="", aliases=["E"], description="Eccentricity" ) ) self.add_param( floatParameter( name="EDOT", units="1/s", description="Eccentricity derivitve respect to time", unit_scale=True, scale_factor=1e-12, scale_threshold=1e-7, ) ) self.add_param( MJDParameter( name="T0", description="Epoch of periastron passage", time_scale="tdb" ) ) self.add_param( floatParameter( name="OM", units=u.deg, description="Longitude of periastron", long_double=True, ) ) self.add_param( floatParameter( name="OMDOT", units="deg/year", description="Longitude of periastron", long_double=True, ) ) self.add_param( floatParameter( name="M2", units=u.M_sun, description="Mass of companian in the unit Sun mass", ) ) self.add_param( floatParameter( name="SINI", units="", description="Sine of inclination angle" ) ) self.add_param( prefixParameter( name="FB0", value=None, units="1/s^1", description="0th time derivative of frequency of orbit", unit_template=self.FBX_unit, aliases=["FB"], description_template=self.FBX_description, type_match="float", long_double=True, ) ) self.interal_params = [] self.warn_default_params = ["ECC", "OM"] # Set up delay function self.delay_funcs_component += [self.binarymodel_delay]