AtmField

class pyarts3.arts.AtmField(*args, **kwargs)

An atmospheric field.

An atmospheric field holds two things:

  1. The top of the atmosphere altitude, which is the altitude at which the atmosphere ends. Unit: m

  2. A virtual map of AtmData. The available types of keys are:

    1. AtmKey - holds basic data temperature, pressure, wind, and magnetic field.

    2. SpeciesEnum - holds volume mixing ratios of absorption species. Some species might have a different unit.

    3. SpeciesIsotope - holds isotopologue ratios of absorption species. Defaults to built-in values

    4. QuantumLevelIdentifier - holds Non-LTE data - i.e., the direct ratios of upper and lower states (which are instead computed on-the-fly when LTE conditions are assumed).

    5. ScatteringSpeciesProperty - holds data required for scattering calculations. The units and type of data are free-form and depend on the scattering model/method.

Workspace variables of type AtmField

Overview

Method

as_gridded()

Convert all fields of the input atmospheric field to gridded fields.

Method

keys()

Get a list of the keys from an atmospheric field.

Method

readxml()

Read variable from file.

Method

regrid()

Regrid all fields to a new grid.

Method

savexml()

Saves variable to file.

Method

species_keys()

Species keys

Method

to_dict()

Convert an atmospheric field to a dictionary.

Method

to_xarray()

Convert the atmospheric field to an xarray dataset.

Method

update()

Update the atmospheric field with dictionary values.

Static Method

from_dict()

Create an atmospheric field from a dictionary.

Static Method

fromxml()

Create variable from file.

dict[SpeciesIsotope, AtmData]

isots

Isotopologue ratio data

dict[QuantumIdentifier, AtmData]

nlte

NLTE data

dict[AtmKey, AtmData]

other

Basic atmospheric data

dict[SpeciesEnum, AtmData]

specs

Species data

dict[ScatteringSpeciesProperty, AtmData]

ssprops

Scattering species properties data

Numeric

top_of_atmosphere

Top of the atmosphere [m]

Operator

__call__()

Overloaded function.

Operator

__eq__()

Return self==value.

Operator

__format__()

__format__(self, arg: str, /) -> str

Operator

__ge__()

Return self>=value.

Operator

__getitem__()

__getitem__(self, arg: pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, /) -> pyarts3.arts.AtmData

Operator

__getstate__()

__getstate__(self) -> tuple[list[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty], pyarts3.arts.ArrayOfAtmData, float]

Operator

__gt__()

Return self>value.

Operator

__hash__()

Return hash(self).

Operator

__init__()

__init__(self, toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = “Builtin”) -> None

Operator

__le__()

Return self<=value.

Operator

__lt__()

Return self<value.

Operator

__ne__()

Return self!=value.

Operator

__repr__()

__repr__(self) -> str

Operator

__setitem__()

__setitem__(self, arg0: pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, arg1: pyarts3.arts.AtmData, /) -> None

Operator

__setstate__()

__setstate__(self, arg: tuple[collections.abc.Sequence[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty], pyarts3.arts.ArrayOfAtmData, float], /) -> None

Operator

__str__()

__str__(self) -> str

Constructors

__init__(self) None
__init__(self, arg: pyarts3.arts.AtmField) None
__init__(self, toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = 'Builtin') None
__init__(self, toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = 'Builtin') None

Methods

as_gridded(self, alt: pyarts3.arts.AscendingGrid, lat: pyarts3.arts.LatGrid, lon: pyarts3.arts.LonGrid) pyarts3.arts.AtmField

Convert all fields of the input atmospheric field to gridded fields.

Parameters:
Returns:

gridded_atm – An atmospheric field with all fields gridded to the input altitude, latitude, and longitude grids.

Return type:

AtmField

keys(self, core: bool = True, specs: bool = True, isots: bool = True, nlte: bool = True, ssprops: bool = True) list[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty]

Get a list of the keys from an atmospheric field.

