Ejemplo n.º 1
0
 def set(self, other):
     """ Sets this class according to another python instance of itself """
     if isinstance(other, PropagationMatrix):
         tmp = Tensor4(other.data.data)
         self.setData(other.frequencies, other.stokes, other.zeniths,
                      other.azimuths, 0.0)
         self.data = tmp
     else:
         raise TypeError("Expects PropagationMatrix")
Ejemplo n.º 2
0
 def xsec(self):
     """ Absorption cross sections (Tensor4) """
     return Tensor4(c.c_void_p(lib.getXsecGasAbsLookup(self.__data__)))
Ejemplo n.º 3
0
 def B0rp(self):
     """ B0rp: (Tensor4) """
     return Tensor4(
         c.c_void_p(lib.getB0rpHitranRelaxationMatrixData(self.__data__)))
Ejemplo n.º 4
0
 def W0rq(self):
     """ W0rq: (Tensor4) """
     return Tensor4(
         c.c_void_p(lib.getW0rqHitranRelaxationMatrixData(self.__data__)))
Ejemplo n.º 5
0
assert not gf1.OK
gf1.data = Vector([5,4,3])
assert gf1.OK

gf2.grids = [Vector([1,2,3]), ArrayOfString([String("Hej"), String("hopp")])]
assert not gf2.OK
gf2.data = Matrix([[1, 2], [3, 4], [5, 6]])
assert gf2.OK

gf3.data = Tensor3(np.zeros((5, 3, 2)))
assert not gf3
assert not gf3.OK
gf3.grids = [Vector(np.linspace(0, 1, 5)), Vector(np.linspace(0, 1, 3)), Vector(Vector(np.linspace(0, 1, 2)))]
assert gf3.OK

gf4.data = Tensor4(np.zeros((5, 3, 2, 4)))
assert not gf4
assert not gf4.OK
gf4.grids = [Vector(np.linspace(0, 1, 5)), Vector(np.linspace(0, 1, 3)), Vector(np.linspace(0, 1, 2)), Vector(np.linspace(0, 1, 4))]
assert gf4.OK

gf5.data = Tensor5(np.zeros((5, 3, 2, 4)))
assert not gf5
assert not gf5.OK
gf5.grids = [Vector([0]), Vector(np.linspace(0, 1, 5)), Vector(np.linspace(0, 1, 3)), Vector(np.linspace(0, 1, 2)), Vector(np.linspace(0, 1, 4))]
assert gf5.OK

gf6.data = Tensor6(np.zeros((1, 2, 3, 4, 5, 6)))
assert not gf6
assert not gf6.OK
gf6.grids = [Vector([0]), Vector(np.linspace(0, 1, 2)), Vector(np.linspace(0, 1, 3)), Vector(np.linspace(0, 1, 4)), Vector(np.linspace(0, 1, 5)), Vector(np.linspace(0, 1, 6))]
Ejemplo n.º 6
0
import numpy as np

from pyarts.classes.Vector import Vector
from pyarts.classes.Matrix import Matrix
from pyarts.classes.Tensor3 import Tensor3
from pyarts.classes.Tensor4 import Tensor4
from pyarts.classes.Tensor5 import Tensor5
from pyarts.classes.Tensor6 import Tensor6
from pyarts.classes.Tensor7 import Tensor7

t1 = Vector()
t2 = Matrix()
t3 = Tensor3()
t4 = Tensor4()
t5 = Tensor5()
t6 = Tensor6()
t7 = Tensor7()

assert not t1
assert not t2
assert not t3
assert not t4
assert not t5
assert not t6
assert not t7

n = int(np.random.permutation(np.linspace(1, 10, 10))[0])
t1.data = np.random.normal(size=(n, ))
t2.data = np.random.normal(size=(n, n))
t3.data = np.random.normal(size=(n, n, n))
t4.data = np.random.normal(size=(n, n, n, n))
Ejemplo n.º 7
0
 def data(self):
     """ The data (Tensor4) """
     return Tensor4(c.c_void_p(lib.getDataPropagationMatrix(self.__data__)))
Ejemplo n.º 8
0
 def data(self):
     """ NLTE data (Tensor4) """
     return Tensor4(c.c_void_p(lib.getDataEnergyLevelMap(self.__data__)))
Ejemplo n.º 9
0
 def data(self):
     """ The data (Tensor4) """
     return Tensor4(c.c_void_p(lib.getDataStokesVector(self.__data__)))
Ejemplo n.º 10
0
 def data(self):
     """ The data (Tensor4) """
     return Tensor4(c.c_void_p(lib.dataGriddedField4(self.__data__)))