Opacity Classes

class AttenuatorOptions
bname(*args, **kwargs)

Overloaded function.

  1. bname(self: pyharp.opacity.AttenuatorOptions) -> str

Set or get the name of the band that the opacity is associated with

Parameters:

bname (str) – name of the band that the opacity is associated with

Returns:

class object if argument is not empty, otherwise the band name

Return type:

AttenuatorOptions | str

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().bname('band1')
  1. bname(self: pyharp.opacity.AttenuatorOptions, arg0: str) -> pyharp.opacity.AttenuatorOptions

Set or get the name of the band that the opacity is associated with

Parameters:

bname (str) – name of the band that the opacity is associated with

Returns:

class object if argument is not empty, otherwise the band name

Return type:

AttenuatorOptions | str

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().bname('band1')
fractions(*args, **kwargs)

Overloaded function.

  1. fractions(self: pyharp.opacity.AttenuatorOptions) -> list[float]

Set or get fractions of species in cia calculatioin

Parameters:

fractions (list[float]) – list of species fractions

Returns:

class object if argument is not empty, otherwise the list of species fractions

Return type:

AttenuatorOptions | list[float]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().fractions([0.9, 0.1])
  1. fractions(self: pyharp.opacity.AttenuatorOptions, arg0: list[float]) -> pyharp.opacity.AttenuatorOptions

Set or get fractions of species in cia calculatioin

Parameters:

fractions (list[float]) – list of species fractions

Returns:

class object if argument is not empty, otherwise the list of species fractions

Return type:

AttenuatorOptions | list[float]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().fractions([0.9, 0.1])
jit_kwargs(*args, **kwargs)

Overloaded function.

  1. jit_kwargs(self: pyharp.opacity.AttenuatorOptions) -> list[str]

Set or get the list of kwargs to pass to the JIT module

Parameters:

jit_kwargs (list[str]) – list of kwargs to pass to the JIT module

Returns:

class object if argument is not empty, otherwise the list of kwargs to pass to the JIT module

Return type:

AttenuatorOptions | list[str]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().jit_kwargs(['temp', 'wavelength'])
>>> print(op.jit_kwargs())
  1. jit_kwargs(self: pyharp.opacity.AttenuatorOptions, arg0: list[str]) -> pyharp.opacity.AttenuatorOptions

Set or get the list of kwargs to pass to the JIT module

Parameters:

jit_kwargs (list[str]) – list of kwargs to pass to the JIT module

Returns:

class object if argument is not empty, otherwise the list of kwargs to pass to the JIT module

Return type:

AttenuatorOptions | list[str]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().jit_kwargs(['temp', 'wavelength'])
>>> print(op.jit_kwargs())
opacity_files(*args, **kwargs)

Overloaded function.

  1. opacity_files(self: pyharp.opacity.AttenuatorOptions) -> list[str]

Set or get the list of opacity data files

Parameters:

opacity_files (list) – list of opacity data files

Returns:

class object if argument is not empty, otherwise the list of opacity data files

Return type:

AttenuatorOptions | list[str]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().opacity_files(['file1', 'file2'])
  1. opacity_files(self: pyharp.opacity.AttenuatorOptions, arg0: list[str]) -> pyharp.opacity.AttenuatorOptions

Set or get the list of opacity data files

Parameters:

opacity_files (list) – list of opacity data files

Returns:

class object if argument is not empty, otherwise the list of opacity data files

Return type:

AttenuatorOptions | list[str]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().opacity_files(['file1', 'file2'])
species_ids(*args, **kwargs)

Overloaded function.

  1. species_ids(self: pyharp.opacity.AttenuatorOptions) -> list[int]

Set or get the list of dependent species indices

Parameters:

species_ids (list[int]) – list of dependent species indices

Returns:

class object if argument is not empty, otherwise the list of dependent species indices

Return type:

AttenuatorOptions | list[int]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().species_ids([1, 2])
  1. species_ids(self: pyharp.opacity.AttenuatorOptions, arg0: list[int]) -> pyharp.opacity.AttenuatorOptions

Set or get the list of dependent species indices

Parameters:

species_ids (list[int]) – list of dependent species indices

