Skip to content

JSON Input Specification

smangham edited this page Sep 5, 2016 · 6 revisions

This is the development page for the alternate .JSON input file format for Python.

TOP LEVEL GROUPS

  • simulation_parameters: Used for simulation-wide physics switches and numerical details.
  • spectrum: Used for setting the properties for the output spectra
  • reverberation: Optional. Used for setting the properties for any reverb outputs.
  • diagnostics: Optional. Used for setting advanced diagnostics.
  • compact_object: Root of the simulation geometry. Describes the central object.

ALTERNATE TOP-LEVEL GROUPS:

  • ionisation: Break the simulation_parameters entries specific to ionisation cycles out into a separate group. Conceptually good but this group would be small; probably only ionisation mode and adiabatic transfer setting. Potentially ionisation_cycles too, but it feels like that should be in the same group as photons_per_cycle

SIMULATION PARAMETERS

  • photons_per_cycle: Int
  • ionisation_cycles: Int
  • spectral_cycles: Int
  • adiabatic_transfer: Bool, default true. Replacement for Thermal_balance_options(0=everything.on,1=no.adiabatic)
  • ionisation_mode: Char. Can be either a filename for a fixed concentration, or one of the options below which correlate to the old number options as
    • 1 ="OTS"/"On The Spot"
    • 2 = "LTE"/"Local Thermodynamic Equilibrium"
    • 3 = "recalc_bb"/"recalculate_bb"/"ML"/"Mazzali Lucy"
    • 6 = "pairwise_bb"/"MLP"/"ML Pairwise"/"Mazzali Lucy Pairwise"
    • 7 = "pairwise_pow"/"PSM"/"Pairwise Spectral Model"
    • 8 = "matrix_bb"/"MLM"/"Mazzali Lucy Matrix"
    • 9 = "matrix_pow"/"PM"/"Pairwise Matrix"
    • It is possible to just scan the string for keywords, so "Mazzali Lucy" =~ "Lucy Mazzali". The python.json output file produced for each run would expand contractions or legacy terms to the full final description, and add a comment line that detailed the range of options. It could also detail what each actually was?
  • line_transfer_mode: Char. The setup2.c file details that we had previously considered breaking this down, as it encompasses 3 settings; matom mode, scatter mode, and energy transfer mode. If split, the modes would be:
    • scatter_mode: Char
      • "Iso"/"Isotropic"
      • "Aniso"/"Anisotropic"
      • "Broad Aniso"/"Thermally Broadened Anisotropic"
    • line_mode: Char
      • "Abs"/"Absorption"/"Pure Absorption"
      • "Scattering"/"Pure Scattering"
      • "Single"/"Single Scattering"
      • "Escape"/"Trapping"/"Radiation Trapping"
    • macro_atom_mode: Bool/char, default false
      • false
      • "Simple"
      • "Full"/true

VALUE TYPES

