Read routines for a MCMax3D Model

This module provides several routines to read the output of a MCMax3D model. All the data belonging to a MCMax3D model is put into an hierachical data structure (DataMCMax3D).

The module provides a routine to read “all” the data of a MCMax3D model and spezialized routines to read only distinct model data (e.g. only the SED of a model).

Usage example

The following example reads the zones files of a MCMax3D model from the current working directory. There are also more spezialed read routines (see mcmax3dpy.read).

import mcmax3dpy.read as mread
import mcmax3dpy.plot as mplot

model=mread.read(modelDir=".",outDir="output")
print(model)

Source documentation

Created on 15 Nov 2017

@author: rab

class mcmax3dpy.read.DataMCMax3D(modelDir='.', outDir=None, name='')[source]

Data container for the outputs of an MCMax3D model.

Parameters:
  • modelDir (string) – The path to the main model directory
  • outDir (string) – The path to the output directory of the model (DEFAULT: modelDir/output)
  • name (string) – A name of the model (DEFAULT: “”).
modelDir = None

The directory of the model.

Type:string
outDir = None

None

Type:string
Type:The output directory of the model. DEFAULT
name = None

empty string

Type:string
Type:An optional name for the model. DEFAULT
zones = None

The zones of the model. see mcmax3dpy.read.Zone for details.

Type:array_like(mcmax3dpy.read.Zone)
MCseds = None

The Monte Carlo Spectral Energy Distribution(s) for the models (SED) see mcmax3dpy.read.SED for details.

Type:array_like(mcmax3dpy.read.SED)
RTseds = None

The raytracing Spectral Energy Distribution(s) for the models (SED) see mcmax3dpy.read.SED for details.

Type:array_like(mcmax3dpy.read.SED)
psizes = None

array with the global dust sizes.

Type:array_like(float,ndim=1)
class mcmax3dpy.read.Zone[source]

Data structure for an MCMax3D Zone.

Currently only works for a spherical grid.

rhodparticle = None

The density of a dust particle. TODO: still harcoded!!!

Type:float
nr = None

Number of radial grid points.

Type:int
nt = None

Number of theta grid points.

Type:int
np = None

Number of phi grid points (azimuthal).

Type:int
r = None

The radial grid points. UNIT: au, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
theta = None

The theta grid points. UNIT: rad, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
phi = None

The theta grid points. UNIT: rad, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
x0 = None

The x zero point of this zones. UNIT: au

Type:float
y0 = None

The y zero point of this zones. UNIT: au

Type:float
z0 = None

The z zero point of this zones. UNIT: au

Type:float
x = None

The cartesian x coordinates. UNIT: au, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
y = None

The cartesian y coordinates. UNIT: au, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
z = None

The cartesian z coordinates. UNIT: au, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
rhod = None

The dust density. UNIT: g cm-3, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
rhog = None

The gas density. UNIT: g cm-3, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
temp = None

The temperature. UNIT: K, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
chi = None

The UV radiation field. UNIT: Drain field, DIMS: (np,nt,nr)

Type:array_like(float,ndim=3)
sd = None

The surfacedensity read from the additional file. Contains the radius and the surfacedensity. UNIT: g/cm2 , DIMS: (nr,2)

Type:array_like(float,ndim=2)
read(infile, psizes=None)[source]
calc_amean(psizes)[source]

Calculate the meand dust size at each point in the disk

integrate_vertical(intfield, outfield, chem_species=False)[source]

Integrates a quantity (intfield) in vertical direction from the top to the midplane of the disk for each field in the grid.

Currently the implementation is rather approximate

class mcmax3dpy.read.SED[source]

Data container for one SED output of MCMax

wl = None

The wavelenghts [micron]

Type:array_like(float,dim=1)
fluxJy = None

The flux of the whole domain [Jy]

Type:array_like(float,dim=1)
fluxJyZones = None

The fluxes for each individual zone.

Type:array_like(float,dim=2)
fluxJyStars = None

The fluxes for each individual Star

Type:array_like(float,dim=2)
mcmax3dpy.read.read_abun_fits(fname)[source]

Reads a fits file the contains the chemical abundances. This file is is produced by the MCMax3D - ProDiMo interface. For more information contact Christian RAb.

Parameters:fname (str) – the file nme of the corresponding fits
Returns:
  • species (array_like(str,ndim=1) :) – a list of all the chemical species names.
  • abun (array_like(float,ndim=4)) – Four dimensional array with the abundances of all chemical species.
mcmax3dpy.read.read_MCSpec(directory)[source]

Tries to read all Monte Carlo SEDs in the give directory and returns them as a list.

Parameters:directory (str) – the directory to search for the SEDs
Returns:a list of SEDs
Return type:array_like(mcmax3dpy.read.SED)
mcmax3dpy.read.read_RTSpec(directory, nzones=1)[source]

Tries to read all Ray Tracing SEDs in the give directory and returns them as a list.

Parameters:directory (str) – the directory to search for the SEDs
Returns:a list of SEDs
Return type:array_like(mcmax3dpy.read.SED)
mcmax3dpy.read.read(modelDir='.', outDir=None, readParticles=False)[source]

Trys to read all the possible output of MCMax3D and puts it into one data structure (see mcmax3dpy.read.DataMCMax3D)

mcmax3dpy.read.read_particle_sizes(directory)[source]

Reads the particle files. This is need to e.g. calculate the mand dust sizes etc.

FIXME: this routine can currently only deal with one particle type and one temperatur.

Returns:Returns a list with the different particle sizes.
Return type:array_like(float,dim=1)
mcmax3dpy.read.read_zones(directory, psizes=None)[source]

Tries to read all Zones fits files in the given directory and returns the results in a list.

Parameters:directory (str) – the directory to search for the Zone files.
Returns:List with all Zone object.
Return type:array_like(mcmax3dpy.read.Zone)