# Demo galaxy: stellar Lyα emission with dust. [AI-Codex]
dataset_type: pointcloud_voronoi
driver_type: mcrtsimulation
device: cpu
log_level: info

dust:
  model: laursen
  variant: LAURSEN_SMC
  z_ref: 0.005
  f_ion: 0.01

pointcloud_voronoi:
  hilbert_bits: 8
  loader: gadget
  gadget:
    path: ./tng50-halo625-gas-stars-v2.hdf5
    fields: [PositionX, PositionY, PositionZ, Temperature, Density, HIdensity,
             VelocityX, VelocityY, VelocityZ, DustAbsorptionCoefficient]
    zoom_box: [[0.4945, 0.5055], [0.4945, 0.5055], [0.4919, 0.5029]]

mcrtsimulation:
  outputpath: output-lya-stellar-dust
  overwrite: true
  linename: Lya
  interactor: ResonantWithDustInteractor
  acc_scheme: Smith15
  use_atau0nl: true
  seed: 121567
  nphotons_max: 100000
  nphotons_step_max: 1000
  nsteps_per_photon_max: 10000  # per launch; unfinished packets resume
  max_steps_without_scatter: 9999
  save_inputphotons: true
  write_inputphotons_restframe: true
  use_peeling: true
  emissionmodel:
    mode: listsource
    listsource:
      loader: gadget
      gadget:
        path: ./tng50-halo625-gas-stars-v2.hdf5
        particle_type: PartType4
        legacy_mode: false
        zoom_box: [[0.4945, 0.5055], [0.4945, 0.5055], [0.4919, 0.5029]]
        luminosity_field: Lya_StellarParticle_Luminosity
        recipe_attributes:
          lya_sfr_window_yr: 1.0e7
          lya_sfr_frac: 1.0
      nphotons_per_unit_lum: 16873.5
      nphotons_per_source_min: 1
      nphotons_per_source_max: 1000000
      lum_threshold_fraction: 0.99
    spectrum:
      shape: gaussian
      recipe: constant
      constant:
        mu: 0.0
        sigma: 30.0  # km/s, unresolved nebular line width
  outputprocessors:
  - type: photon
    streams: [input, original]
  - type: sbmap
    streams: [input, peel]
    units: erg/s/cm2/arcsec2
    observer_redshift: 0.0
    center: [0.509, 0.489, 0.736]
    north: [0.0, 1.0, 0.0]
    nbins_x: 96
    nbins_y: 64
    left_x: 0.401
    right_x: 0.599
    left_y: 0.434
    right_y: 0.566
  - type: apertureSpectrum
    streams: [input, peel]
    units: erg/s
    center: [0.509, 0.489, 0.736]
    north: [0.0, 1.0, 0.0]
    left: -10.0
    right: 10.0
    nbins: 160
    aperture_radii: [10 pkpc, 30 pkpc, 500 pkpc]
