Skip to content

Instantly share code, notes, and snippets.

@dmentipl
Last active April 28, 2025 05:09
Show Gist options
  • Save dmentipl/30c581e580e0dd1682708249d0fddcc6 to your computer and use it in GitHub Desktop.
Save dmentipl/30c581e580e0dd1682708249d0fddcc6 to your computer and use it in GitHub Desktop.
Post-processing Phantom dump files with MCFOST

Using MCFOST with Phantom

The MCFOST documentation is at http://ipag-old.osug.fr/~pintec/mcfost/docs/html/overview.html.

Acquiring and setting up mcfost

Email Christophe to ask for permission, and a link to download the tar ball with MCFOST.

First, extract the files.

tar -xvzf mcfost.tgz

Make a directory to store mcfost binary and utility files.

mkdir ~/mcfost/bin
mkdir ~/mcfost/utils

Setup mcfost.

mv mcfost ~/mcfost/bin
export MCFOST_UTILS=~/mcfost/utils
cd ~/mcfost/bin
./mcfost -setup

Note that MCFOST carries the following disclaimer

*          MCFOST DISCLAIMER              *
*    @ C. Pinte, F. Menard, G. Duchene    *
*                                         *
* MCFOST is available on a collaborative  *
* basis. Using MCFOST implies that you    *
* agree to :                              *
*  - offer us co-author right on any      *
* resulting publication.                  *
*  - NOT distribute MCFOST without our    *
* explicit agreement.                     *
*  - contact us if you initiate a new     *
* scientific project with MCFOST.         *

Basic usage

To get the version of mcfost:

./mcfost -v

To see the list of options:

./mcfost

Note

Many of these options will not work with phantom dumps.

To use with a Phantom dump file, specify the "parameter file", and phantom dump:

./mcfost disc.para -phantom disc_00100

Modifying the parameter file

Use the parameter file ref3.0_3D.para as a starting point.

Here are some important sections for post-processing Phantom dump files.

Number of photons for temperature and image calculation

You may need to use 10^6 or 10^7 photons to compute the temperature, and to produce an image.

#Number of photon packages
  1.28e6                  nbr_photons_eq_th  : T computation
  1.28e3                  nbr_photons_lambda : SED computation
  1.28e6                  nbr_photons_image  : images computation

Turn off SED computation

You probably don't want to compute an SED if you have a Phantom dump file.

T F T                   compute temperature?, compute sed?, use default wavelength grid for ouput ?

Turn off image symmetries

You don't want image symmetries if you have a Phantom dump file.

#Symetries
  F                       image symmetry
  F                       central symmetry
  F                       axial symmetry (important only if N_phi > 1)

Can ignore the following, they come from the phantom dump

#Grid geometry and size
#Disk physics
#Number of zones : 1 zone = 1 density structure + corresponding grain properties

Density structure

Density comes from phantom, so can ignore "#Density structure" however you need to set "gas-to-dust mass ratio":

1.e-3    100.           dust mass,  gas-to-dust mass ratio

Unsure

I haven't modified the following sections. So beware, check with the docs, or with Christophe.

#Wavelength
#Scattering method
#Grain properties
#Star properties

Making images

#Maps
  1000 1000 160.          grid (nx,ny), size [AU]
  25.  25.  1  F          RT: imin, imax, n_incl, centered ?
  0.   0.   1             RT: az_min, az_max, n_az angles
  60.                     distance (pc)
  0.                      disk PA
  • grid: number of pixels in image
  • size: set this in relation to you phantom dump
  • imin, imax: inclination of disc
  • PA: is position angle around which you incline the disc
  • az_min, az_max: rotate the disc (e.g. to align features with real observations)
  • distance: this sets the flux

Making dust thermal emission images

Calculate temperature first:

./mcfost disc.para -phantom disc_00100

Then make the image. Specify wavelength in micron, and use CASA flag to be compatible if you want to post-process with, for example, the CASA ALMA simulator.

./mcfost disc.para -phantom disc_00100 -img 870 -casa

The image file as a compressed fits file is in folder data_870.

Making scattered light images

Calculate temperature first (which you don't have to do if you already have previously):

./mcfost disc.para -phantom disc_00100

Then make the image. Again the wavelength is in micron.

./mcfost disc.para -phantom disc_00100 -img 1.6

The image file as a compressed fits file is in folder data_1.6.

Note that we didn't use the CASA flag as this is a scattered light image, not sub-mm. As a consequence, the fits file contains Stokes polarization parameters: I, Q, U, V.

Making CO emission maps

To calculate, for example, CO J=3-2 (870 micron), for radial velocities from -10 km/s to +10 km/s in delta v of 0.05 km/s (200 channels):

#Molecular RT settings
  T T T 15.               lpop, laccurate_pop, LTE, profile width (km.s^-1)
  0.05                     v_turb (delta)
  1     nmol
  [email protected] 6           molecular data filename, level_max
  10 100                  vmax (km.s^-1), n_speed
  T 1.e-4 abundance.fits.gz   cst molecule abundance ?, abundance, abundance file
  T  1                    ray tracing ?,  number of lines in ray-tracing
  2                       transition numbers

For molecular emission the temperature and image (cube) are made at the same time.

./mcfost disc.para -phantom disc_00100 -mol

The compressed fits file is in the folder data_mol. It contains the velocity channel maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment