pomme.lines

class pomme.lines.Line(species_name, transition, database='LAMDA', datafile=None, molar_mass=None)

Bases: object

Spectral line class.

LTE_emissivity_and_opacity(abundance, temperature, v_turbulence, frequencies)

Line emissivity and opacity assuming LTE.

Parameters:
  • abundance (torch.Tensor) – Abundance distribution of the line producing species.

  • temperature (torch.Tensor) – Temperature for which to evaluate the LTE level populations.

  • v_turbulence (torch.Tensor) – Turbulent velocity for which to evaluate the line profile.

  • frequencies (torch.Tensor) – Frequencies at which to evaluate the LTE emissivities and opacities.

Returns:

eta, chi – Tensor containing the LTE emissivities and opacities for the given temperature.

Return type:

torch.Tensor, torch.Tensor

LTE_image_along_last_axis(abundance, temperature, v_turbulence, velocity_los, frequencies, dx, img_bdy)

Create an image along the last data axis, assuming LTE level populations.

Parameters:
  • abundance (torch.Tensor) – Abundance distribution of the line producing species.

  • temperature (torch.Tensor) – Temperature distribution of the line producing species.

  • v_turbulence (torch.Tensor) – Turbulent velocity distribution.

  • velocity_los (torch.Tensor) – Line of sight velocity distribution.

  • frequencies (torch.Tensor) – Frequencies at which to image the model.

  • dx (torch.Tensor) – Grid spacing along the line of sight.

  • img_bdy (torch.Tensor) – Boundary conditions for the image.

Returns:

img – Tensor containing the image of the model.

Return type:

torch.Tensor

LTE_pops(temperature)

Relative LTE level populations for the given temperature.

Parameters:

temperature (torch.Tensor) – Temperature for which to evaluate the LTE level populations.

Returns:

out – Array containing the LTE level populations for the given temperature.

Return type:

array_like

emissivity_and_opacity_ij(pop)

Line opacity, not folded with the profile.

Parameters:

pop (torch.Tensor) – level populations

Returns:

eta, chi – Tensor containing the LTE emissivities and opacities for the given temperature.

Return type:

torch.Tensor, torch.Tensor

freq_to_velo(freq, unit='m/s')

Convert frequencies with respect to this line to velocities.

Parameters:
  • freq (torch.Tensor) – Frequency tensor to convert.

  • unit (str) – Unit of the velocity. (Default ‘m/s’.)

Returns:

out – Tensor containing the velocities corresponding to the given frequencies.

Return type:

torch.Tensor

gaussian_profile(temperature, v_turbulence, freq)

Gaussian spectral line profile function.

Parameters:
  • temperature (torch.Tensor) – Temperature for which to evaluate the line profile.

  • v_turbulence (torch.Tensor) – Turbulent velocity for which to evaluate the line profile.

  • freq (torch.Tensor) – Frequency at which to evaluate the line profile.

Returns:

out – Tensor containing the Gaussian line profile for the given temperature and turbulent velocity

Return type:

torch.Tensor

gaussian_width(temperature, v_turbulence)

Gaussian spectral line width.

Parameters:
  • temperature (torch.Tensor) – Temperature for which to evaluate the line width.

  • v_turbulence (torch.Tensor) – Turbulent velocity for which to evaluate the line width.

Returns:

out – Tensor containing the Gaussian line width for the given temperature and turbulent velocity

Return type:

torch.Tensor

image_along_last_axis(pop, abundance, temperature, v_turbulence, velocity_los, frequencies, dx, img_bdy)

Create an image along the last data axis.

Parameters:
  • pop (torch.Tensor) – Level populations for the line producing species.

  • abundance (torch.Tensor) – Abundance distribution of the line producing species.

  • temperature (torch.Tensor) – Temperature distribution of the line producing species.

  • v_turbulence (torch.Tensor) – Turbulent velocity distribution.

  • velocity_los (torch.Tensor) – Line of sight velocity distribution.

  • frequencies (torch.Tensor) – Frequencies at which to image the model.

  • dx (torch.Tensor) – Grid spacing along the line of sight.

  • img_bdy (torch.Tensor) – Boundary conditions for the image.

Returns:

img – Tensor containing the image of the model.

Return type:

torch.Tensor

optical_depth_along_last_axis(chi_ij, abundance, temperature, v_turbulence, velocity_los, frequencies, dx)

Line optical depth along the last axis.

Parameters:
  • chi_ij (torch.Tensor) – Line opacity distribution.

  • abundance (torch.Tensor) – Abundance distribution of the line producing species.

  • temperature (torch.Tensor) – Temperature distribution of the line producing species.

  • v_turbulence (torch.Tensor) – Turbulent velocity distribution.

  • velocity_los (torch.Tensor) – Line of sight velocity distribution.

  • frequencies (torch.Tensor) – Frequencies at which to compute the optical depth.

  • dx (torch.Tensor) – Grid spacing along the line of sight.

Returns:

  • dtau (torch.Tensor) – Tensor containing the differential optical depth.

  • tau (torch.Tensor) – Tensor containing the cumulative optical depth.

source_ij(pop)

Line source function

Parameters:

pop (torch.Tensor) – level populations

Returns:

src – Tensor containing the line source function (= emissivity / opacity).

Return type:

torch.Tensor

class pomme.lines.LineData(species_name=None, datafile=None, database='LAMDA')

Bases: object

Class structuring the line data.