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

Class MCMax

source code


Class that includes all methods required for creating an MCMax model.

Instance Methods [hide private]
 
__init__(self, path_mcmax='runTest', replace_db_entry=0, db=None, new_entries=[], single_session=0)
Initializing an instance of ModelingSession.
source code
 
rayTrace(self, star)
Ray trace the spectrum and images, if requested and not yet finished.
source code
bool
setCommandKey(self, comm_key, star, star_key=None, alternative=None)
Try setting a key in the command_list from a star instance.
source code
bool
compareCommandLists(self, this_list, modellist)
Comparing a command_list with a database entry.
source code
 
cCL(self, *args, **kwargs)
Short-hand helper function for compareCommandLists.
source code
bool
checkDatabase(self)
Checking MCMax database.
source code
 
doMCMax(self, star)
Running MCMax.
source code

Inherited from cc.modeling.codes.ModelingSession.ModelingSession: makeNewId

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, path_mcmax='runTest', replace_db_entry=0, db=None, new_entries=[], single_session=0)
(Constructor)

source code 

Initializing an instance of ModelingSession.

Parameters:
  • db (Database()) - the MCMax database

    (default: None)

  • replace_db_entry (bool) - replace an entry in the MCMax database with a newly calculated model with a new model id (for instance if some general data not included in the inputfiles is changed)

    (default: 0)

  • path_mcmax (string) - modeling folder in MCMax home

    (default: 'runTest')

  • new_entries (list[str]) - The new model_ids when replace_db_entry is 1 of other models in the grid. These are not replaced!

    (default: [])

  • single_session (bool) - If this is the only CC session. Speeds up db check.

    (default: 0)

Overrides: object.__init__

rayTrace(self, star)

source code 

Ray trace the spectrum and images, if requested and not yet finished.

Parameters:
  • star (Star()) - The parameter set for this session

setCommandKey(self, comm_key, star, star_key=None, alternative=None)

source code 

Try setting a key in the command_list from a star instance.

If the key is unknown, it is left open and will be filled in from the standard gastronoom inputfile.

Parameters:
  • comm_key (string) - the name of the keyword in the command list
  • star (Star()) - Parameter set for this session
  • star_key (string) - the name of the keyword in Star() (minus '_%s' %key_type (DUST or GAS), which is added as well in a second attempt if the first without the addition is not found). If None, it's equal to comm_key

    (default: None)

  • alternative (string) - a default value passed from the standard inputfile that is used if the keyword or the keyword + '_%s'%key_type is not found in Star().

    (default: None)

Returns: bool
Success?
Overrides: cc.modeling.codes.ModelingSession.ModelingSession.setCommandKey

compareCommandLists(self, this_list, modellist)

source code 

Comparing a command_list with a database entry.

Parameters:
  • this_list (dict) - parameters in this modeling session
  • modellist (dict) - parameters from database model
Returns: bool
Comparison between the two parameter sets
Overrides: cc.modeling.codes.ModelingSession.ModelingSession.compareCommandLists

cCL(self, *args, **kwargs)

source code 

Short-hand helper function for compareCommandLists.

Overrides: cc.modeling.codes.ModelingSession.ModelingSession.cCL

checkDatabase(self)

source code 

Checking MCMax database.

Returns: bool
The presence of the MCMax model in the database

doMCMax(self, star)

source code 

Running MCMax.

Parameters:
  • star (Star()) - The parameter set for this session