MEASURE

2. measure.input - Input file reading

Contains the readInput() function, used to read MEASURE input files. The MEASURE input file format is based on Python syntax, and is in fact a valid Python file. This allows us to easily load the file by defining functions and connecting them to the constructs in the input file. If the reading of the input file is unsuccessful, an InputError will be raised.

class measure.input.InputError

An exception that is raised when a MEASURE input file is invalid for some reason. Pass a string detailing the circumstances of the exceptional behavior.

measure.input.readInput(path)

Reads a MEASURE input file from location path on disk. The input file format is described in the MEASURE Users’ Guide. Returns a number of quantities:

  • The Network object representing the unimolecular reaction network
  • The list of temperatures in K to be used in the master equation calculation
  • The list of pressures in Pa to be used in the master equation calculation
  • A tuple 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
  • The minimum temperature in K at which the fitted interpolation model is valid; this is not necessarily equal to min(Tlist)
  • The maximum temperature in K at which the fitted interpolation model is valid; this is not necessarily equal to max(Tlist)
  • The minimum temperature in Pa at which the fitted interpolation model is valid; this is not necessarily equal to min(Plist)
  • The maximum temperature in Pa at which the fitted interpolation model is valid; this is not necessarily equal to max(Plist)
measure.input.processQuantity(quantity)

Processes a quantity from the input file. The quantity can be a number of things:

  • A list or tuple containing a number and a string with its units (e.g [100,'kJ/mol'])
  • A list or tuple containing a list or tuple of numbers and a string with their units (e.g [(1,2,3), 'm'])
  • A list or tuple of numbers with no units (e.g. [1, 2, 3])
  • A single number with no units

If the quantity has units, then the associated number(s) are converted to SI units using the quantities package. If the quantity does not have units, then it is assumed to be either a dimensionless quantity or a quantity that is already in SI units.

This function returns a tuple containing the number or list of numbers and a string with the units of those numbers.

measure.input.generateThermoFromStates(species)

For a given Species object species with molecular degrees of freedom data in its states attribute, generate a corresponding thermo model. A ThermoGAModel thermodynamics model is stored in the species thermo attribute, and nothing is returned.

measure.input.getTemperaturesForModel(model, Tmin, Tmax, Tcount)

Returns an array of temperatures based on the interpolation model, minimum and maximum temperatures Tmin and Tmax in K, and the number of temperatures Tcount. For Chebyshev polynomials a Gauss-Chebyshev distribution is used; for all others a linear distribution on an inverse temperature domain is used. Note that the Gauss-Chebyshev grid does not place Tmin and Tmax at the endpoints, yet the interpolation is still valid up to these values.

measure.input.getPressuresForModel(model, Pmin, Pmax, Pcount)

Returns an array of pressures based on the interpolation model, minimum and maximum pressures Pmin and Pmax in Pa, and the number of pressures Pcount. For Chebyshev polynomials a Gauss-Chebyshev distribution is used; for all others a linear distribution on an logarithmic pressure domain is used. Note that the Gauss-Chebyshev grid does not place Pmin and Pmax at the endpoints, yet the interpolation is still valid up to these values.

Previous topic

1. Introduction

Next topic

3. measure.network - Unimolecular reaction network objects

This Page