Radmc3d

class sf3dmodels.rt.Radmc3d(GRID, nphot=None)[source] [edit on github]

Bases: sf3dmodels.rt.MakeDatatab

Base class for radmc3d related objects. Contains base functions to write formatted files to perform Radiative Transfer calculations with RADMC-3D.

  • Input units: SI (metres, kilograms, seconds).
  • Output units: cgs (centimetres, grams, seconds).
Parameters:
GRID : Struct

Grid structure hosting the model.

Notes

Available grid [0,1,2,3] and physical properties for Radmc3d, their ids and description:

prop key id Description
id 0 cell id
x 1 x coordinate
y 2 y coordinate
z 3 z coordinate
dens_ion 4 Ionized Hydrogen density
dens_e 5 Electronic density
dens_dust 6 Dust density
temp_gas 7 Gas temperature
temp_dust 8 Dust temperature
vel_x 9 Velocity along x-axis
vel_y 10 Velocity along y-axis
vel_z 11 Velocity along z-axis
microturbulence 12 Microturbulent velocity

Methods Summary

write_amr_grid(self[, iformat, grid_style, …]) Writes the file ‘amr_grid.inp’ for radmc3d.
write_dust_density(self, dens_dust[, …]) Writes the file ‘dust_density.inp’ for radmc3d.
write_dust_temperature(self, temp_dust[, fmt]) Writes the file ‘dust_temperature.inp’ for radmc3d.
write_electron_numdens(self, dens_e[, fmt]) Writes the file ‘electron_numdens.inp’ for radmc3d.
write_gas_temperature(self, temp_gas[, fmt]) Writes the file ‘gas_temperature.inp’ for radmc3d.
write_gas_velocity(self, vel[, fmt]) Writes the file ‘gas_velocity.inp’ for radmc3d.
write_ion_numdens(self, dens_ion[, fmt]) Writes the file ‘ion_numdens.inp’ for radmc3d.
write_microturbulence(self, microturbulence) Writes the file ‘microturbulence.inp’ for radmc3d.
write_mol_density(self, dens_mol[, species, fmt]) Writes the file ‘numberdens_XXX.inp’ for radmc3d.
write_radmc3d_control(self, \*\*kwargs) Writes the control file ‘radmc3d.inp’.
write_stars(self[, nstars, pos, rstars, …]) Writes the file ‘stars.inp’ for radmc3d.
write_wavelength_micron(self[, lam, nxx, fmt]) Writes the file ‘wavelength_micron.inp’ for radmc3d.

Methods Documentation

write_amr_grid(self, iformat=1, grid_style=0, coord_system=0, grid_info=0, include_dim=[1, 1, 1], conv_to_cm=True)[source] [edit on github]

Writes the file ‘amr_grid.inp’ for radmc3d.

Parameters:
iformat : int, optional

Defaults to 1.

grid_style : int, optional

Defaults to 0.

coord_system : int, optional

Defaults to 0.

grid_info : int, optional

Defaults to 0.

include_dim : array_like, optional

Defaults to [1,1,1]

write_dust_density(self, dens_dust, nrspec=1, fmt='%13.6e')[source] [edit on github]

Writes the file ‘dust_density.inp’ for radmc3d.

Parameters:
dens_dust : list or array_like, shape(n,)

The model dust density (in \(kg/m^3\)).

fmt : str

Format string for numbers in the output file.

write_dust_temperature(self, temp_dust, fmt='%13.6e')[source] [edit on github]

Writes the file ‘dust_temperature.inp’ for radmc3d.

Parameters:
temp_dust : list or array_like, shape(n,)

The model dust temperature.

fmt : str

Format string for numbers in the output file.

write_electron_numdens(self, dens_e, fmt='%13.6e')[source] [edit on github]

Writes the file ‘electron_numdens.inp’ for radmc3d.

Parameters:
dens_ion : list or array_like, shape(n,)

The model electronic number density.

fmt : str

