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

Module MCMax

source code

Running MCMax and managing output from MCMax.

Author: R. Lombaert

Classes [hide private]
  MCMax
Class that includes all methods required for creating an MCMax model.
Functions [hide private]
(array,array)
readModelSpectrum(dpath, rt_spec=1, fn_spec='spectrum45.0.dat')
Read the model output spectrum.
source code
dict
readVisibilities(dpath, fn_vis='visibility01.0.dat')
Read the model output visibilities, either as function of wavelength or baseline.
source code
 
rayTrace(rt_type, model_id='', path_mcmax='', modelfolder='', outputfolder='', inputfilename='', nosource=0, redo=0, inclination=45.0)
Ray trace an MCMax model.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.modeling.codes'
Function Details [hide private]

readModelSpectrum(dpath, rt_spec=1, fn_spec='spectrum45.0.dat')

source code 

Read the model output spectrum.

If no ray-tracing is requested or no ray-tracing output is found, the average of the MC spectra is taken.

Parameters:
  • dpath (string) - folder that contains the MCMax outputfiles
  • rt_spec (bool) - If a ray-traced spectrum is requested

    (default: 1)

  • fn_spec (str) - The filename of the ray-traced spectrum. Typically this is the default name, but can be different depending on the ray-tracing angle (inclination) that is used. Not used if MCSpec are used.

    (default: spectrum45.0.dat)

Returns: (array,array)
The wavelength and flux grids (micron,Jy)

readVisibilities(dpath, fn_vis='visibility01.0.dat')

source code 

Read the model output visibilities, either as function of wavelength or baseline.

Parameters:
  • dpath (string) - folder that contains the MCMax outputfiles
  • fn_spec (str) - The filename of the ray-traced visibilities. Typically this is the default name, but can be different depending on the inclination that is used.

    (default: visibility01.0.dat)

Returns: dict
A dictionary containing either wavelength or baseline, the flux, and the visibilities for either given baselines or wavelengths

rayTrace(rt_type, model_id='', path_mcmax='', modelfolder='', outputfolder='', inputfilename='', nosource=0, redo=0, inclination=45.0)

source code 

Ray trace an MCMax model. If output of the requested type and inclination is found the ray tracing is NOT done anew. Ask for redo_rt if the ray tracing must be re-done.

Alternatively, request a different location for the output. The resulting model observations are moved to the new folder, so that any ray tracing is always re-done when called anew.

Parameters:
  • rt_type (str) - The type of output requested. One of ['spec','image', 'vis','basevis'] for spectrum, images, visibilities as function of wavelength, visibilities as function of baseline respectively. Requires, respectively, Spec.out, Image.out, Visibilities.out, Basevis.out as observation files in cc.path.mobs.
  • model_id (string) - the model_id of the requested model. Only required when model_folder is not given.

    (default: '')

  • path_mcmax (str) - modeling folder in MCMax home. Only required if model_folder is not given.

    (default: '')s

  • model_folder (str) - The location of the model_folder. path_mcmax and model_id are ignored if this is given. This folder is checked for existing model observations, in which case the ray tracing is not done.

    (default: '')

  • outputfolder (str) - The location of the output folder. By default, set at the model folder. This folder is *not* checked for existing model observations.

    (default: '')

  • inputfilename (string) - the inputfilename of the model. if '': filename is inputMCMax_model_YYYY-MM-DDhHH-mm-ss in path_mcmax/ models/.

    (default: '')

  • nosource (bool) - remove the central source from the model observation

    (default: 0)

  • redo (bool) - redo the ray tracing of the spectrum regardless of the spectrum already existing or not

    (default: 0)

  • inclination (float) - The inclination of the observer towards the object.

    (default: 45.0)