Package ComboCode :: Package cc :: Package tools :: Package readers :: Module MlineReader :: Class MlineReader
[hide private]
[frames] | no frames]

Class MlineReader

source code


A Reader for Mline output files.

This class inherits from both PopReader and MolReader, and thus provides spectroscopic information of the molecule as given in the mline output. In principle this information should be identical to what is read by RadiatReader from the GASTRoNOoM spectroscopic input files. This information is read from ml1.

In addition, mline output gives other information calculated by the radiative transfer, and that is available here as well. The level populations specifically are managed through methods in PopReader. This class then also provides additional data such as source function, optical depth, etc. This information is read from ml3.

MlineReader only depends on GASTRoNOoM output and does not require information from the databases or input files.

Instance Methods [hide private]
new empty dictionary

__init__(self, fn, *args, **kwargs)
Creating an Mline object ready for reading Mline output.
source code
 
read(self)
Read the mline output files ml1 and ml3.
source code
 
__readML1(self)
Read molecule spectroscopic properties and basic circumstellar radial profiles from the ml1 file.
source code
 
__readML3(self)
Read the information from the ML3 file.
source code
array
getProp(self, prop)
Return a radial circumstellar profile associated with the impact parameter grid for the molecule of this mline model.
source code

Inherited from cc.tools.readers.MolReader.MolReader: getLEnergy, getLI, getLWeight, getTEinsteinA, getTFrequency, getTI, getTLower, getTUpper

Inherited from cc.tools.readers.SpectroscopyReader.SpectroscopyReader: get

Inherited from cc.tools.readers.PopReader.PopReader: getInterp, getP, getPop, plotPop, setInterp, setNY, setP, setPop

Inherited from cc.tools.readers.Reader.Reader: getFile, readFile

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, fn, *args, **kwargs)
(Constructor)

source code 

Creating an Mline object ready for reading Mline output.

Reading mline output through full filename, including filepath.

The mlinefile number is given as *, which is then replaced as needed.

The wildcard character does not have to be present, and is inserted automatically. It is handled down the line by the parent classes.

Additional args and kwargs are passed to the dict creation (parent of Reader)

Note that properties based on the filename are saved as instance properties (such as id, molecule name, filename).

Parameters:
  • fn (string) - The mline filename, including filepath. The mline file number is given by *.
Returns:
new empty dictionary

Overrides: object.__init__

read(self)

source code 

Read the mline output files ml1 and ml3.

The information is stored in the instance dictionary.

Overrides: cc.tools.readers.PopReader.PopReader.read

__readML1(self)

source code 

Read molecule spectroscopic properties and basic circumstellar radial profiles from the ml1 file.

This is the information that is returned by MolReader methods.

Note that the level indexing is J + 1 for simple molecules like CO. For any molecule, the 0-energy level has index 1!

Note also that the vel in the ml1 file is the velocity profile divided by the stochastic velocity. (see source_common/vel.f) The velocity profile saved here is the real velocity profile, corrected for this.

__readML3(self)

source code 

Read the information from the ML3 file.

This includes in six blocks, with subblocks for each impact parameter:

  • Scattering integral (si)
  • Source function (sf)
  • Line opacities (lo): if negative (or 1e-60 when use_no_maser_option=1) the line is masing.
  • Number densities (pop)
  • Derivative of scat int wrt line opacity times line opacity at line center (DsiDloXlo) (see GASTRoNOoM src code source_mline/lamit.f for details: D1)
  • Derivative of scat int wrt src function times src function at line center (DsiDsfXsf) (see GASTRoNOoM src code source_mline/lamit.f for details: D2)

getProp(self, prop)

source code 

Return a radial circumstellar profile associated with the impact parameter grid for the molecule of this mline model.

The impact parameter grid in cm is available through getP().

Parameters:
  • prop (str) - The requested property. One of p_rstar, vel (km/s), nmol (cm^-3), nh2 (cm^-3), amol, Tg (K), Td (K).
Returns: array
The abundance profile