Returns:

class object if argument is not empty, otherwise the list of dependent species indices

Return type:

AttenuatorOptions | list[int]

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().species_ids([1, 2])
type(*args, **kwargs)

Overloaded function.

  1. type(self: pyharp.opacity.AttenuatorOptions) -> str

Set or get the type of the opacity source format

Valid options are, jit, rfm-lbl, rfm-ck, four-column, wavetemp, multiband. See List of supported opacity types for more details.

Parameters:

type (str) – type of the opacity source

Returns:

class object if argument is not empty, otherwise the type

Return type:

AttenuatorOptions | str

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().type('rfm-lbl')
>>> print(op)
  1. type(self: pyharp.opacity.AttenuatorOptions, arg0: str) -> pyharp.opacity.AttenuatorOptions

Set or get the type of the opacity source format

Valid options are, jit, rfm-lbl, rfm-ck, four-column, wavetemp, multiband. See List of supported opacity types for more details.

Parameters:

type (str) – type of the opacity source

Returns:

class object if argument is not empty, otherwise the type

Return type:

AttenuatorOptions | str

Examples

>>> import torch
>>> from pyharp.opacity import AttenuatorOptions
>>> op = AttenuatorOptions().type('rfm-lbl')
>>> print(op)
class FourColumn
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyharp.opacity.cpp.FourColumn) -> None

Construct a new default module.

  1. __init__(self: pyharp.opacity.cpp.FourColumn, options: pyharp.opacity.AttenuatorOptions) -> None

Construct a FourColumn module

forward(*args, **kwargs)

Overloaded function.

  1. forward(self: pyharp.opacity.cpp.FourColumn, arg0: torch.Tensor, arg1: dict[str, torch.Tensor]) -> torch.Tensor

  2. forward(self: pyharp.opacity.cpp.FourColumn, conc: torch.Tensor, kwargs: dict[str, torch.Tensor]) -> torch.Tensor

Four-column opacity data

Parameters:
  • conc (torch.Tensor) – concentration of the species in mol/m^3

  • kwargs (dict[str, torch.Tensor]) –

    keyword arguments

    Either ‘wavelength’ or ‘wavenumber’ must be provided if ‘wavelength’ is provided, the unit is um. if ‘wavenumber’ is provided, the unit is cm^{-1}.

Returns:

The shape of the output tensor is (nwave, ncol, nlyr, 2+nmom), where nwave is the number of wavelengths, ncol is the number of columns, nlyr is the number of layers. The last dimension is the optical properties arranged in the order of attenuation [1/m], single scattering albedo and scattering phase function, where nmom is the number of scattering moments.

Return type:

torch.Tensor

Examples

>>> import torch
>>> from pyharp.opacity import FourColumn, AttenuatorOptions
>>> op = FourColumn(AttenuatorOptions())
class MultiBand
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyharp.opacity.cpp.MultiBand) -> None

Construct a new default module.

  1. __init__(self: pyharp.opacity.cpp.MultiBand, options: pyharp.opacity.AttenuatorOptions) -> None

Construct a MultiBand module

forward(*args, **kwargs)

Overloaded function.

  1. forward(self: pyharp.opacity.cpp.MultiBand, arg0: torch.Tensor, arg1: dict[str, torch.Tensor]) -> torch.Tensor

  2. forward(self: pyharp.opacity.cpp.MultiBand, conc: torch.Tensor, kwargs: dict[str, torch.Tensor]) -> torch.Tensor

Multi-band opacity data

Parameters:
  • conc (torch.Tensor) – concentration of the species in mol/m^3

  • kwargs (dict[str, torch.Tensor]) –

    keyword arguments

    Both ‘temp’ [k] and ‘pres’ [pa] must be provided

Returns:

The shape of the output tensor is (nwave, ncol, nlyr, 1), where nwave is the number of wavelengths, ncol is the number of columns, nlyr is the number of layers. The last dimension is the optical properties arranged in the order of attenuation [1/m], single scattering albedo and scattering phase function.

Return type:

torch.Tensor

Examples

