Esempio n. 1
0
 def __getitem__(self, key):
     if not isinstance(key, QuantumIdentifier):
         key = QuantumIdentifier(key)
     return ErrorCorrectedSuddenData(
         c.c_void_p(
             lib.getMapOfErrorCorrectedSuddenData(self.__data__,
                                                  key.__data__)))
Esempio n. 2
0
    def __init__(self,
                 selfbroadening=False,
                 bathbroadening=False,
                 nlines=0,
                 cutoff="None",
                 mirroring="None",
                 population="LTE",
                 normalization="None",
                 lineshapetype="VP",
                 t0=296,
                 cutofffreq=-1,
                 linemixinglimit=-1,
                 quantumidentity=QuantumIdentifier(),
                 broadeningspecies=ArrayOfSpecies(),
                 lsm=LineShapeModel(),
                 lines=ArrayOfAbsorptionSingleLine()):
        if isinstance(selfbroadening, c.c_void_p):
            self.__delete__ = False
            self.__data__ = selfbroadening
        else:
            self.__delete__ = True
            self.__data__ = c.c_void_p(lib.createAbsorptionLines())
            self.selfbroadening = selfbroadening
            self.bathbroadening = bathbroadening
            self.cutoff = cutoff
            self.mirroring = mirroring
            self.population = population
            self.normalization = normalization
            self.lineshapetype = lineshapetype
            self.t0 = t0
            self.cutofffreq = cutofffreq
            self.linemixinglimit = linemixinglimit
            self.quantumidentity = quantumidentity
            self.broadeningspecies = broadeningspecies
            self.lines = lines

            if not self.OK:
                raise ValueError("Bad initialization of class")
Esempio n. 3
0
 def quantumidentity(self):
     """ Identifier of the Jacobian line parameter (QuantumIdentifier) """
     return QuantumIdentifier(c.c_void_p(lib.getQuantumIdentityJacobianTarget(self.__data__)))
Esempio n. 4
0
 def quantumidentity(self):
     """ Quantum identity (QuantumIdentifier) """
     return QuantumIdentifier(
         c.c_void_p(lib.getquantumidentityAbsorptionLines(self.__data__)))
Esempio n. 5
0
 def id(self):
     return QuantumIdentifier(
         c.c_void_p(lib.getidErrorCorrectedSuddenData(self.__data__)))
Esempio n. 6
0
rq.subsubtag = ""
rq.mode = ""
rq.analytical = 1
rq.target.type = "Atm"
rq.target.subtype = "Temperature"
rq.target.perturbation = 0.1
rq.grids = ArrayOfVector([p, lat, lon])

assert rq == arq[0]
arq.size = 2
arq[1].set(rq)
assert arq[1] == arq[0]
arq.append(rq)
assert arq[1] == arq[2]

qn = QuantumIdentifier("H2O-161")
aost = [SpeciesTag(), SpeciesTag()]
aost[0].setFromString("H2O-161")
aost[1].setFromString("H2O-MPM89")

rq2 = RetrievalQuantity()
rq2.maintag = ""
rq2.subtag = ""
rq2.subsubtag = ""
rq2.mode = ""
rq2.analytical = 1
rq2.target.type = "Special"
rq2.target.subtype = "SurfaceString"
rq2.target.perturbation = 0.0
rq2.grids = ArrayOfVector([p, lat, lon])
rq2.target.string_key = "I am a string"
Esempio n. 7
0
al = AbsorptionLines()
aal = ArrayOfAbsorptionLines()
aaal = from_workspace(ws.abs_lines_per_species)

# Init is as expected
assert al.selfbroadening == False, "Bad init"
assert al.bathbroadening == False, "Bad init"
assert al.cutoff == "None", "Bad init"
assert al.mirroring == "None", "Bad init"
assert al.population == "LTE", "Bad init"
assert al.normalization == "None", "Bad init"
assert al.lineshapetype == "VP", "Bad init"
assert al.t0 == 296, "Bad init"
assert al.cutofffreq == -1, "Bad init"
assert al.linemixinglimit == -1, "Bad init"
assert al.quantumidentity == QuantumIdentifier(), "Bad init"
assert not al.broadeningspecies, "Bad init"
assert not al.lines, "Bad init"
assert al.OK, "Bad init"

# Read same file twice, in ARTS and external
ws.abs_speciesSet(species=["O2-66"])
aal.readxml(os.path.join(datapath, "O2-66.xml"))
ws.abs_lines_per_speciesReadSpeciesSplitCatalog(basename=datapath)

# Everything should be the same (with silly not-empty test)
assert aal == aaal[0], "Bad load"
assert aal[0].lines[0].f0 != 0, "Bad frequency"
assert 2 * aal[0].lines[0].f0 == 2 * aaal[0][0].lines[0].f0, "Bad frequency"

al.set(aal[0])
Esempio n. 8
0
from pyarts.workspace import Workspace
from pyarts.classes.quantum import QuantumIdentifier, ArrayOfQuantumIdentifier
from pyarts.classes.SpeciesTag import SpeciesTag
from pyarts.classes import from_workspace


# Get a workspace
ws = Workspace()

aqi = from_workspace(ws.band_identifiers)
qi = QuantumIdentifier()

qi.isot = "H2O-161"
qi.val["J"] = "J 3 2"

aqi.data = [qi]
assert qi == aqi[0]

aqi.size = 2
aqi[1].set(aqi[0])
assert aqi[0] == aqi[1]
aqi.append(qi)
assert aqi[0] == aqi[2]
for x in aqi:
    x.val["J"] = "J 3 2"

aqi2 = ArrayOfQuantumIdentifier()
aqi.savexml("tmp.aqi.xml", "ascii")
aqi2.readxml("tmp.aqi.xml")
assert aqi == aqi2