MEASURE

9. measure.output - Output file writing

Contains the writeOutput() method for saving output files to disk and the writeInput() method for saving input files to disk. A number of helper functions are used by both functions due to the high degree of similarity between the input and output file syntax.

9.1. Input and Output File Writing

measure.output.writeInput(path, network, Tlist, Plist, Elist, method, model)

Write a MEASURE input file to path on disk. The parameters needed mirror those returned by readInput():

  • The Network object network representing the unimolecular reaction network
  • The list of temperatures Tlist in K to be used in the master equation calculation
  • The list of pressures Plist in Pa to be used in the master equation calculation
  • A tuple Elist containing the maximum energy grain size in J/mol and the minimum number of energy grains to use in the master equation calculation; whichever of these results in more energy grains
  • The approximate method to use to estimate the phenomenological rate coefficients k(T,P)
  • The interpolation model to fit the estimated k(T,P) values to

If successful, the file created on disk should be able to be read in by readInput() with (hopefully) no loss of fidelity.

measure.output.writeOutput(path, network, Tlist, Plist, Elist, method, model)

Write a MEASURE output file to path on disk. The parameters needed mirror those returned by readInput():

  • The Network object network representing the unimolecular reaction network
  • The list of temperatures Tlist in K to be used in the master equation calculation
  • The list of pressures Plist in Pa to be used in the master equation calculation
  • A tuple Elist containing the maximum energy grain size in J/mol and the minimum number of energy grains to use in the master equation calculation; whichever of these results in more energy grains
  • The approximate method to use to estimate the phenomenological rate coefficients k(T,P)
  • The interpolation model to fit the estimated k(T,P) values to

If successful, the file created on disk will contain all of the species and net reaction data, including all phenomenological rate coefficients k(T,P).

9.2. Helper Functions

measure.output.writeNetworkSpecies(f, network)

Write all species in the given unimolecular reaction network to a file object`f`. All isomer, reactant, product, and bath gas species are automatically written one time each.

measure.output.writeNetworkPathReactions(f, network)

Write all path reactions in the given unimolecular reaction network to a file object`f`. The path reactions are those reactions that directly connect adjacent molecular configurations; these are the reactions that remain in the high-pressure limit.

measure.output.writeNetworkNetReactions(f, network)

Write all net reactions in the given unimolecular reaction network to a file object`f`. The net reactions are those reactions that can connect any pair of molecular configurations, not just those directly adjacent. These are the reactions that have pressure-dependent rate coefficients.

measure.output.writeSpecies(f, spec)

Write a Species object spec to a file object f.

measure.output.writeReaction(f, rxn)

Write a Reaction object rxn to a file object f.

measure.output.writePDepReaction(f, rxn)

Write a Reaction object rxn that has pressure-dependent kinetics to a file object f.

measure.output.writeStates(f, states, prefix='')

Write the StatesModel data states containing molecular degree of freedom data to the file object f. The optional parameter prefix is prepended to each line of the output file, which provides an easy way to adjust the indentation.