radis.api.hitempapi moduleΒΆ

Created on Tue Jan 26 22:40:51 2021

@author: erwan

https://stackoverflow.com/questions/55610891/numpy-load-from-io-bytesio-stream https://stupidpythonideas.blogspot.com/2014/07/three-ways-to-read-files.html

class HITEMPDatabaseManager(name, molecule, local_databases, engine='default', verbose=True, chunksize=100000, parallel=True)[source]ΒΆ

Bases: DatabaseManager

fetch_url_Nlines_wmin_wmax(hitemp_url='https://hitran.org/hitemp/')[source]ΒΆ

requires connexion

fetch_urlnames()[source]ΒΆ

requires connection

get_linereturn_format(opener, urlname, columns)[source]ΒΆ
keep_only_relevant(inputfiles, wavenum_min=None, wavenum_max=None, verbose=True) list[source]ΒΆ

For CO2 and H2O, return only relevant files for given wavenumber range.

If other molecule, return the file anyway. see radis.api.hitempapi.keep_only_relevant()

parse_to_local_file(opener, urlname, local_file, pbar_active=True, pbar_t0=0, pbar_Ntot_estimate_factor=None, pbar_Nlines_already=0, pbar_last=True)[source]ΒΆ

Uncompress urlname into local_file. Also add metadata

Parameters:
  • opener (an opener with an .open() command)

  • gfile (file handler. Filename: for info)

register()[source]ΒΆ

register in ~/radis.json

get_last(b)[source]ΒΆ

Get non-empty lines of a chunk b, parsing the bytes.

keep_only_relevant(inputfiles, wavenum_min=None, wavenum_max=None, verbose=True) list | float[source]ΒΆ

Parser file names for wavenum_format (min and max) and only keep relevant files if the requested range is [wavenum_min, wavenum_max]

Returns:

  • relevant (list of relevant files)

  • files_wmin, files_wmax ((float, float) : wavenum min & max of relevant range)