chemspectranslator is a universal translator for chemical mechanism species

chemspectranslator is an interface to a spreadsheet providing translations between (lumped) species in photochemical mechanisms (such as MOZART, RADM2, SAPRC…) and also observations during field campaigns (FRAPPE, DC3, …). It does its best to calculate reasonable conversion factors, but can only be as good as the underlying dataset.


pip install chemspectranslator

Command-line scripts

Translate species

chemical mechanism species translator.

usage: chemspectranslate [-h] species source dest

Positional Arguments

species One or several (comma-separated) species names to be translated
source Mechanism shortcut from which to translate.
dest Mechanism shortcut to which to translate.


import chemspectranslator
cs = chemspectranslator.Translator()

# How is BIGENE (MOZART_T1 species) represented in RADM2?
result = cs.translate('BIGENE', 'MOZART_T1', 'RADM2')
# result is now a ``TranslationResult``

# Do something with the result:
for prefactor, species in result:
   print("Species {:s} represented with a pre-factor of {:f}".format(species, prefactor))
# Species MACR represented with a pre-factor of 0.647059
# Species HC5 represented with a pre-factor of 0.009804
# Species OLI represented with a pre-factor of 0.807292
# Species ALD represented with a pre-factor of 0.133333
# Species NROG represented with a pre-factor of 0.009346
# Species OLT represented with a pre-factor of 0.853933
# Species TOL represented with a pre-factor of 0.096154
# Species MVK represented with a pre-factor of 0.666667
# Species HC8 represented with a pre-factor of 0.001527

# Convenience function
#  0.647 * MACR +  0.010 * HC5 +  0.807 * OLI +  0.133 * ALD +  0.009 * NROG +  0.854 * OLT +  0.096 * TOL +  0.667 * MVK +  0.002 * HC8



class chemspectranslator.Translator

Google sheets API translator is a chemspectranslator DB that uses the MasterList provided online.


Add a mechanism.

dump(f=<open file '<stdout>', mode 'w'>)

Dump the full DB (might take a while) to <f>. <f> can be a file handle or another connection. Defaults to sys.stdout.


List the full DB (might take a while).


Return a list of mechanism names known to the database.


Does a mechanism name exist in the database?

mergeMechs(mechList, mergedName)

Merge mechanisms in <mechList> and create a new merged mechanism <mergedName>


Takes a string (a full input text field), breaks it (e.g. ‘ 3*A + 3 * B’) into items and removes spaces (e.g. [ ‘3*A’, ‘3 * B’ ] ). Break characters considered are “+” and “;”.


Splits item into prefactor, count and species, e.g. ‘0.4 * TOLUENE’ or ‘3 PAR’.

translate(spec, source, target, caseSensitive=True)

Translate species <spec> from mechanism <source> to mechanism <target>.


List of unique IDs in the translator DB.