How to use the exoplanet.distributions.QuadLimbDark function in exoplanet

To help you get started, we’ve selected a few exoplanet 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 rodluger / starry / exoplanet_doppler.py View on Github external
plt.show()

# Sample it
sampler = xo.PyMC3Sampler(window=100, finish=200)

starry_op = starry.ops.DopplerMapOp(udeg=udeg)

with pm.Model() as model:

    inc = pm.Uniform("inc", 0, 180)
    obl = pm.Uniform("obl", -180, 180)
    alpha = pm.Uniform("alpha", 0, 1)
    veq = pm.Uniform("veq", 0, 10)
    period = pm.Uniform("period", 1.0, 100.0)
    t0 = pm.Uniform("t0", -1, 1)
    u = xo.distributions.QuadLimbDark("u", testval=np.array([0.3, 0.2]))
    r = pm.Uniform("r", 0.01, 0.25)
    b = pm.Uniform("b", 0, 1.25)

    # We're not fitting for theta
    # @dfm: How do I prevent pymc3 from fitting for it?
    theta = np.ones_like(t)  # np.ones_like(t) * pm.Uniform("theta", 0, 1)
    
    # The map Ylm degree is zero, so there are no Ylms to fit
    y = np.empty(0)
    # y = tt.as_tensor_variable([], name='y')
    # y.name = 'y'

    # Vectorize the occultor radius
    rs = np.ones_like(t) * r
    rs.name = 'r'
github dfm / exoplanet / exoplanet / distributions.py View on Github external
def __init__(self, *args, **kwargs):
        add_citations_to_model(self.__citations__, kwargs.get("model", None))

        # Make sure that the shape is compatible
        shape = kwargs.get("shape", 2)
        try:
            if list(shape)[0] != 2:
                raise ValueError("the first dimension should be exactly 2")
        except TypeError:
            if shape != 2:
                raise ValueError("the first dimension should be exactly 2")

        kwargs["shape"] = shape
        kwargs["transform"] = tr.quad_limb_dark

        super(QuadLimbDark, self).__init__(*args, **kwargs)

        # Work out some reasonable starting values for the parameters
        default = np.zeros(shape)
        default[0] = np.sqrt(0.5)
        default[1] = 0.0
        self._default = default