>>> import torch
>>> from pyharp.opacity import MultiBand, AttenuatorOptions
>>> op = MultiBand(AttenuatorOptions())
class WaveTemp
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyharp.opacity.cpp.WaveTemp) -> None

Construct a new default module.

  1. __init__(self: pyharp.opacity.cpp.WaveTemp, options: pyharp.opacity.AttenuatorOptions) -> None

Construct a WaveTemp module

forward(*args, **kwargs)

Overloaded function.

  1. forward(self: pyharp.opacity.cpp.WaveTemp, arg0: torch.Tensor, arg1: dict[str, torch.Tensor]) -> torch.Tensor

  2. forward(self: pyharp.opacity.cpp.WaveTemp, conc: torch.Tensor, kwargs: dict[str, torch.Tensor]) -> torch.Tensor

Wave-Temp opacity data

Parameters:
  • conc (torch.Tensor) – concentration of the species in mol/m^3

  • kwargs (dict[str, torch.Tensor]) –

    keyword arguments.

    Both ‘temp’ [k] and (‘wavenumber’ [cm^{-1}] or ‘wavelength’ [um]) must be provided

Returns:

The shape of the output tensor is (nwave, ncol, nlyr, *), where nwave is the number of wavelengths, ncol is the number of columns, nlyr is the number of layers. The last dimension is the optical properties arranged in the order of attenuation [1/m], single scattering albedo and scattering phase function.

Return type:

torch.Tensor

Examples

>>> import torch
>>> from pyharp.opacity import WaveTemp, AttenuatorOptions
>>> op = MultiBand(AttenuatorOptions())
class RFM
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyharp.opacity.cpp.RFM) -> None

Construct a new default module.

  1. __init__(self: pyharp.opacity.cpp.RFM, options: pyharp.opacity.AttenuatorOptions) -> None

Construct a RFM module

forward(*args, **kwargs)

Overloaded function.

  1. forward(self: pyharp.opacity.cpp.RFM, arg0: torch.Tensor, arg1: dict[str, torch.Tensor]) -> torch.Tensor

  2. forward(self: pyharp.opacity.cpp.RFM, conc: torch.Tensor, kwargs: dict[str, torch.Tensor]) -> torch.Tensor

Line-by-line absorption data computed by RFM

Parameters:
  • conc (torch.Tensor) – concentration of the species in mol/m^3

  • kwargs (dict[str, torch.Tensor]) –

    keyword arguments

    Either ‘wavelength’ or ‘wavenumber’ must be provided if ‘wavelength’ is provided, the unit is um. if ‘wavenumber’ is provided, the unit is cm^{-1}.

Returns:

The shape of the output tensor is (nwave, ncol, nlyr, 1), where nwave is the number of wavelengths, ncol is the number of columns, nlyr is the number of layers. The last dimension is the optical properties arranged in the order of attenuation [1/m], single scattering albedo and scattering phase function.

Return type:

torch.Tensor

Examples

>>> import torch
>>> from pyharp.opacity import RFM, AttenuatorOptions
>>> op = RFM(AttenuatorOptions())
class JITOpacity
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyharp.opacity.cpp.JITOpacity) -> None

Construct a new default module.

  1. __init__(self: pyharp.opacity.cpp.JITOpacity, options: pyharp.opacity.AttenuatorOptions) -> None

Construct a JITOpacity module

forward(*args, **kwargs)

Overloaded function.

  1. forward(self: pyharp.opacity.cpp.JITOpacity, arg0: torch.Tensor, arg1: dict[str, torch.Tensor]) -> torch.Tensor

  2. forward(self: pyharp.opacity.cpp.JITOpacity, conc: torch.Tensor, kwargs: dict[str, torch.Tensor]) -> torch.Tensor

JIT opacity model

Parameters:
  • conc (torch.Tensor) – concentration of the species in mol/m^3

  • kwargs (dict[str, torch.Tensor]) –

    keyword arguments passed to the JIT model

    The keyword arguments must be provided in the form of a dictionary. The keys of the dictionary are the names of the input tensors and the values are the corresponding tensors. Since the JIT model only accepts positional arguments, the keyword arguments are passed according to the order of the keys in the dictionary.

Returns:

results of the JIT opacity model

Return type:

torch.Tensor