2.8.1. Export a Snapshot

The Python helper dispatch.select.export2radmc3d() exports DISPATCH snapshot data to RADMC-3D input files.

It supports two output modes:

  • regular Cartesian grids, corresponding to RADMC-3D grid style 0

  • oct-tree AMR grids, corresponding to RADMC-3D grid style 1

Regular-grid export:

import dispatch

sn = dispatch.snapshot(iout=1, run='myrun', data='data')
dispatch.select.export2radmc3d(
    sn,
    path='radmc3d_regular',
    mode='cartesian',
    density='d',
    velocity=('ux', 'uy', 'uz'))

Oct-tree export:

import dispatch

sn = dispatch.snapshot(iout=1, run='myrun', data='data')
dispatch.select.export2radmc3d(
    sn,
    path='radmc3d_octree',
    mode='octree',
    density='d',
    velocity=('ux', 'uy', 'uz'))

Sink-centered local export:

import dispatch

sn = dispatch.snapshot(iout=1, run='myrun', data='data')
dispatch.select.export2radmc3d(
    sn,
    path='radmc3d_sink_zoom',
    mode='octree',
    sink=7,
    levelmax=18,
    npix=128,
    density='d',
    Tdust='Tdust',
    velocity=None)

The exporter writes:

  • amr_grid.inp

  • dust_density.binp

  • optionally dust_temperature.bdat

  • optionally gas_temperature.binp

  • optionally gas_velocity.binp

If the snapshot exposes sn.units or sn.scaling, the exporter writes physical values in RADMC-3D units:

  • length in cm

  • density in g cm^-3

  • velocity in cm s^-1

If no unit metadata is available, values are written in code units.

See also:

  • Options and Cropping for the argument list and crop controls

  • Choosing levelmax for cost versus visual similarity

  • Batch Conversion for timing guidance and concurrent.futures usage

  • Validation for smoke-test usage and reference model paths