>>> from pyarts3.arts import AtmField
>>> field = AtmField()
>>> field["t"] = 273
>>> k = AtmField.keys(isots=False)  # Get list of keys ignoring isotopologue ratios
["t"]
Parameters:
  • core (bool, optional) – If True, the core atmospheric keys will be included (i.e., temperature, pressure, etc). Default is True.

  • specs (bool, optional) – If True, the species VMR keys will be included. Default is True.

  • isots (bool, optional) – If True, the isotopologue ratio keys will be included. Default is True.

  • nlte (bool, optional) – If True, the NLTE keys will be included. Default is True.

  • ssprops (bool, optional) – If True, the scattering species property keys will be included. Default is True.

Returns:

keys – A list of the keys in the atmospheric field.

Return type:

list

readxml(self, file: str) str

Read variable from file.

Parameters:

file (str) – A file that can be read.

Raises:

RuntimeError – For any failure to read.

Returns:

file – The file path found (may differ from input due to environment variables).

Return type:

str

regrid(self, alt: pyarts3.arts.AscendingGrid, lat: pyarts3.arts.LatGrid, lon: pyarts3.arts.LonGrid, extrapolation: pyarts3.arts.InterpolationExtrapolation = 'Nearest', do_atmkeys: bool = True, do_species: bool = True, do_isotopologues: bool = False, do_nlte: bool = True, do_scattering: bool = True) None

Regrid all fields to a new grid.

This will convert the data to a GeodeticField3 if it is not already. It will not respect the existing extrapolation settings, so these must be set manually after calling this method.

Parameters:
  • alt (AscendingGrid) – The new altitude grid.

  • lat (LatGrid) – The new latitude grid.

  • lon (LonGrid) – The new longitude grid.

  • extrapolation (InterpolationExtrapolation) – The extrapolation method to use. The default is Nearest.

  • do_atmkeys (bool) – If true, regrid the basic atmospheric keys (temperature, pressure, magnetic field, wind). Default is true.

  • do_species (bool) – If true, regrid the species VMRs. Default is true.

  • do_isotopologues (bool) – If true, regrid the isotopologue ratios. Default is false.

  • do_nlte (bool) – If true, regrid the NLTE values. Default is true.

  • do_scattering (bool) – If true, regrid the scattering species properties. Default is true.

savexml(self, file: str, type: str = 'ascii', clobber: bool = True) str

Saves variable to file.

Parameters:
  • file (str) – The path to which the file is written. Note that several of the options might modify the name or write more files.

  • type (str, optional) – Type of file to save. See FileType for options. Defaults is “ascii”.

  • clobber (bool, optional) – Overwrite existing files or add new file with modified name? Defaults is True.

Raises:

RuntimeError – For any failure to write.

Returns:

file – The file saved. May differ from input.

Return type:

str

species_keys(self) pyarts3.arts.ArrayOfSpeciesEnum

Species keys

to_dict(self, core: bool = True, specs: bool = True, isots: bool = True, nlte: bool = True, ssprops: bool = True) dict[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, pyarts3.arts.GeodeticField3 | float | pyarts3.arts.NumericTernaryOperator]

Convert an atmospheric field to a dictionary.

Tip

The function stringify_keys() may be used to convert the dictionary keys to strings. This allows for easier manipulation of the data of the dictionary.

Parameters:
  • core (bool, optional) – If True, the core atmospheric data will be included (i.e., temperature, pressure, etc). Default is True.

  • specs (bool, optional) – If True, the species VMR data will be included. Default is True.

  • isots (bool, optional) – If True, the isotopologue ratio data will be included. Default is True.

  • nlte (bool, optional) – If True, the NLTE data will be included. Default is True.

  • ssprops (bool, optional) – If True, the scattering species properties data will be included. Default is True.

Returns:

dict – The atmospheric field data.

Return type:

dict

to_xarray(self, keys: collections.abc.Sequence[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty] = []) object

Convert the atmospheric field to an xarray dataset.

The atmospheric field must be gridded using, e.g., the as_gridded() method.

Parameters:

keys (list, optional) – The keys to include in the xarray dataset. Default is empty, which includes all keys.

Returns:

dataset – The dataset with the atmospheric field data. The coordinates are “alt”, “lat”, and “lon”.

