How to use the pint.models.parameter.floatParameter function in Pint

To help you get started, we’ve selected a few Pint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nanograv / PINT / pint / models / pulsar_binary.py View on Github external
units=1e-12*u.day/u.day,
            description="Orbital period derivitve respect to time"),
            binary_param = True)

        self.add_param(p.floatParameter(name="A1",
            units=ls,
            description="Projected semi-major axis, a*sin(i)"),
            binary_param = True)
        # NOTE: the DOT here takes the value and times 1e-12, tempo/tempo2 can
        # take both.
        self.add_param(p.floatParameter(name = "A1DOT", aliases = ['XDOT'],
            units=1e-12*ls/u.s,
            description="Derivitve of projected semi-major axis, da*sin(i)/dt"),
            binary_param = True)

        self.add_param(p.floatParameter(name="ECC",
            units="",
            aliases = ["E"],
            description="Eccentricity"),
            binary_param = True)

        self.add_param(p.floatParameter(name="EDOT",
             units="1e-12/s",
             description="Eccentricity derivitve respect to time"),
             binary_param = True)

        self.add_param(p.MJDParameter(name="T0",
            description="Epoch of periastron passage", time_scale='tdb'),
            binary_param = True)

        self.add_param(p.floatParameter(name="OM",
            units=u.deg,
github nanograv / PINT / pint / models / solar_wind_dispersion.py View on Github external
def __init__(self):
        super(SolarWindDispersion, self).__init__()
        self.add_param(p.floatParameter(name="NE_SW",
                       units="cm^-3", value=0.0, aliases=['NE1AU', 'SOLARN0'],
                       description="Solar Wind Parameter"))
        self.add_param(p.floatParameter(name="SWM",
                       value=0.0, units="",
                       description="Solar Wind Model"))
        self.category = 'solar_wind'
        self.delay_funcs_component += [self.solar_wind_delay,]
        self.set_special_params(['NE_SW', 'SWM'])
github nanograv / PINT / pint / models / pulsar_binary.py View on Github external
self.add_param(p.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(p.floatParameter(name = "A1DOT", aliases = ['XDOT'],
            units=ls/u.s,
            description="Derivitve of projected semi-major axis, da*sin(i)/dt", \
            unit_scale=True, scale_factor=1e-12, scale_threshold=1e-7))

        self.add_param(p.floatParameter(name="ECC",
            units="",
            aliases = ["E"],
            description="Eccentricity"))

        self.add_param(p.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(p.MJDParameter(name="T0",
            description="Epoch of periastron passage", time_scale='tdb'))

        self.add_param(p.floatParameter(name="OM",
            units=u.deg,
            description="Longitude of periastron",long_double=True))

        self.add_param(p.floatParameter(name="OMDOT",
            units="deg/year",
            description="Longitude of periastron", long_double=True))

        self.add_param(p.floatParameter(name="M2",
github nanograv / PINT / src / pint / models / astrometry.py View on Github external
description="Declination (J2000)",
                aliases=["DEC"],
            )
        )

        self.add_param(
            floatParameter(
                name="PMRA",
                units="mas/year",
                value=0.0,
                description="Proper motion in RA",
            )
        )

        self.add_param(
            floatParameter(
                name="PMDEC",
                units="mas/year",
                value=0.0,
                description="Proper motion in DEC",
            )
        )
        self.set_special_params(["RAJ", "DECJ", "PMRA", "PMDEC"])
        for param in ["RAJ", "DECJ", "PMRA", "PMDEC"]:
            deriv_func_name = "d_delay_astrometry_d_" + param
            func = getattr(self, deriv_func_name)
            self.register_deriv_funcs(func, param)
github nanograv / PINT / pint / models / pulsar_binary.py View on Github external
self.add_param(p.floatParameter(name="ECC",
            units="",
            aliases = ["E"],
            description="Eccentricity"),
            binary_param = True)

        self.add_param(p.floatParameter(name="EDOT",
             units="1e-12/s",
             description="Eccentricity derivitve respect to time"),
             binary_param = True)

        self.add_param(p.MJDParameter(name="T0",
            description="Epoch of periastron passage", time_scale='tdb'),
            binary_param = True)

        self.add_param(p.floatParameter(name="OM",
            units=u.deg,
            description="Longitude of periastron",longdouble=True),
            binary_param = True)

        self.add_param(p.floatParameter(name="OMDOT",
            units="deg/year",
            description="Longitude of periastron", longdouble=True),
            binary_param = True)

        self.add_param(p.floatParameter(name="M2",
             units=u.M_sun,
             description="Mass of companian in the unit Sun mass"),
             binary_param = True)

        self.add_param(p.floatParameter(name="SINI", value=0.0,
             units="",
github nanograv / PINT / pint / models / dispersion_model.py View on Github external
def __init__(self):
        super(DispersionDM, self).__init__()
        self.add_param(p.floatParameter(name="DM", units="pc cm^-3", value=0.0,
                       description="Dispersion measure", long_double=True))
        self.add_param(p.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(p.MJDParameter(name="DMEPOCH",
                       description="Epoch of DM measurement"))

        self.dm_value_funcs += [self.base_dm,]
        self.category = 'dispersion_constant'
        self.delay_funcs_component += [self.constant_dispersion_delay,]
github nanograv / PINT / src / pint / models / ifunc.py View on Github external
def __init__(self):
        super(IFunc, self).__init__()

        self.add_param(
            floatParameter(name="SIFUNC", description="Type of interpolation", units="")
        )
        self.add_param(
            prefixParameter(
                name="IFUNC1",
                units="s",
                description="Interpolation Components (MJD+delay)",
                type_match="pair",
                long_double=True,
                parameter_type="pair",
            )
        )
        self.phase_funcs_component += [self.ifunc_phase]
github nanograv / PINT / src / pint / models / absolute_phase.py View on Github external
def __init__(self):
        super(AbsPhase, self).__init__()
        self.add_param(
            MJDParameter(
                name="TZRMJD", description="Epoch of the zero phase.", time_scale="utc"
            )
        )
        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.",
            )
github nanograv / PINT / src / pint / models / binary_bt.py View on Github external
def __init__(self):
        super(BinaryBT, self).__init__()
        self.binary_model_name = "BT"
        self.binary_model_class = BTmodel

        self.add_param(
            floatParameter(
                name="GAMMA",
                value=0.0,
                units="second",
                description="Time dilation & gravitational redshift",
            )
        )
        # remove unused parameter.
        self.remove_param("M2")
        self.remove_param("SINI")
github nanograv / PINT / pint / models / noise_model.py View on Github external
def __init__(self,):
        super(PLRedNoise, self).__init__()
        self.introduces_correlated_errors = True
        self.category = 'pl_red_noise'
        self.add_param(p.floatParameter(name='RNAMP', units="",\
                                       aliases=[],
                                       description="Amplitude of powerlaw "\
                                                "red noise."))
        self.add_param(p.floatParameter(name='RNIDX', units="",\
                                       aliases=[],
                                       description="Spectral index of "\
                                                "powerlaw red noise."))

        self.add_param(p.floatParameter(name='TNRedAmp', units="",\
                                       aliases=[],
                                       description="Amplitude of powerlaw "\
                                       "red noise in tempo2 format"))
        self.add_param(p.floatParameter(name='TNRedGam', units="",\
                                       aliases=[],
                                       description="Spectral index of powerlaw "\
                                       "red noise in tempo2 format"))
        self.add_param(p.floatParameter(name='TNRedC', units="",\
                                       aliases=[],
                                       description="Number of red noise frequencies."))


        self.covariance_matrix_funcs += [self.pl_rn_cov_matrix, ]
        self.basis_funcs += [self.pl_rn_basis_weight_pair, ]