Format string for numbers in the output file.

write_gas_temperature(self, temp_gas, fmt='%13.6e')[source] [edit on github]

Writes the file ‘gas_temperature.inp’ for radmc3d.

Parameters:
temp_gas : list or array_like, shape(n,)

The model gas temperature.

fmt : str

Format string for numbers in the output file.

write_gas_velocity(self, vel, fmt='%13.6e')[source] [edit on github]

Writes the file ‘gas_velocity.inp’ for radmc3d.

Parameters:
vel : list or array_like, shape(3,n)

The model velocity in x,y,z: [vel_x, vel_y, vel_z]

fmt : str

Format string for numbers in the output file.

write_ion_numdens(self, dens_ion, fmt='%13.6e')[source] [edit on github]

Writes the file ‘ion_numdens.inp’ for radmc3d.

Parameters:
dens_ion : list or array_like, shape(n,)

The model ionized hydrogen number density.

fmt : str

Format string for numbers in the output file.

write_microturbulence(self, microturbulence, fmt='%13.6e')[source] [edit on github]

Writes the file ‘microturbulence.inp’ for radmc3d. See the section 7.4.8 at the RADMC-3D manual for further information.

Parameters:
microturbulence : list or array_like, shape(n,)

The model microturbulent broadening.

fmt : str

Format string for numbers in the output file.

write_mol_density(self, dens_mol, species='co', fmt='%13.6e')[source] [edit on github]

Writes the file ‘numberdens_XXX.inp’ for radmc3d.

Parameters:
dens_dust : list or array_like, shape(n,)

The molecular number density (in \(1/m^3\)).

fmt : str

Format string for numbers in the output file.

write_radmc3d_control(self, **kwargs)[source] [edit on github]

Writes the control file ‘radmc3d.inp’.

Parameters:
**kwargs : control parameters for radmc3d.

For example: write_radmc3d_control(nphot=100000, incl_freefree = 1, incl_dust = 0, setthreads = 4) nphot : int, optional Number of photon packages when computing dust temperature via Monte Carlo. Defaults to 1000000

Notes

Have a look at the RADMC-3D manual, section A.1, for a comprehensive list of the available control parameters and their default values.

write_stars(self, nstars=1, pos=[[0.0, 0.0, 0.0]], rstars=[696000000.0], mstars=[1.99e+30], lam=[0.1, 500.0, 20000.0, 40000.0, 300000.0], nxx=[50, 50, 50, 50], flux=[[-5780]], fmt='%.6e')[source] [edit on github]

Writes the file ‘stars.inp’ for radmc3d. Defaults to Sun’s properties.

Parameters:
nstars : scalar

Number of stars invoked.

pos : list of lists or array_like, shape (nstars,3)

[x,y,z] position of each star in meters.

rstars : list or array_like, length nstars

Radii of the stars in meters.

mstars : list or array_like, length nstars

Mass of the stars in kilograms.

lam : list or array_like,

Wavelength intervals, in microns.

nxx : list or array_like, length: len(lam)-1

Number of wavelenghts in each interval

flux : list of lists or array_like, shape (nstars, number of wavelenghts)

Flux from the stars at each wavelength in cgs. If the first number of the list(s) is negative, it is assumed to be the blackbody temperature of the star and the flux is computed accordingly.

fmt : str

Format string for the flux values.

Notes

Have a look at the RADMC-3D manual, section A.7, for further information about the input parameters and scnearios.

write_wavelength_micron(self, lam=[0.1, 500.0, 20000.0, 40000.0, 300000.0], nxx=[50, 50, 50, 50], fmt='%13.6e')[source] [edit on github]

Writes the file ‘wavelength_micron.inp’ for radmc3d.

Parameters:
lam : list or array_like,

Boundaries of the wavelength grid, in microns.

nxx : list or array_like, length: len(lam)-1

Number of wavelengths within each pair of boundaries.

fmt : str

Format string for numbers in the output file.