Return type:

xarray.Dataset

update(self, data: collections.abc.Mapping[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, pyarts3.arts.GeodeticField3 | float | pyarts3.arts.NumericTernaryOperator], extrap: pyarts3.arts.InterpolationExtrapolation = 'Nearest') None

Update the atmospheric field with dictionary values.

Tip

Each key-type of the dictionary is constructible from a str. So using a dictionary with string keys is possible.

Parameters:
  • data (dict) – A dictionary of atmospheric keys and corresponding data.

  • extrap (InterpolationExtrapolation, optional) – The extrapolation method to use for the new keys. Default is “Nearest”. Ignored by existing keys.

Static Methods

from_dict(data: collections.abc.Mapping[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, pyarts3.arts.GeodeticField3 | float | pyarts3.arts.NumericTernaryOperator], toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = 'Builtin', extrap: pyarts3.arts.InterpolationExtrapolation = 'Nearest') pyarts3.arts.AtmField

Create an atmospheric field from a dictionary.

Tip

Each key-type of the dictionary is constructible from a str. So using a dictionary with string keys is possible.

Parameters:
  • data (dict) – A dictionary of atmospheric keys and corresponding data.

  • toa (Numeric, optional) – The top of the atmosphere. Default is 100e3.

  • iso (IsoRatioOption, optional) – The isotopologue ratio option to use. Default is “Builtin”. Use “None” to create field without isotopologue ratios.

  • extrap (InterpolationExtrapolation, optional) – The extrapolation method to use for the new keys. Default is “Nearest”.

Returns:

atmospheric_field – The atmospheric field created from the dictionary.

Return type:

AtmField

fromxml(file: str) pyarts3.arts.AtmField

Create variable from file.

Parameters:

file (str) – A file that can be read

Raises:

RuntimeError – For any failure to read.

Returns:

artstype – The variable created from the file.

Return type:

T

Attributes

isots: dict[SpeciesIsotope, AtmData]

Isotopologue ratio data

nlte: dict[QuantumIdentifier, AtmData]

NLTE data

other: dict[AtmKey, AtmData]

Basic atmospheric data

specs: dict[SpeciesEnum, AtmData]

Species data

ssprops: dict[ScatteringSpeciesProperty, AtmData]

Scattering species properties data

top_of_atmosphere: Numeric

Top of the atmosphere [m]

Operators

__call__(self, h: float, lat: float, lon: float) pyarts3.arts.AtmPoint
__call__(self, h: pyarts3.arts.Vector, lat: pyarts3.arts.Vector, lon: pyarts3.arts.Vector) pyarts3.arts.ArrayOfAtmPoint

Overloaded function.

  1. __call__(self, h: float, lat: float, lon: float) -> pyarts3.arts.AtmPoint

Get the data at a point

  1. __call__(self, h: pyarts3.arts.Vector, lat: pyarts3.arts.Vector, lon: pyarts3.arts.Vector) -> pyarts3.arts.ArrayOfAtmPoint

Get the data as a list

__eq__(value, /)

Return self==value.

__format__(self, arg: str, /) str
__ge__(value, /)

Return self>=value.

__getitem__(self, arg: pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, /) pyarts3.arts.AtmData
__getstate__(self) tuple[list[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty], pyarts3.arts.ArrayOfAtmData, float]
__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(self) None
__init__(self, arg: pyarts3.arts.AtmField) None
__init__(self, toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = 'Builtin') None
__init__(self, toa: float = 100000.0, iso: pyarts3.arts.IsoRatioOption = 'Builtin') None
__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__repr__(self) str
__setitem__(self, arg0: pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty, arg1: pyarts3.arts.AtmData, /) None
__setstate__(self, arg: tuple[collections.abc.Sequence[pyarts3.arts.AtmKey | pyarts3.arts.SpeciesEnum | pyarts3.arts.SpeciesIsotope | pyarts3.arts.QuantumLevelIdentifier | pyarts3.arts.ScatteringSpeciesProperty], pyarts3.arts.ArrayOfAtmData, float], /) None
__str__(self) str