How to use the exoplanet.theano_ops.starry.base_op.StarryBaseOp 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 dfm / exoplanet / exoplanet / theano_ops / starry / limbdark_rev.py View on Github external
# -*- coding: utf-8 -*-

from __future__ import division, print_function

__all__ = ["LimbDarkRevOp"]

from theano import gof
import theano.tensor as tt

from .base_op import StarryBaseOp


class LimbDarkRevOp(StarryBaseOp):

    __props__ = ()
    func_file = "./limbdark_rev.cc"
    func_name = "APPLY_SPECIFIC(limbdark_rev)"

    def make_node(self, c, b, r, los, bf):
        in_args = [
            tt.as_tensor_variable(c),
            tt.as_tensor_variable(b),
            tt.as_tensor_variable(r),
            tt.as_tensor_variable(los),
            tt.as_tensor_variable(bf),
        ]
        out_args = [in_args[0].type(), in_args[1].type(), in_args[2].type()]
        return gof.Apply(self, in_args, out_args)
github dfm / exoplanet / exoplanet / theano_ops / starry / get_cl.py View on Github external
# -*- coding: utf-8 -*-

__all__ = ["GetClOp"]

import theano.tensor as tt
from theano import gof

from .base_op import StarryBaseOp
from .get_cl_rev import GetClRevOp


class GetClOp(StarryBaseOp):

    __props__ = ()
    func_file = "./get_cl.cc"
    func_name = "APPLY_SPECIFIC(get_cl)"
    num_input = 1

    def __init__(self):
        self.grad_op = GetClRevOp()
        super(GetClOp, self).__init__()

    def make_node(self, arg):
        return gof.Apply(self, [tt.as_tensor_variable(arg)], [arg.type()])

    def infer_shape(self, node, shapes):
        return (shapes[0],)
github dfm / exoplanet / exoplanet / theano_ops / starry / get_cl_rev.py View on Github external
# -*- coding: utf-8 -*-

__all__ = ["GetClRevOp"]

import theano.tensor as tt
from theano import gof

from .base_op import StarryBaseOp


class GetClRevOp(StarryBaseOp):

    __props__ = ()
    func_file = "./get_cl_rev.cc"
    func_name = "APPLY_SPECIFIC(get_cl_rev)"

    def make_node(self, bc):
        return gof.Apply(self, [tt.as_tensor_variable(bc)], [bc.type()])

    def infer_shape(self, node, shapes):
        return (shapes[0],)
github dfm / exoplanet / exoplanet / theano_ops / starry / base_op.py View on Github external
def __init__(self):
        super(StarryBaseOp, self).__init__(self.func_file, self.func_name)
github dfm / exoplanet / exoplanet / theano_ops / starry / limbdark.py View on Github external
# -*- coding: utf-8 -*-

__all__ = ["LimbDarkOp"]

import theano
from theano import gof
import theano.tensor as tt

from .base_op import StarryBaseOp


class LimbDarkOp(StarryBaseOp):

    __props__ = ()
    func_file = "./limbdark.cc"
    func_name = "APPLY_SPECIFIC(limbdark)"

    def make_node(self, c, b, r, los):
        in_args = []
        dtype = theano.config.floatX
        for a in [c, b, r, los]:
            try:
                a = tt.as_tensor_variable(a)
            except tt.AsTensorError:
                pass
            else:
                dtype = theano.scalar.upcast(dtype, a.dtype)
            in_args.append(a)
github dfm / exoplanet / exoplanet / theano_ops / starry / integrated_limbdark.py View on Github external
# -*- coding: utf-8 -*-

__all__ = ["IntegratedLimbDarkOp"]

import theano
import theano.tensor as tt
from theano import gof

from .base_op import StarryBaseOp


class IntegratedLimbDarkOp(StarryBaseOp):

    params_type = gof.ParamsType(
        tol=theano.scalar.float64,
        min_depth=theano.scalar.int32,
        max_depth=theano.scalar.int32,
        Nc=theano.scalar.int32,
        circular=theano.scalar.bool,
    )

    __props__ = ()
    func_file = "./integrated_limbdark.cc"
    func_name = "APPLY_SPECIFIC(integrated_limbdark)"

    def __init__(
        self,
        tol=1e-5,