How to use the starry._core.math.to_array_or_tensor function in starry

To help you get started, we’ve selected a few starry 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 / starry / kepler.py View on Github external
return self.ops.X(
            math.reshape(math.to_array_or_tensor(t), [-1]) * self._time_factor,
            self._primary._r,
            self._primary._m,
            self._primary._prot,
            self._primary._t0,
            self._primary._theta0,
            math.to_array_or_tensor(1.0),
            self._primary._map._inc,
            self._primary._map._obl,
            self._primary._map._u,
            self._primary._map._f,
            self._primary._map._alpha,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [math.to_array_or_tensor(1.0) for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
github rodluger / starry / starry / kepler.py View on Github external
sec.map._set_RV_filter()
        img_pri, img_sec, x, y, z = self.ops.render(
            math.reshape(math.to_array_or_tensor(t), [-1]) * self._time_factor,
            res,
            self._primary._r,
            self._primary._m,
            self._primary._prot,
            self._primary._t0,
            self._primary._theta0,
            self._primary._map._inc,
            self._primary._map._obl,
            self._primary._map._y,
            self._primary._map._u,
            self._primary._map._f,
            self._primary._map._alpha,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
github rodluger / starry / starry / kepler.py View on Github external
self._primary._map._obl,
            self._primary._map._u,
            self._primary._map._f,
            self._primary._map._alpha,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [math.to_array_or_tensor(1.0) for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._f for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
github rodluger / starry / starry / kepler.py View on Github external
math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._y for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._f for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._alpha for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._sigr for sec in self._secondaries]
            ),
        )

        # Convert to units of the primary radiu
        x, y, z = (
            x / self._primary._r,
            y / self._primary._r,
            z / self._primary._r,
        )
        r = math.to_array_or_tensor([sec._r for sec in self._secondaries])
        r = r / self._primary._r
github rodluger / starry / starry / kepler.py View on Github external
rv = self.ops.rv(
            math.reshape(math.to_array_or_tensor(t), [-1]) * self._time_factor,
            self._primary._r,
            self._primary._m,
            self._primary._prot,
            self._primary._t0,
            self._primary._theta0,
            self._primary._map._amp,
            self._primary._map._inc,
            self._primary._map._obl,
            self._primary._map._y,
            self._primary._map._u,
            self._primary._map._alpha,
            self._primary._map._veq,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._map._amp for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
github rodluger / starry / starry / kepler.py View on Github external
self._primary._map._y,
            self._primary._map._u,
            self._primary._map._f,
            self._primary._map._alpha,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._y for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._f for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
github rodluger / starry / starry / kepler.py View on Github external
self._primary._theta0,
            self._primary._map._inc,
            self._primary._map._obl,
            self._primary._map._y,
            self._primary._map._u,
            self._primary._map._f,
            self._primary._map._alpha,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._y for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
github rodluger / starry / starry / kepler.py View on Github external
),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [math.to_array_or_tensor(1.0) for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._f for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._alpha for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._sigr for sec in self._secondaries]
            ),
github rodluger / starry / starry / kepler.py View on Github external
self._primary._map._inc,
            self._primary._map._obl,
            self._primary._map._y,
            self._primary._map._u,
            self._primary._map._alpha,
            self._primary._map._veq,
            math.to_array_or_tensor([sec._r for sec in self._secondaries]),
            math.to_array_or_tensor([sec._m for sec in self._secondaries]),
            math.to_array_or_tensor([sec._prot for sec in self._secondaries]),
            math.to_array_or_tensor([sec._t0 for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._theta0 for sec in self._secondaries]
            ),
            self._get_periods(),
            math.to_array_or_tensor([sec._ecc for sec in self._secondaries]),
            math.to_array_or_tensor([sec._w for sec in self._secondaries]),
            math.to_array_or_tensor([sec._Omega for sec in self._secondaries]),
            math.to_array_or_tensor([sec._inc for sec in self._secondaries]),
            math.to_array_or_tensor(
                [sec._map._amp for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._inc for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._obl for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._y for sec in self._secondaries]
            ),
            math.to_array_or_tensor(
                [sec._map._u for sec in self._secondaries]