pyLBL.webapi package

Submodules

pyLBL.webapi.hitran_api module

Defines the API for interacting with the HITRAN database.

class pyLBL.webapi.hitran_api.HitranWebApi(api_key, api_version='v2', host='https://hitran.org', proxy=None)[source]

Bases: object

Controls access to HITRAN’s web API.

api_key

String hitran.org api key.

api_version

String version of the api to use.

cross_section_directory

String directory where cross section files are located.

host

URL to retrieve the data from.

parameters

List of Struct objects describing the HITRAN parameters.

proxy

Web proxy (optional).

timestamp

String time stamp telling when the server was accessed.

transition_directory

String directory where transitions files are located.

download_cross_sections(molecules)[source]

Downloads cross-sections for molecules available in the HITRAN database.

Parameters:

molecules – List of Struct objcts.

Returns:

List of Struct objects containing the response data.

download_data_sources(ids=None)[source]

Downloads information about the source of the line data (papers, etc.)

Parameters:

ids – Isotopologue ids.

Returns:

JSON string containing the response data.

download_isotopologues(molecules)[source]

Downloads the isotopologues available in HITRAN.

Parameters:

molecules – List of Struct objects.

Returns:

List of Struct objects containing the response data.

download_molecules()[source]

Downloads the molecules available in HITRAN.

Returns:

List of Struct objects containing the response data.

download_transitions(isotopologues, numin, numax, parameters=None)[source]

Downloads transitions for isotopologues available in HITRAN.

Parameters:
  • isotopologues – List of Struct objects.

  • numin – Wavenumber lower bound [cm-1].

  • numax – Wavenumber upper bound [cm-1].

  • parameters – List of parameters to download.

Returns:

List of Struct objects containing the response data.

exception pyLBL.webapi.hitran_api.NoCrossSectionError[source]

Bases: BaseException

exception pyLBL.webapi.hitran_api.NoIsotopologueError[source]

Bases: BaseException

exception pyLBL.webapi.hitran_api.NoTransitionsError[source]

Bases: BaseException

class pyLBL.webapi.hitran_api.Query(**argv)[source]

Bases: object

URL parameter (query string) helper class.

string

String containing URL parameters.

static process(val)[source]

Process argument value and convert to string.

class pyLBL.webapi.hitran_api.Struct(**attrs)[source]

Bases: object

pyLBL.webapi.tips_api module

Defines the API for interacting with the TIPS data stored on the web.

exception pyLBL.webapi.tips_api.NoMoleculeError[source]

Bases: BaseException

No TIPS data found for this molecule.

class pyLBL.webapi.tips_api.TipsWebApi[source]

Bases: object

Controls access to TIPS web API.

url

String url where data is downloaded from.

download(molecule)[source]

Downloads the data from the internet.

Parameters:

molecule – String molecule chemical formula.

Returns:

Numpy array of temperatures. data: Numpy array of data values.

Return type:

temperature

Module contents