Some properties, like distances, should support a range of input formats. The top of an input file should probably have a comment that makes this explicit.

  • Distances:
    • value: Assumed to be in cm
    • {"cm":value}: Value in cm
    • {"ly":value}/{"light years":value}: Value in ly
    • {"radii":value}: Value in multiples of the radius of whatever the current object is (if it has one).
    • {"co_radii":value}: Value in multiples of the radius of the compact object of the model
    • {"disk_radii":value}: Value in multiples of the inner radius of the disk. Object must be a child of the disk.
  • Times:
    • value: Assumed to be in s
    • {"s":value}/{"seconds":value}: Value in seconds
    • {"h":value}/{"hours":value}`: Value in hours
  • Masses:
    • value: Assumed to be in msol
    • {"msol":value}: Value in solar masses
    • {"g":value}/{"grams":value}: Value in grams
    • {"kg":value}/{"kilograms":value}: Value in kilograms
  • Velocity:
    • value: Assumed to be in cm/s
    • {"cm/s":value}: Value in cm/s
    • {"m/s":value}: Value in m/s
    • {"escape_velocity":value}: Value in escape velocities. Context sensitive.
    • {"sound_velocity":value}: Value in speed of sound. Context sensitive.

SPECTRUM

  • spectral_range: float(2).
  • live_or_die: bool, default false
  • photon_sampling: Char. Names and how they link to the old number system are
    • 0 = "Temperature"
    • 1 = "Range"
    • 2 = "CV"
    • 3 = "YSO"
    • 4 = User-defined bands:
      • type: "Bands"
      • energy_range: [float, float] in eV
      • band_bounds: [] of floats in eV
      • band_fractions: [] of floats, total to <1
    • 5 = Cloudy mode:
      • type: "Cloudy"
      • energy_range: [float, float] in eV
    • 6 = "Balance"
    • 7 = "AGN"
    • 8 = Logarithmic bands:
      • type: "Log"/"Logarithmic"/"Logarithmic Bands"
      • energy_range: [float, float] in eV
      • bands: int, default 5

Are any of these modes deprecated?

  • observers: [] of float angles or objects made up of
    • angle: float
    • phase: float, default 0
    • max_scatters: int, default not applied

REVERBERATION

  • mode: char
    • "Simple"
    • "Wind"
    • "Matom"/"Macro-atom"
  • bins: int, required with Wind/Matom
  • zero_disk_lags: bool, default false
  • macro_atom_lines: [] of objects
    • atom: int
    • ion: int
    • level_upper: int
    • level_lower: int
  • vtk_output_bins: int, default 0/no vtk output
  • track_cells:[] of [float x, float z]

DIAGNOSTICS

  • standard_care_factors: bool, default true
  • save_cell_statistics: bool, default false
  • ispy_mode: bool, default false
  • track_resonant_scatters: bool, default false
  • keep_ion_cycle_windsaves: bool, default false
  • save_extract_photons: bool, default false
  • print_windrad_summary: bool, default false
  • print_dvds_info: bool, default false
  • write_atomic_data: bool, default false

COMPACT OBJECT

  • class: char
    • 0 = "Star"
    • 1 = "Binary"
    • 2 = "AGN"
  • mass: float
  • mass_secondary: float, required for binary
  • period: float, required for binary
  • radius: float
  • temperature: float, required for Star/Binary
  • accretion_disk: object, see below
  • source: object or array of objects. If object would just be type, may instead use char type (e.g. source:"BB")
    • type:
      • 0 = "BB"/"Black body"
      • 1 = "Models"
      • 2 = "Uniform"
      • 3 = "PL"/"Power law"
      • 4 = "CL"/"CL Tab"/"Cloudy"/"Cloudy Table"
      • 5 = "Brehm"/"Brehmstrahlung"

Are any of these deprecated? I can't find a SPECTYPE constant for models in python.h. * type_spectral: as type * temperature: float, required for BB/Brehm, defaults to CO temperature * index: float, required for PL/Brehm * cutoff: float, optional for PL * energy_range: [float, float] in eV, required for Cloudy * luminosity: float, required for AGN/BL * radius: float, optional, for spherical sources. Defaults to parent radius. * lamp_post_height: float, optional, for lamp-posts. Overrides radius.

Due to the slightly idiosyncratic nature of Python, a system with an AGN and BL would be expressed in the input file straightforwardly as array of sources, one PL for the boundary layer and one regular AGN, but require converting into an AGN & BL under the hood.

  • disk: object (see below)
  • wind: object (see below)

ACCRETION DISK

  • extended: bool false or object, default false
    • index: float
    • inner_fractional_height: float
  • atmosphere: bool, default false
  • maximum_radius: float
  • accretion_rate: float
  • reflection: char
    • 0 = "Abs"/"Absorption"
    • 1 = "Pure"
    • 2 = "Therm"/"Thermal"/"Thermalised"
    • 3 = "Analytic"
  • temperature: char, "Standard" or filename of profile, default "Standard"
  • source: char, condensed as CO source
    • type: char
      • "BB"/"Black body"
      • Model filename
    • type_spectral: as type
  • wind: object (see below)

WIND

  • type: char
    • 0 = "SV"
    • 1 = "Sphere"/"Stellar"
    • 3 = "Hydro"/"Proga"
    • 4 = "Corona"/"Disk Corona"
    • 5 = "Knigge"
    • 6 = "Homologous"
    • 7 = "YSO"/"Young Stellar Object"

Are any of these deprecated? The structure of the YSO input is a little odd, as it seems like it would read in two sets of launch radii. Easily fixed by having YSOs have two wind objects within them with the "Knigge" and "SV" types and just calling inputs on those, but that makes the duplication far more obvious.

  • input_file: file, required for Hydro
  • fill_factor: float
  • outflow_rate: float, required for Sphere, SV, Elvis, Knigge, Shell
  • outflow_rate_exponent: float, required for SV, Elvis, Knigge
  • density_base: float, required for Corona
  • density_exponent: float, required for Homologous
  • grid:
    • coordinates: char
      • 0 = "1D"/"Sphere"/"Spherical"
      • 1 = "Cyl"/"Cylindrical"
      • 2 = "Polar"/"Spherical Polar"
      • 3 = "Cyl Var"/"Cylindrical Varied"
    • dimensions: [float, float] (or just float for 1D)
  • geometry: object
    • maximum_angle: float, required for Hydro
    • radius: [float, float] required for Corona, Sphere, Homologous, Shell
    • launch_radius: [float, float], required for SV, Elvis, Knigge
    • launch_angles: [float, float], required for SV, Elvis
    • scale_height: float, required for Corona
    • maximum_height: float, required for Corona
    • maximum_extent: float, required for SV, Elvis, Knigge
    • height_offset: float, required for Elvis
    • focus: float, required for Knigge
  • velocity: object
    • base: float, required for Sphere, Knigge, Homologous, Shell
    • maximum: float, required for Shell
    • acceleration_length: float, required for SV, Elvis, Knigge
    • infinity: float, required for Sphere, SV, Elvis, Knigge
    • exponent: float, required for Sphere, SV, Elvis, Knigge, Shell
    • fractional_velocity: float, required for Corona
  • source: bool, default true