示例#1
0
def test_cart2pol():

    with NumpyRNGContext(0):
        x = np.random.uniform(-1, 1, 5)
        y = np.random.uniform(-1, 1, 5)

    rho, theta = pyoof.cart2pol(x, y)

    rho_true = np.array(
        [0.30768718, 0.44811525, 0.81005283, 0.93166014, 0.27867163])
    theta_true = np.array(
        [1.24792264, -0.28229117, 1.31427197, 1.47429564, -2.15067483])

    assert_allclose(rho, rho_true)
    assert_allclose(theta, theta_true)
示例#2
0
# Author: Tomas Cassanelli
import pytest
import numpy as np
from astropy.utils.data import get_pkg_data_filename
from astropy.utils.misc import NumpyRNGContext
from numpy.testing import assert_allclose
import pyoof


# Basic data for the telescope
pr = 50.
x = np.linspace(-pr, pr, 1e3)
xx, yy = np.meshgrid(x, x)

r, t = pyoof.cart2pol(xx, yy)

I_coeff = [1, -14, 0, 0]
K_coeff = np.array([0.1] * 21)
d_z = 0.022  # m
wavel = 0.0093685143125

telgeo = [
    pyoof.telgeometry.block_effelsberg,
    pyoof.telgeometry.opd_effelsberg,
    pr
    ]


def test_e_rs():