Esempio n. 1
0
def native_functions(field_a: Field3D, field_b: Field3D):
    with computation(PARALLEL), interval(...):
        abs_res = abs(field_a)
        max_res = max(abs_res, field_b)
        min_res = min(max_res, 42)
        mod_res = mod(min_res, 37.5)
        sin_res = sin(mod_res)
        asin_res = asin(sin_res)
        cos_res = cos(asin_res)
        acos_res = acos(cos_res)
        tan_res = tan(acos_res)
        atan_res = atan(tan_res)
        sinh_res = sinh(atan_res)
        asinh_res = asinh(sinh_res)
        cosh_res = cosh(asinh_res)
        acosh_res = acosh(cosh_res)
        tanh_res = tanh(acosh_res)
        atanh_res = atanh(tanh_res)
        sqrt_res = afunc(atanh_res)
        exp_res = exp(sqrt_res)
        log_res = log(exp_res)
        gamma_res = gamma(log_res)
        cbrt_res = cbrt(gamma_res)
        floor_res = floor(cbrt_res)
        ceil_res = ceil(floor_res)
        trunc_res = trunc(ceil_res)
        field_a = (trunc_res if isfinite(trunc_res) else field_a if
                   isinf(trunc_res) else field_b if isnan(trunc_res) else 0.0)
 def func(in_field: gtscript.Field[np.float_]):
     with computation(PARALLEL), interval(...):
         in_field = asin(in_field) + 1 if 1 < in_field else sin(in_field)
 def sinus(field_in):
     return sin(field_in)
 def func(in_field: gtscript.Field[np.float_]):
     with computation(PARALLEL), interval(...):
         in_field += min(abs(sin(add_external_const(in_field))), -0.5)
 def func(in_field: gtscript.Field[np.float_]):
     with computation(PARALLEL), interval(...):
         in_field += sin(abs(in_field))
Esempio n. 6
0
def compute_rf_vals(pfull, bdt, rf_cutoff, tau0, ptop):
    return (bdt / tau0 * sin(0.5 * constants.PI * log(rf_cutoff / pfull) /
                             log(rf_cutoff / ptop))**2)
Esempio n. 7
0
def great_circle_dist(p1a, p1b, p2a, p2b):
    tb = sin((p1b - p2b) / 2.0)**2.0
    ta = sin((p1a - p2a) / 2.0)**2.0
    return asin(sqrt(tb + cos(p1b) * cos(p2b) * ta)) * 2.0