Skip to content

Datasets

Thor provides several dataset types that define the geometry and basic gas properties for a simulation.
You select one via dataset_type and then add a matching top‑level section in the YAML file.

Overview

dataset_type Geometry Typical use
shellmodel Spherical shell Idealized outflows / Neufeld tests
powerlaw_shellmodel Power‑law shell Radial density / velocity gradients
unigrid Uniform Cartesian grid General 3D grids, Gadget snapshots
infiniteslab Infinite slab (1D in z) Classic slab benchmarks
pointcloud_voronoi Voronoi from particles Gadget point clouds (experimental)

See also: Configuration Reference for global options.

Spherical Shell (shellmodel)

Spherically symmetric shell centered in the unit cube, with inner/outer radius in box units.

dataset_type: 'shellmodel'

shellmodel:
  boxsize: 3.086e21       # cm (physical box size)
  inner_radius: 0.0       # 0.0–0.5, in box units
  outer_radius: 0.1       # 0.0–0.5, in box units
  temperature: 20000.0    # K
  density: 0.078098       # cm^-3 (optional, see below)
  outflow_velocity: 0.0   # cm/s, value at r = outer_radius

Key points:

  • inner_radius, outer_radius are fractions of the box size, limited to [0, 0.5] and must satisfy inner_radius < outer_radius.
  • Gas density can be set in three equivalent ways (pick exactly one):

    • density (volume density in cm⁻³),
    • column_density (cm⁻²) together with boxsize,
    • log_NHI (log10 of column density in cm⁻²).
  • Temperature can be given directly via temperature or derived from an effective cross‑section using:

    • sigma (line‑center cross‑section; requires the emission line from the driver).
  • Dust‑related parameters exist but the current shell implementation initializes dust absorption to zero.

Power‑Law Shell (powerlaw_shellmodel)

Shell with power‑law profiles for density and velocity, building on the same basic parameters as shellmodel.

dataset_type: 'powerlaw_shellmodel'

powerlaw_shellmodel:
  boxsize: 3.086e21
  inner_radius: 0.01
  outer_radius: 0.1
  temperature: 20000.0
  density: 0.078098              # interpreted as mean density

  # Velocity profile v(r) ∝ r^powerlaw_index_velocity
  outflow_velocity: 200e5        # cm/s at r = outer_radius (simple case)
  powerlaw_index_velocity: 1.0

  # Density profile ρ(r) ∝ r^powerlaw_index_density
  powerlaw_index_density: -2.0
  conserve_column_density: true  # renormalize density to match shell column

Key points:

  • All shellmodel density/temperature options are available and interpreted as averages before applying the power law.
  • powerlaw_index_velocity and powerlaw_index_density control the radial scalings.
  • If conserve_column_density: true, the code rescales density so that the line‑of‑sight column matches the corresponding uniform shell.
  • Advanced velocity options:
  • velocity_ratio: ratio between maximum and minimum velocity; used to infer an effective inner radius (see code comments).
  • outflow_velocity_*average: alternative ways to specify the velocity scale; only one of these (or outflow_velocity from the shell) should be used.

Uniform Grid (unigrid)

Cartesian grid with optional domain decomposition and several initialization “loaders”.

dataset_type: 'unigrid'

unigrid:
  ngrid: 64               # cells per dimension (global)
  loader: sphere          # 'sphere', 'cylinder', or 'gadget'
  boxsize: 3.086e21       # cm, required if not implied by the loader

  # Optional: domain decomposition (see configuration.md)
  # domain: [[0.0, 1.0], [0.0, 1.0], [0.0, 1.0]]
  # local_domain_pad: 0.03

Loader: sphere

unigrid:
  ngrid: 64
  loader: sphere
  sphere:
    radius: 0.1           # in box units by default
    density: 0.078098     # cm^-3
    temperature: 20000.0  # K
    velocity: [1.0e5, 0.0, 0.0]  # optional: uniform velocity [vx, vy, vz] in cm/s
    relative_distances: true  # if false, radius is interpreted in physical units

Loader: cylinder (unused/test)

Primarily used for internal/regression tests; not used in shipped example configurations.

unigrid:
  ngrid: 64
  loader: cylinder
  cylinder:
    radius: 0.1           # in box units
    height: 0.5           # extent along x in box units
    density: 0.078098
    temperature: 20000.0

Loader: gadget

Interpolates a Gadget snapshot onto the grid.

unigrid:
  ngrid: 64
  loader: gadget
  gadget:
    path: "./snapdir_099"        # Gadget snapshot root
    interpolator: "ngp"          # 'ngp' (default) or 'sph' (work‑in‑progress)
    boxsize: 1.0e23              # cm, optional override of Gadget header
    pregridded_path: ""          # optional: read pre‑gridded HDF5 instead
    domain_consistency_check: true

Additional options:

  • fields: list of field names to load (case‑insensitive, defaults to density/temperature/velocity for MCRT).
  • When pregridded_path is non‑empty, the code loads data from that HDF5 file instead of performing interpolation.
  • Distributed runs use domain and local_domain_pad from the dataset section, and pbc from the driver, via the common dataset interface.

Infinite Slab (infiniteslab)

One‑dimensional slab along the z‑axis, infinite in x and y (implemented as a single cell in z with special boundary handling).

dataset_type: 'infiniteslab'

infiniteslab:
  boxsize: 3.086e21      # cm
  temperature: 20000.0   # K

  # choose exactly one of:
  density: 0.078098      # cm^-3
  # tau: 1.0             # optical depth (requires emission line)

  # dust (optional)
  tau_dust: 0.0          # effective dust optical depth across half the slab
  density_fluff: 0.0     # density outside the slab (currently unused in main loop)

Key points:

  • Exactly one of density or tau must be specified (the helper enforces a single choice among density, column_density, tau; for slabs column_density is currently not supported and will error if > 0).
  • If tau is used, the code derives density from the line cross‑section and boxsize (requires a valid emission line in the driver).
  • tau_dust sets a constant dust absorption coefficient inside the slab.

Point Cloud (pointcloud_voronoi and variants)

Voronoi tessellation of particles, typically from a Gadget simulation.

dataset_type: 'pointcloud_voronoi'

pointcloud_voronoi:
  hilbert_bits: 4            # 1–10, controls spatial indexing resolution
  loader: "gadget"

  gadget:
    path: "./snapshot"       # Gadget snapshot root
    # optional:
    # fields: ["PositionX", "PositionY", "PositionZ", "Temperature", "Density"]
    # zoom_box: [[xmin, xmax], [ymin, ymax], [zmin, zmax]]
    # zoom_target:           # see PointCloud docs
    #   hid: 12345
    #   rvir: 50.0

Key points:

  • Supported variants (same YAML structure, different interpolator under the hood):

    • pointcloud_voronoi (default, experimental)
    • pointcloud_voronoi_tree (tree‑accelerated, do not use)
    • pointcloud_voronoi_approx (approximate Voronoi, do not use)
    • pointcloud_sph (SPH‑style interpolation, do not use)
  • hilbert_bits controls the resolution of the Hilbert grid used to accelerate neighbor lookups (must be between 1 and 10).

  • Currently, only the gadget loader is supported; it uses the same field naming as the unigrid Gadget loader and adds extra fields as needed for the chosen emission line.
  • Voronoi construction‑specific options are configured under a construction: subsection and documented in detail here.