radis.io.dbmanager module

Created on Mon Aug 9 19:42:51 2021

@author: erwan

class DatabaseManager(name, molecule, local_databases, verbose=False, parallel=True, nJobs=- 2, batch_size='auto')[source]

Bases: object

Line Database parser

Parameters
  • name (str) – database name as registered in ~/radis.json

  • molecule (str)

  • local_databases (str) – path to local database

Other Parameters
  • *input for :class:`~joblib.parallel.Parallel` loading of database*

  • parallel (bool) – if True, use parallel loading. Default True.

  • nJobs (int) – Number of processors to use to load a database (useful for big databases). BE CAREFUL, no check is done on processor use prior to the execution ! Default -2: use all but 1 processors. Use 1 for single processor.

  • batch_size (int or 'auto') – The number of atomic tasks to dispatch at once to each worker. When individual evaluations are very fast, dispatching calls to workers can be slower than sequential computation because of the overhead. Batching fast computations together can mitigate this. Default: 'auto'

  • More information in :class:`joblib.parallel.Parallel`

check_deprecated_files(local_files, engine, remove=True)[source]

Check metadata of files and remove the deprecated ones

Unless remove=False: Then raise an error

clean_download_files()[source]

Fully unzipped (and working, as it was reloaded): clean files

Note : we do not let np.DataSource clean its own tempfiles; as they may be downloaded but not fully parsed / registered.

download_and_parse(urlnames, local_files, engine='pytables')[source]
fetch_filenames()[source]
fetch_urlnames() list[source]

“This function should be overwritten by the DatabaseManager subclass

Returns

  • list (list of urlnames)

  • See for instance (py:meth:`radis.io.hitemp.HITEMPDatabaseManager)

get_existing_files(files)[source]

Return files that exist among files

See also

get_filenames()

get_filenames(engine)[source]

Get names of all files in the database (even if not downloaded yet)

See also

get_files_to_download()

get_hdf5_manager(engine)[source]
get_missing_files(files)[source]

Return files that do not exist among files

Note : in ‘vaex’ mode; if “FILE.hdf5” does not exist but “FILE.h5” does (a likely ‘pytables’ file), does not consider it missing so it can be converted automatically

See also

get_filenames()

get_nrows(local_file, engine='pytables')[source]
get_today()[source]
is_downloadable()[source]
is_registered()[source]
load(local_files, isotope, columns, load_wavenum_min, load_wavenum_max, engine='pytables')[source]
Other Parameters

columns (list of str) – list of columns to load. If None, returns all columns in the file.

plot(local_files, isotope, wavenum_min, wavenum_max)[source]

Convenience function to plot linestrengths of the database

register(dict_entries)[source]
remove_local_files(local_files)[source]
open_zip(zipname, mode='r', encoding=None, newline=None)[source]
register_database(databank_name, dict_entries, verbose)[source]

Add to registered databases in RADIS config file.

If database exists, assert it has the same entries.

Parameters

databank_name (str) – name of the database in ~/radis.json config file

Other Parameters

verbose (bool)

Returns

adds to ~/radis.json with all the input parameters. Also adds

format : "hitemp-radisdb"
parfuncfmt : "hapi"   # TIPS-2017 for equilibrium partition functions

And if the molecule is in MOLECULES_LIST_NONEQUILIBRIUM:

levelsfmt : "radis"   # use RADIS spectroscopic constants for rovibrational energies (nonequilibrium)

Return type

None