Adding sources
add_source(source) | |
add_point_source(*args, **kwargs) | |
add_spherical_source(*args, **kwargs) | |
add_external_spherical_source(*args, **kwargs) | |
add_external_box_source(*args, **kwargs) | |
add_map_source(*args, **kwargs) | |
add_plane_parallel_source(*args, **kwargs) |
Setting the grid
set_grid(grid) | |
set_cartesian_grid(x_wall, y_wall, z_wall) | |
set_cylindrical_polar_grid(w_wall, z_wall, ...) | |
set_spherical_polar_grid(r_wall, t_wall, p_wall) | |
set_octree_grid(x, y, z, dx, dy, dz, refined) | |
set_amr_grid(description) |
Setting quantities
add_density_grid(density, dust[, ...]) | Add a density grid to the model |
Images/SEDs
add_peeled_images(**kwargs) | |
add_binned_images(**kwargs) |
Configuration
set_seed(seed) | Set the seed for the random number generation |
set_propagation_check_frequency(frequency) | Set how often to check that the photon is in the right cell |
set_monochromatic(monochromatic[, ...]) | Set whether to do the radiation transfer at specific frequencies/wavelengths. |
set_minimum_temperature(temperature) | Set the minimum temperature for the dust |
set_minimum_specific_energy(specific_energy) | Set the minimum specific energy for the dust |
set_n_initial_iterations(n_iter) | Set the number of initial iterations for computing the specific energy in each cell. |
set_raytracing(raytracing) | Set whether to use raytracing for the non-scattered flux |
set_max_interactions(inter_max) | Set the maximum number of interactions a photon can have. |
set_max_reabsorptions(reabs_max) | Set the maximum number of successive reabsorptions by a source that a photon can have. |
set_pda(pda) | Set whether to use the Partial Diffusion Approximation (PDA) |
set_mrw(mrw[, gamma, inter_max]) | Set whether to use the Modified Random Walk (MRW) approximation |
set_convergence(convergence[, percentile, ...]) | Set whether to check for convergence over the initial iterations |
set_kill_on_absorb(kill_on_absorb) | Set whether to kill absorbed photons |
set_forced_first_scattering(...) | Set whether to ensure that photons scatter at least once before escaping the grid. |
set_output_bytes(io_bytes) | Set whether to output physical quantity arrays in 32-bit or 64-bit |
set_sample_sources_evenly(sample_sources_evenly) | If set to ‘True’, sample evenly from all sources and apply |
set_enforce_energy_range(enforce) | Set how to deal with cells that have specific energy rates that are below or above that provided in the mean opacities and emissivities. |
set_copy_input(copy) | Set whether to copy the input data into the output file. |
Running
write([filename, compression, copy, ...]) | Write the model input parameters to an HDF5 file |
run([filename, logfile, mpi, n_processes, ...]) | Run the model (should be called after write()). |
Re-using previous models
read(filename[, only_initial]) | Read in a previous model file |
use_geometry(filename) | Use the grid from an existing output or input file |
use_quantities(filename[, quantities, ...]) | Use physical quantities from an existing output file |
use_sources(filename) | Use sources from an existing output file |
use_image_config(filename) | Use image configuration from an existing output or input file |
use_run_config(filename) | Use runtime configuration from an existing output or input file |
use_output_config(filename) | Use output configuration from an existing output or input file |
Methods (detail)
Add a density grid to the model
Parameters : | density : np.ndarray or grid quantity
dust : str or dust instance
specific_energy : np.ndarray or grid quantity, optional
merge_if_possible : bool
|
---|
Set the seed for the random number generation
Parameters : | seed : int
|
---|
Set how often to check that the photon is in the right cell
During photon propagation, it is possible that floating point issues cause a photon to end up in the wrong cell. By default, the code will randomly double check the position and cell of a photon for every 1 in 1000 cell wall crossings, but this can be adjusted with this method. Note that values higher than around 0.001 will cause the code to slow down.
Parameters : | frequency : float
|
---|
Set whether to do the radiation transfer at specific frequencies/wavelengths.
Parameters : | monochromatic : bool
frequencies : iterable of floats, optional
wavelengths : iterable of floats, optional
If `monochromatic` is True, then one of `frequencies` or : `wavelengths` is required : |
---|
Set the minimum temperature for the dust
Parameters : | temperature : float, list, tuple, or Numpy array |
---|
Notes
This method should not be used in conjunction with set_minimum_specific_energy - only one of the two should be used.
Set the minimum specific energy for the dust
Parameters : | specific_energy : float, list, tuple, or Numpy array |
---|
Notes
This method should not be used in conjunction with set_minimum_temperature - only one of the two should be used.
Set the number of initial iterations for computing the specific energy in each cell.
Parameters : | n_iter : int
|
---|
Set whether to use raytracing for the non-scattered flux
If enabled, only scattered photons are peeled off in the iteration following the initial iterations, and an additional final iteration is carrried out, with raytracing of the remaining flux (sources and thermal and non-thermal dust emission).
Parameters : | raytracing : bool
|
---|
Set the maximum number of interactions a photon can have.
Parameters : | inter_max : int
|
---|
Set the maximum number of successive reabsorptions by a source that a photon can have.
Parameters : | reabs_max : int
|
---|
Set whether to use the Partial Diffusion Approximation (PDA)
If enabled, the PDA is used to compute the specific energy in cells which have seen few or no photons by formally solving the diffusion equations, using the cells with valid specific energies as boundary conditions.
Parameters : | pda : bool
|
---|
References
Min et al. 2009, Astronomy and Astrophysics, 497, 155
Set whether to use the Modified Random Walk (MRW) approximation
If enabled, the MRW speeds up the propagation of photons in very optically thick regions by locally setting up a spherical diffusion region.
Parameters : | mrw : bool
gamma : float, optional
inter_max : int, optional
|
---|
References
Min et al. 2009, Astronomy and Astrophysics, 497, 155
Set whether to check for convergence over the initial iterations
If enabled, the code will check whether the specific energy absorbed in each cell has converged. First, the ratio between the previous and current specific energy absorbed in each cell is computed in each cell, and the value at the specified percentile (percentile) is found. Then, convergence has been achieved if this value is less than an absolute threshold (absolute), and if it changed by less than a relative threshold ratio (relative).
Parameters : | convergence : bool
percentile : float, optional
absolute : float, optional
relative : float, optional
|
---|
Set whether to kill absorbed photons
Parameters : | kill_on_absorb : bool
|
---|
Set whether to ensure that photons scatter at least once before escaping the grid.
Parameters : | forced_first_scattering : bool
|
---|
References
Wood & Reynolds, 1999, The Astrophysical Journal, 525, 799
Set whether to output physical quantity arrays in 32-bit or 64-bit
Parameters : | io_bytes : int
|
---|
If set to ‘True’, sample evenly from all sources and apply probability weight based on relative luminosities. Otherwise, sample equal energy photons from sources with probability given by relative luminosities.
Parameters : | sample_evenly : bool
|
---|
Set how to deal with cells that have specific energy rates that are below or above that provided in the mean opacities and emissivities.
Parameters : | enforce : bool
|
---|
Set whether to copy the input data into the output file.
Parameters : | copy : bool
|
---|
Write the model input parameters to an HDF5 file
Parameters : | filename : str
compression : bool
copy : bool
absolute_paths : bool
wall_dtype : type
physics_dtype : type
overwrite : bool
|
---|
Run the model (should be called after write()).
Parameters : | filename : str, optional
logfile : str, optional
mpi : bool, optional
n_processes : int, optional
overwrite : bool, optional
|
---|
Read in a previous model file
This can be used to read in a previous input file, or the input in an output file (which is possible because the input to a model is stored or linked in an output file).
If you are interested in re-using the final specific energy (and final density, if present) of a previously run model, you can use:
>>> m = Model.read('previous_model.rtout', only_initial=False)
Parameters : | filename : str
only_initial : bool, optional
|
---|
Use the grid from an existing output or input file
Parameters : | filename : str
|
---|
Use physical quantities from an existing output file
Parameters : | filename : str
quantities : list
copy : bool
use_minimum_specific_energy : bool
use_dust : bool
copy : bool
only_initial : bool, optional
|
---|
Use sources from an existing output file
Parameters : | filename : str
|
---|
Use image configuration from an existing output or input file
Parameters : | filename : str
|
---|
Use runtime configuration from an existing output or input file
Parameters : | filename : str
|
---|
Use output configuration from an existing output or input file
Parameters : | filename : str
|
---|