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

Class ComboCode

source code


The interface with which to run the ComboCode package.

Instance Methods [hide private]
 
__init__(self, inputfilename)
Initializing a ComboCode instance.
source code
 
startSession(self)
Start a ComboCode session, based on the input read upon initialisation.
source code
 
setGlobalPars(self)
Set the global parameters for this CC session.
source code
 
__setStarName(self)
Set star_name for the ComboCode object as a tuple.
source code
 
setPacs(self)
Collect the PACS relevant parameters from the inputfile and set the PACS object.
source code
 
setSpire(self)
Collect the SPIRE relevant parameters from the inputfile and set the SPIRE object.
source code
 
setSed(self)
Collect the SED data and create an Sed() object.
source code
 
setRadio(self)
Collect the relevant radio data for the requested star.
source code
 
addRadioData(self, sn)
Add radio data to Transition() objects in all Star() objects.
source code
 
setVarPars(self)
Define the list of variable parameters in this CC session.
source code
 
readInput(self)
Read input for ComboCode and return list.
source code
list[Star()]
getStars(self)
Return the list of Star() objects for this ComboCode session.
source code
 
createStarGrid(self)
Create a list of Star() objects based on the inputfile that has been parsed with cc.readInput().
source code
 
setOutputFolders(self)
Set the output folders.
source code
 
setVicManager(self)
Set up the VIC manager.
source code
 
setModelManager(self)
Set up the model manager.
source code
 
setPlotManager(self)
Set up the plot manager(s) for each star name.
source code
 
runModelManager(self)
Start up the modeling.
source code
 
finalizeVic(self)
At the end of a modeling session, allow Vic to be finalized and clean up.
source code
 
runPlotManager(self)
Run the plotting manager.
source code
 
appendResults(self)
Append results at the end of the inputfile.
source code
 
runStatistics(self)
Run the statistics module.
source code
 
runChemistry(self) source code
 
doContDiv(self)
Run the Continuum Division class for this CC session.
source code
 
printStarInfo(self)
Print extra Star() info to the shell.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, inputfilename)
(Constructor)

source code 

Initializing a ComboCode instance.

Once this is done, you only need to run startSession(). Then all methods in this class will be called according to your inputfile. Only run separate methods of the class if you know what you are doing!

Input is read and parsed, and the parameter objects (Star()) are set

The instrument and data objects, and the plotting manager are set.

The .spec file is updated here, if requested.

The inputfile can be given on the command line as: python ComboCode.py inputComboCode.dat

In the python or ipython shell you can do: >>> import ComboCode >>> cc = ComboCode.ComboCode('/home/robinl/ComboCode/input/inputComboCode.dat')

Parameters:
  • inputfilename (string) - The name of the inputfile.
Overrides: object.__init__

startSession(self)

source code 

Start a ComboCode session, based on the input read upon initialisation.

The supercomputer and model managers are set and ran.

The plot manager, statistics module, fitter modules are ran if requested.

The session ends by printing some info about the Star() objects.

Once started, the ComboCode object cannot be started again. You will have to re-initialize. This will change in the future.

__setStarName(self)

source code 

Set star_name for the ComboCode object as a tuple.

Typically this is only one name for a standard modelling session, but can be made multiple names as well for a statistical study.

The ComboCode object keeps track of all the data in dicts.

setRadio(self)

source code 

Collect the relevant radio data for the requested star. Only done if the pathname to the data is given.

If a database is not present, it is created.

If the radio_autosearch flag is on, transitions are automatically generated based on the available data. Note that in this case, N_QUAD from Star() is taken.

addRadioData(self, sn)

source code 

Add radio data to Transition() objects in all Star() objects.

Only done if RADIO_PATH is given and if a file named radio_data.db is present in the given folder.

This method can be called multiple times per session for different stars in which case the data in the transition objects will be replaced.

self.radio_trans maintains a list of "sample transitions" that contain data. These function as data blueprints for transitions in the star_grid

Parameters:
  • sn (str) - The star name for which to add data to the transitions

readInput(self)

source code 

Read input for ComboCode and return list.

The MOLECULE, TRANSITION and R_POINTS_MASS_LOSS parameter formats are checked for errors in this method. If erroneous, an IOError is raised.

getStars(self)

source code 

Return the list of Star() objects for this ComboCode session.

Returns: list[Star()]
The parameter Star() objects are returned.

createStarGrid(self)

source code 

Create a list of Star() objects based on the inputfile that has been parsed with cc.readInput().

The list of Star() objects is saved in self.star_grid, and is accessed through cc.getStarGrid().

setOutputFolders(self)

source code 

Set the output folders.

If the folders do not already exist, they are created.

The locations are saved in cc.path for later use, but this is generally only done inside a ComboCode session. Each module sets these themselves