From e36d01b0000180db813cabceb0f6f843faf29110 Mon Sep 17 00:00:00 2001 From: Stuart Sim Date: Fri, 31 Jan 2014 20:37:41 +0000 Subject: [PATCH 01/11] doc edits --- docs/index.rst | 1 + docs/profilemodel.rst | 117 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 docs/profilemodel.rst diff --git a/docs/index.rst b/docs/index.rst index 6c27b22462e..30858800ab5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -45,6 +45,7 @@ We are using Astropy's excellent workflow - more details can be found at ` Date: Fri, 31 Jan 2014 21:52:31 +0000 Subject: [PATCH 02/11] stuff for example with densiry/abundance profiles --- docs/_static/abund.txt | 11 ++++ docs/_static/density.txt | 12 ++++ docs/_static/tardis_example_profiles.yml | 71 ++++++++++++++++++++++++ docs/profilemodel.rst | 16 +++--- 4 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 docs/_static/abund.txt create mode 100644 docs/_static/density.txt create mode 100644 docs/_static/tardis_example_profiles.yml diff --git a/docs/_static/abund.txt b/docs/_static/abund.txt new file mode 100644 index 00000000000..d6e385f9211 --- /dev/null +++ b/docs/_static/abund.txt @@ -0,0 +1,11 @@ +# index Z=1 - Z=30 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 +1 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 +2 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 +3 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 +4 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 +5 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 +6 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 +7 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 +8 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +9 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/docs/_static/density.txt b/docs/_static/density.txt new file mode 100644 index 00000000000..18ab9729e1d --- /dev/null +++ b/docs/_static/density.txt @@ -0,0 +1,12 @@ +1 day +# index velocity (km/s) density (g/cm^3) +0 9000.0000 5.4869692e-10 +1 10500.000 2.1759646e-10 +2 12000.000 9.7656229e-11 +3 13500.000 4.8170911e-11 +4 15000.000 2.5600000e-11 +5 16500.000 1.4450533e-11 +6 18000.000 8.5733893e-12 +7 19500.000 5.3037103e-12 +8 21000.000 3.3999447e-12 +9 22500.000 2.2474623e-12 diff --git a/docs/_static/tardis_example_profiles.yml b/docs/_static/tardis_example_profiles.yml new file mode 100644 index 00000000000..6668bd1da6c --- /dev/null +++ b/docs/_static/tardis_example_profiles.yml @@ -0,0 +1,71 @@ +#New configuration for TARDIS based on YAML +#IMPORTANT any pure floats need to have a +/- after the e e.g. 2e+5 +#Hopefully pyyaml will fix this soon. +--- +#Currently only simple1d is allowed +tardis_config_version: v1.0 +supernova: + luminosity_requested: 9.44 log_lsun + time_explosion: 13 day + +atom_data: kurucz_atom_pure_simple.h5 + +model: + + structure: + type: file + filename: density.txt + filetype: simple_ascii + v_inner_boundary: 11000 km/s + v_outer_boundary: 20000 km/s + + abundances: + type: file + filename: abund.txt + filetype: simple_ascii + +plasma: + disable_electron_scattering: no + ionization: lte + excitation: lte + radiative_rates_type: dilute-blackbody + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets : 1.0e+5 + iterations: 20 + + black_body_sampling: + start: 1 angstrom + stop: 1000000 angstrom + num: 1.e+6 + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 5 + + convergence_criteria: + type: specific + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start : 500 angstrom + stop : 20000 angstrom + num: 10000 + + + + + + + + + + + + + diff --git a/docs/profilemodel.rst b/docs/profilemodel.rst index 226bc07e034..fa5984eff33 100644 --- a/docs/profilemodel.rst +++ b/docs/profilemodel.rst @@ -46,7 +46,12 @@ The values in the example here define a density profile that is dropping off wit \rho \propto v^{-5} +.. note:: + The grid of points specified in the input fule is interpretted by + TARDIS as defining a grid in which the tabulated velocities are + taken as the outer boundaries of grid cells and the density is + assumed to be uniform with each cell. Stratified abundance profile @@ -90,26 +95,19 @@ TARDIS input file If you create a correctly formatted density profile file (called "density.txt") and abundance profile file (called "abund.txt"), you can use them in TARDIS by putting the following lines in the model section of the yaml file (and remove all other lines from these sections): +.. code-block:: none + model: - structure: - type: file - filename: density.txt - filetype: simple_ascii - v_inner_boundary: 9000 km/s - v_outer_boundary: 22500 km/s abundances: - type: file - filename: abund.txt - filetype: simple_ascii From 11ee5d82eb996d8486396dd693f3eacfb815a77d Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:09:09 -0500 Subject: [PATCH 03/11] deleted a bunch of not needed files --- docs/_static/abund.txt | 11 --- docs/_static/density.txt | 12 --- docs/_static/full_configuration.yml | 120 ----------------------- docs/_static/tardis_example_profiles.yml | 71 -------------- 4 files changed, 214 deletions(-) delete mode 100644 docs/_static/abund.txt delete mode 100644 docs/_static/density.txt delete mode 100644 docs/_static/full_configuration.yml delete mode 100644 docs/_static/tardis_example_profiles.yml diff --git a/docs/_static/abund.txt b/docs/_static/abund.txt deleted file mode 100644 index d6e385f9211..00000000000 --- a/docs/_static/abund.txt +++ /dev/null @@ -1,11 +0,0 @@ -# index Z=1 - Z=30 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 -2 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 -3 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 -4 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 -5 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 -6 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 -7 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 -8 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/docs/_static/density.txt b/docs/_static/density.txt deleted file mode 100644 index 18ab9729e1d..00000000000 --- a/docs/_static/density.txt +++ /dev/null @@ -1,12 +0,0 @@ -1 day -# index velocity (km/s) density (g/cm^3) -0 9000.0000 5.4869692e-10 -1 10500.000 2.1759646e-10 -2 12000.000 9.7656229e-11 -3 13500.000 4.8170911e-11 -4 15000.000 2.5600000e-11 -5 16500.000 1.4450533e-11 -6 18000.000 8.5733893e-12 -7 19500.000 5.3037103e-12 -8 21000.000 3.3999447e-12 -9 22500.000 2.2474623e-12 diff --git a/docs/_static/full_configuration.yml b/docs/_static/full_configuration.yml deleted file mode 100644 index a6973497e70..00000000000 --- a/docs/_static/full_configuration.yml +++ /dev/null @@ -1,120 +0,0 @@ -#IMPORTANT any pure floats need to have a +/- after the e e.g. 2e+5 -#Hopefully pyyaml will fix this soon. ---- -#Currently only simple1d is allowed -config_type: simple1d - -#luminosity any astropy.unit convertible to erg/s -#special unit log_lsun(log(luminosity) - log(L_sun) -luminosity: 9.44 log_lsun - -#time since explosion -time_explosion: 13 day - - -atom_data: ../atom_data/kurucz_atom_chianti_many.h5 - -plasma: - initial_t_inner: 10000 K - initial_t_rad: 10000 K - disable_electron_scattering: no - plasma_type: nebular - #radiative_rates_type - currently supported are lte, nebular and detailed - radiative_rates_type: detailed - #line interaction type - currently supported are scatter, downbranch and macroatom - line_interaction_type : macroatom - w_epsilon : 1.0e-10 - -nlte: - coronal_approximation: True - classical_nebular: False - -model: - structure: - no_of_shells : 20 -# file: -# type : artis -# name : artis_model.dat -# v_lowest: 10000.0 km/s -# v_highest: 20000.0 km/s - - - velocity: - type : linear - v_inner : 1.1e4 km/s - v_outer : 2e4 km/s - - - density: - #showing different configuration options separated by comments - #simple uniform: - #--------------- -# type : uniform -# value : 1e-12 g/cm^3 - #--------------- - - #branch85_w7 - fit of seven order polynomial to W7 (like Branch 85): - #--------------- - type : branch85_w7 - #value : 1e-12 - # default, no need to change! - #time_0 : 19.9999584 s - # default, no need to change! - #density_coefficient : 3e29 - #--------------- - - - abundances: - #file: - # type : artis - # name : artis_abundances.dat - -# abundance_set: -# type: uniform -# name: lucy99 -# nlte_species : [Si2] -# C: 0.01 -# O: 0.01 -# Ne: 0.01 -# Mg: 0.01 -# Si: 0.45 -# S: 0.35 -# Ar: 0.04 -# Ca: 0.03 -# Fe: 0.07 -# Co: 0.01 -# Ni: 0.01 - Cu: 1.00 - - -montecarlo: - seed: 23111963171620 - no_of_packets : 2.e+4 - iterations: 100 - convergence_criteria: - type: specific - damping_constant: 0.5 - threshold: 0.05 - fraction: 0.8 - hold: 3 - - - -# convergence_criteria: -# type: 'tighten' -# tighten_parameters: [1., 1., 0.75, 0.5, 0.25, 0.125] -# convergence_percentage: 0.01 - -# type: 'undampened' -# t_inner_convergence: 0.01 - - -# last_no_of_packets: 2.0e+5 -# no_of_virtual_packets: 10 - - -spectrum: - start : 500 angstrom - end : 20000 angstrom - bins : 1000 - sn_distance : lum_density diff --git a/docs/_static/tardis_example_profiles.yml b/docs/_static/tardis_example_profiles.yml deleted file mode 100644 index 6668bd1da6c..00000000000 --- a/docs/_static/tardis_example_profiles.yml +++ /dev/null @@ -1,71 +0,0 @@ -#New configuration for TARDIS based on YAML -#IMPORTANT any pure floats need to have a +/- after the e e.g. 2e+5 -#Hopefully pyyaml will fix this soon. ---- -#Currently only simple1d is allowed -tardis_config_version: v1.0 -supernova: - luminosity_requested: 9.44 log_lsun - time_explosion: 13 day - -atom_data: kurucz_atom_pure_simple.h5 - -model: - - structure: - type: file - filename: density.txt - filetype: simple_ascii - v_inner_boundary: 11000 km/s - v_outer_boundary: 20000 km/s - - abundances: - type: file - filename: abund.txt - filetype: simple_ascii - -plasma: - disable_electron_scattering: no - ionization: lte - excitation: lte - radiative_rates_type: dilute-blackbody - line_interaction_type: macroatom - -montecarlo: - seed: 23111963 - no_of_packets : 1.0e+5 - iterations: 20 - - black_body_sampling: - start: 1 angstrom - stop: 1000000 angstrom - num: 1.e+6 - last_no_of_packets: 1.e+5 - no_of_virtual_packets: 5 - - convergence_criteria: - type: specific - damping_constant: 1.0 - threshold: 0.05 - fraction: 0.8 - hold: 3 - t_inner: - damping_constant: 1.0 - -spectrum: - start : 500 angstrom - stop : 20000 angstrom - num: 10000 - - - - - - - - - - - - - From 910c069d9f615b4e90accba24d1943ccfa4d2fdb Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:09:55 -0500 Subject: [PATCH 04/11] fixed astropy objects.inv link --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 77b604020ef..c433ac5062d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,7 @@ 'numpy': ('http://docs.scipy.org/doc/numpy/', None), 'scipy': ('http://docs.scipy.org/doc/scipy/reference/', None), 'matplotlib': ('http://matplotlib.sourceforge.net/', None), - 'astropy': ('http://www.astropy.org/', None), + 'astropy': ('http://docs.astropy.org/en/stable/', None), 'h5py': ('http://h5py.alfven.org/docs-2.1/', None), 'pandas': ('http://pandas.pydata.org/pandas-docs/dev/', None) } From 061b9c2a776cc9136b3001f43c4d19ce5987f2e9 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:10:09 -0500 Subject: [PATCH 05/11] fixed the underline being too short --- docs/uses.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/uses.rst b/docs/uses.rst index f682947f930..713d65bf31a 100644 --- a/docs/uses.rst +++ b/docs/uses.rst @@ -2,7 +2,9 @@ What can I do with TARDIS? ************************** -TARDIS is designed to carry out calculations of synthetic supernova spectra (see Kerzendorf & Sim 2014). A TARDIS calculation requires +TARDIS is designed to carry out calculations of synthetic supernova spectra (see Kerzendorf & Sim 2014). + +A TARDIS calculation requires 1) a model for the supernova ejecta (density and composition distribution); 2) that parameters determining the physical and numerical properties of the code are given. @@ -10,22 +12,22 @@ TARDIS is designed to carry out calculations of synthetic supernova spectra (see These inputs are specified via the input file (yaml file). As a starting point, examine the input file in the example download (above). The example file sets up a very simple model in which the density distribution is based on the well-known W7 model (Nomoto et al. 1984; fit following Branch et al. 1985) and in which uniform abundances are specified. To get you started, here is a short list of some settings in that example that can be experimented with to get a feel for using TARDIS. Please contact us if you have questions or would like information on more advanced possibilities! Change the abundances -=============== +===================== In the example file, you can alter the elemental abundances (mass fractions; specified in the "abundances" section). Use this to explore the sensitivity of features to composition. Change the luminosity -============== +===================== You can alter the (emergent) luminosity and see how this affects the synthetic spectrum. Do this by varying the "luminosity requested" in the "supernova" section. Change the epoch -=========== +================ In the example file, you can change the epoch for which the synthetic spectrum is calculated (change the value of "time explosion"; specified in the "supernova" section). When doing this you might also change the inner boundary velocity ("start" value in the "velocity" section), and probably the luminosity (see above)! Experiment with the treatment of line opacity -============================= +============================================= In the "plasma" section you can change the "line interaction type" between "scatter", "downbranch" and "macroatom" - investigate how important fluorescence is in your synthetic spectrum. (See Kerzendorf & Sim and references therein for the meaning of these settings.) From 1a35d49b7630800b1559661d727159ab3ecab333 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:11:52 -0500 Subject: [PATCH 06/11] fixed index structure --- docs/index.rst | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 30858800ab5..efbd598110e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,6 +7,22 @@ rapid spectral modelling of supernovae. The code is described in this documentat .. note:: This documentation is currently under construction and does not describe all of the modes of operations available for TARDIS. + +.. toctree:: + :maxdepth: 1 + + installation + running + gui + uses + profilemodel + atomic + plasma + montecarlo + glossary + zreferences + credits + The code is built on a few principles: * **open** - the code is fully open source and we invite usage and contributions from the community @@ -38,20 +54,7 @@ We are using Astropy's excellent workflow - more details can be found at ` Date: Fri, 31 Jan 2014 19:31:46 -0500 Subject: [PATCH 07/11] restructured into an example section, as well as making literalincludes --- docs/examples/abund.dat | 1 + docs/examples/density.dat | 1 + docs/examples/examples.rst | 10 +++ docs/{ => examples}/profilemodel.rst | 74 ++++++------------- .../tardis_configv1_ascii_density_abund.yml | 1 + docs/index.rst | 2 +- .../tardis_configv1_ascii_density_abund.yml | 4 +- 7 files changed, 38 insertions(+), 55 deletions(-) create mode 120000 docs/examples/abund.dat create mode 120000 docs/examples/density.dat create mode 100644 docs/examples/examples.rst rename docs/{ => examples}/profilemodel.rst (50%) create mode 120000 docs/examples/tardis_configv1_ascii_density_abund.yml diff --git a/docs/examples/abund.dat b/docs/examples/abund.dat new file mode 120000 index 00000000000..7fc5f39eb0a --- /dev/null +++ b/docs/examples/abund.dat @@ -0,0 +1 @@ +../../tardis/io/tests/data/abund.dat \ No newline at end of file diff --git a/docs/examples/density.dat b/docs/examples/density.dat new file mode 120000 index 00000000000..c8ade6bb665 --- /dev/null +++ b/docs/examples/density.dat @@ -0,0 +1 @@ +../../tardis/io/tests/data/density.dat \ No newline at end of file diff --git a/docs/examples/examples.rst b/docs/examples/examples.rst new file mode 100644 index 00000000000..7f150adae81 --- /dev/null +++ b/docs/examples/examples.rst @@ -0,0 +1,10 @@ +************** +Example Models +************** + +Here's an overview of some of the different modes of operation and models for TARDIS + +.. toctree:: + :maxdepth: 1 + + profilemodel \ No newline at end of file diff --git a/docs/profilemodel.rst b/docs/examples/profilemodel.rst similarity index 50% rename from docs/profilemodel.rst rename to docs/examples/profilemodel.rst index fa5984eff33..45abf721452 100644 --- a/docs/profilemodel.rst +++ b/docs/examples/profilemodel.rst @@ -6,25 +6,11 @@ TARDIS can be used to compute a synthetic spectrum for a model with user-specifi Arbitrary density profile -=============== +========================= The density profile is supplied in the form of a simple ascii file that should look something like this: - -.. code-block:: none - - 1 day - # index velocity (km/s) density (g/cm^3) - 0 9000.0000 5.4869692e-10 - 1 10500.000 2.1759646e-10 - 2 12000.000 9.7656229e-11 - 3 13500.000 4.8170911e-11 - 4 15000.000 2.5600000e-11 - 5 16500.000 1.4450533e-11 - 6 18000.000 8.5733893e-12 - 7 19500.000 5.3037103e-12 - 8 21000.000 3.3999447e-12 - 9 22500.000 2.2474623e-12 +.. literalinclude:: density.dat In this file: @@ -34,7 +20,9 @@ In this file: - the remaining lines (ten in our example) give an indexed table of points that specify mass density (g / cm^3) as a function of velocity (km /s). -TARDIS will use this table of density versus velocity to specify the density distribution in the ejecta. For the calculation, TARDIS will use the reference time given in the file to scale the mass densities to whatever epoch is requested by assuming homologous expansion: +TARDIS will use this table of density versus velocity to specify the density distribution in the ejecta. +For the calculation, TARDIS will use the reference time given in the file to scale the mass densities to whatever + epoch is requested by assuming homologous expansion: .. math:: @@ -55,23 +43,16 @@ The values in the example here define a density profile that is dropping off wit Stratified abundance profile -=============== +============================ + +For a model with density profile supplied via a file (see above), uniform abundances can be supplied as normal. +Alternatively, a set of stratified elemental abundances can also be supplied. As with the density, +the abundances are specified via an ascii file. An ascii file that could work with the example density file given + above should be formatted like this: -For a model with density profile supplied via a file (see above), uniform abundances can be supplied as normal. Alternatively, a set of stratified elemental abundances can also be supplied. As with the density, the abundances are specified via an ascii file. An ascii file that could work with the example density file given above should be formatted like this: +.. literalinclude:: abund.dat -.. code-block:: none - # index ; Z=1 - Z=30 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 - 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 - 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0 0.1 0 0.2 0 0.2 0 0 0 0 0 0.2 0.1 0.1 0 0 - 3 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 - 4 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 - 5 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 - 6 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 - 7 0 0 0 0 0 0 0 0.2 0 0 0 0.1 0 0.2 0 0.2 0 0.2 0 0.1 0 0 0 0 0 0 0 0 0 0 - 8 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 9 0 0 0 0 0 0.5 0 0.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 In this file: @@ -91,25 +72,14 @@ The example file shown here has three simple layers: TARDIS input file -========== - -If you create a correctly formatted density profile file (called "density.txt") and abundance profile file (called "abund.txt"), you can use them in TARDIS by putting the following lines in the model section of the yaml file (and remove all other lines from these sections): - -.. code-block:: none - - model: - structure: - type: file - filename: density.txt - filetype: simple_ascii - v_inner_boundary: 9000 km/s - v_outer_boundary: 22500 km/s - - abundances: - type: file - filename: abund.txt - filetype: simple_ascii - - -The specifications for the velocities of the inner and outer boundary values can be neglected (in which case TARDIS will default to using the full velocity range specified in the density.txt file). Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. +================= + +If you create a correctly formatted density profile file (called "density.dat") and abundance profile file (called "abund.dat"), +you can use them in TARDIS by putting the following lines in the model section of the yaml file (and remove all other lines from these sections): + +.. literalinclude:: tardis_configv1_ascii_density_abund.yml + +The specifications for the velocities of the inner and outer boundary values can be neglected +(in which case TARDIS will default to using the full velocity range specified in the density.txt file). +Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. diff --git a/docs/examples/tardis_configv1_ascii_density_abund.yml b/docs/examples/tardis_configv1_ascii_density_abund.yml new file mode 120000 index 00000000000..997fef91c76 --- /dev/null +++ b/docs/examples/tardis_configv1_ascii_density_abund.yml @@ -0,0 +1 @@ +../../tardis/io/tests/data/tardis_configv1_ascii_density_abund.yml \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index efbd598110e..18c84eb4550 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,7 @@ rapid spectral modelling of supernovae. The code is described in this documentat running gui uses - profilemodel + examples/examples atomic plasma montecarlo diff --git a/tardis/io/tests/data/tardis_configv1_ascii_density_abund.yml b/tardis/io/tests/data/tardis_configv1_ascii_density_abund.yml index 6668bd1da6c..3213466206a 100644 --- a/tardis/io/tests/data/tardis_configv1_ascii_density_abund.yml +++ b/tardis/io/tests/data/tardis_configv1_ascii_density_abund.yml @@ -14,14 +14,14 @@ model: structure: type: file - filename: density.txt + filename: density.dat filetype: simple_ascii v_inner_boundary: 11000 km/s v_outer_boundary: 20000 km/s abundances: type: file - filename: abund.txt + filename: abund.dat filetype: simple_ascii plasma: From cf47227cc853536a958721fd50adb2f6bcc272e3 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:33:29 -0500 Subject: [PATCH 08/11] added language to literalinclude --- docs/examples/profilemodel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/profilemodel.rst b/docs/examples/profilemodel.rst index 45abf721452..357558b1b8d 100644 --- a/docs/examples/profilemodel.rst +++ b/docs/examples/profilemodel.rst @@ -78,7 +78,7 @@ If you create a correctly formatted density profile file (called "density.dat") you can use them in TARDIS by putting the following lines in the model section of the yaml file (and remove all other lines from these sections): .. literalinclude:: tardis_configv1_ascii_density_abund.yml - + :language: yaml The specifications for the velocities of the inner and outer boundary values can be neglected (in which case TARDIS will default to using the full velocity range specified in the density.txt file). Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. From 727b602340c290029e63a515e514fe9b6a57a796 Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:35:23 -0500 Subject: [PATCH 09/11] fixed some typos --- docs/examples/profilemodel.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/examples/profilemodel.rst b/docs/examples/profilemodel.rst index 357558b1b8d..1c4ed4c0fa3 100644 --- a/docs/examples/profilemodel.rst +++ b/docs/examples/profilemodel.rst @@ -1,8 +1,10 @@ -************************** -Setting up a model with density and abundance profile -************************** +*********************************************** +Model with custom density and abundance profile +*********************************************** -TARDIS can be used to compute a synthetic spectrum for a model with user-specified density and abundance profiles - this makes it possible to experiment with 1D profiles based on explosion models or with any empirical description of a model with stratified abundances or density. +TARDIS can be used to compute a synthetic spectrum for a model with user-specified density and abundance profiles - +this makes it possible to experiment with 1D profiles based on explosion models or with any empirical description of a + model with stratified abundances or density. Arbitrary density profile @@ -36,7 +38,7 @@ The values in the example here define a density profile that is dropping off wit .. note:: - The grid of points specified in the input fule is interpretted by + The grid of points specified in the input file is interpreted by TARDIS as defining a grid in which the tabulated velocities are taken as the outer boundaries of grid cells and the density is assumed to be uniform with each cell. @@ -60,7 +62,10 @@ In this file: - each row contains 31 numbers, the first of which is the index (i.e. matching the zone to the density profile file) - the remaining 30 entries in each row give the set of elemental abundances for atomic number Z=1 to Z=30 (in order) -The abundances are specified as mass fractions (i.e. the sum of columns 1 to 30 in each row should be 1.0). TARDIS does not currently include any elements heavier that Z=30. The mass fractions specified will be adopted directly in the TARDIS calculations - so if your model is e.g. based on an explosion simulation you may need to calculate the state of any radioactive decay chains at the correct epoch. +The abundances are specified as mass fractions (i.e. the sum of columns 1 to 30 in each row should be 1.0). +TARDIS does not currently include any elements heavier that Z=30. +The mass fractions specified will be adopted directly in the TARDIS calculations - so if your model is +e.g. based on an explosion simulation you may need to calculate the state of any radioactive decay chains at the correct epoch. The example file shown here has three simple layers: @@ -79,6 +84,7 @@ you can use them in TARDIS by putting the following lines in the model section o .. literalinclude:: tardis_configv1_ascii_density_abund.yml :language: yaml + The specifications for the velocities of the inner and outer boundary values can be neglected (in which case TARDIS will default to using the full velocity range specified in the density.txt file). Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. From 1181ca223d4eb9fe3418a95db73123f178213d9d Mon Sep 17 00:00:00 2001 From: Wolfgang Kerzendorf Date: Fri, 31 Jan 2014 19:37:14 -0500 Subject: [PATCH 10/11] fixed some spacing issues --- docs/examples/profilemodel.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/examples/profilemodel.rst b/docs/examples/profilemodel.rst index 1c4ed4c0fa3..5459e3056ef 100644 --- a/docs/examples/profilemodel.rst +++ b/docs/examples/profilemodel.rst @@ -4,7 +4,7 @@ Model with custom density and abundance profile TARDIS can be used to compute a synthetic spectrum for a model with user-specified density and abundance profiles - this makes it possible to experiment with 1D profiles based on explosion models or with any empirical description of a - model with stratified abundances or density. +model with stratified abundances or density. Arbitrary density profile @@ -24,7 +24,7 @@ In this file: TARDIS will use this table of density versus velocity to specify the density distribution in the ejecta. For the calculation, TARDIS will use the reference time given in the file to scale the mass densities to whatever - epoch is requested by assuming homologous expansion: +epoch is requested by assuming homologous expansion: .. math:: @@ -50,7 +50,7 @@ Stratified abundance profile For a model with density profile supplied via a file (see above), uniform abundances can be supplied as normal. Alternatively, a set of stratified elemental abundances can also be supplied. As with the density, the abundances are specified via an ascii file. An ascii file that could work with the example density file given - above should be formatted like this: +above should be formatted like this: .. literalinclude:: abund.dat From 2fa1172550aa81d8951660b0c9bfdce2489fb0c4 Mon Sep 17 00:00:00 2001 From: Stuart Sim Date: Mon, 3 Feb 2014 13:02:02 +0000 Subject: [PATCH 11/11] Accepted changes to documentation --- docs/examples/examples.rst | 20 ++++- docs/examples/profilemodel.rst | 24 ++++- docs/examples/profileuniform.rst | 90 +++++++++++++++++++ ...tardis_configv1_ascii_density_uniabund.yml | 1 + ...tardis_configv1_ascii_density_uniabund.yml | 75 ++++++++++++++++ 5 files changed, 206 insertions(+), 4 deletions(-) create mode 100644 docs/examples/profileuniform.rst create mode 120000 docs/examples/tardis_configv1_ascii_density_uniabund.yml create mode 100644 tardis/io/tests/data/tardis_configv1_ascii_density_uniabund.yml diff --git a/docs/examples/examples.rst b/docs/examples/examples.rst index 7f150adae81..d6f11b4a863 100644 --- a/docs/examples/examples.rst +++ b/docs/examples/examples.rst @@ -2,9 +2,27 @@ Example Models ************** + Here's an overview of some of the different modes of operation and models for TARDIS .. toctree:: :maxdepth: 1 - profilemodel \ No newline at end of file + profileuniform + + profilemodel + + +.. note:: + + Increasing the number of virtual packets will improve the + signal-to-noise of TARDIS spectra. You may wish to consider using a + filter (e.g. Savitzky–Golay) to suppress the Monte Carlo noise for + some applications. + +.. warning:: + + The usefulness of any TARDIS calculations depends on the + quality of the input atomic data. For further information on the atomic data - + including details of how to develop your own dataset to suit your + needs - please contact us. diff --git a/docs/examples/profilemodel.rst b/docs/examples/profilemodel.rst index 5459e3056ef..4f890515936 100644 --- a/docs/examples/profilemodel.rst +++ b/docs/examples/profilemodel.rst @@ -43,6 +43,11 @@ The values in the example here define a density profile that is dropping off wit taken as the outer boundaries of grid cells and the density is assumed to be uniform with each cell. +.. warning:: + + The example given here is to show the format only. It is not a + realistic model. In any real calculation better resolution + (i.e. more grid points) should be used. Stratified abundance profile ============================ @@ -75,6 +80,18 @@ The example file shown here has three simple layers: - an outer region (indices 8 and 9) that is composed of C (Z=6) and O. +.. warning:: + + The example given here is to show the format only. It is not a + realistic model. In any real calculation better resolution + (i.e. more grid points) should be used. + +.. warning:: + + The calculation can be no better / more complete than the atomic + data set. For further information on the atomic database - + including details of how to develop your own dataset to suit your + needs, please contact us. TARDIS input file ================= @@ -85,7 +102,8 @@ you can use them in TARDIS by putting the following lines in the model section o .. literalinclude:: tardis_configv1_ascii_density_abund.yml :language: yaml -The specifications for the velocities of the inner and outer boundary values can be neglected -(in which case TARDIS will default to using the full velocity range specified in the density.txt file). -Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. +.. note:: + The specifications for the velocities of the inner and outer boundary values can be neglected + (in which case TARDIS will default to using the full velocity range specified in the density.txt file). + Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. diff --git a/docs/examples/profileuniform.rst b/docs/examples/profileuniform.rst new file mode 100644 index 00000000000..d1cebbad193 --- /dev/null +++ b/docs/examples/profileuniform.rst @@ -0,0 +1,90 @@ +*********************************************** +Model with custom density profile and uniform abundances +*********************************************** + +TARDIS can be used to compute a synthetic spectrum for a model with a +user-specified density and chosen set of abundances - +this makes it possible to experiment with 1D density profiles and +simple specifications of the composition + + +Arbitrary density profile +========================= + +The density profile is supplied in the form of a simple ascii file that should look something like this: + +.. literalinclude:: density.dat + +In this file: + +- the first line gives the reference time (see below) + +- (the second line in our example is a comment) + +- the remaining lines (ten in our example) give an indexed table of points that specify mass density (g / cm^3) as a function of velocity (km /s). + +TARDIS will use this table of density versus velocity to specify the density distribution in the ejecta. +For the calculation, TARDIS will use the reference time given in the file to scale the mass densities to whatever +epoch is requested by assuming homologous expansion: + +.. math:: + + \rho (t_{exp}) = \rho (t_{ref}) (t_{ref} / t_{exp})^{3} + +The values in the example here define a density profile that is dropping off with + +.. math:: + + \rho \propto v^{-5} + +.. note:: + + The grid of points specified in the input file is interpreted by + TARDIS as defining a grid in which the tabulated velocities are + taken as the outer boundaries of grid cells and the density is + assumed to be uniform with each cell. + +.. warning:: + + The example given here is to show the format only. It is not a + realistic model. In any real calculation better resolution + (i.e. more grid points) should be used. + +Uniform abundances +============================ + +For a model with density profile supplied via a file (see above), +uniform abundances can be supplied directly in the input (yaml) +file. Elemental abundances are set in the "abundances" subsection of the "model" +section, following the "type: uniform" specifier (see example input +file below). They are specified as mass fractions. E.g. + +.. code-block:: none + + Si: 0.6 + S: 0.4 + +will set the mass fraction of silicon (Z=14) to 0.6 and sulphur (Z=16) to 0.4. + +.. note:: + + The mass fractions must sum to one. If mass fractions are supplied that do not sum to one, TARDIS will + renormalise all the supplied abundances and print a "WARNING" message. + + +TARDIS input file +================= + +If you create a correctly formatted density profile file (called +"density.dat"), here is an example of how it can be combined with a uniform set of +abundances: + +.. literalinclude:: tardis_configv1_ascii_density_uniabund.yml + :language: yaml + +.. note:: + + The specifications for the velocities of the inner and outer boundary values can be neglected + (in which case TARDIS will default to using the full velocity range specified in the density.txt file). + Values for the boundary velocities that lie outside the range covered by density.txt will not be accepted. + diff --git a/docs/examples/tardis_configv1_ascii_density_uniabund.yml b/docs/examples/tardis_configv1_ascii_density_uniabund.yml new file mode 120000 index 00000000000..7baec5a1656 --- /dev/null +++ b/docs/examples/tardis_configv1_ascii_density_uniabund.yml @@ -0,0 +1 @@ +../../tardis/io/tests/data/tardis_configv1_ascii_density_uniabund.yml \ No newline at end of file diff --git a/tardis/io/tests/data/tardis_configv1_ascii_density_uniabund.yml b/tardis/io/tests/data/tardis_configv1_ascii_density_uniabund.yml new file mode 100644 index 00000000000..f1d596f89b3 --- /dev/null +++ b/tardis/io/tests/data/tardis_configv1_ascii_density_uniabund.yml @@ -0,0 +1,75 @@ +#New configuration for TARDIS based on YAML +#IMPORTANT any pure floats need to have a +/- after the e e.g. 2e+5 +#Hopefully pyyaml will fix this soon. +--- +#Currently only simple1d is allowed +tardis_config_version: v1.0 +supernova: + luminosity_requested: 9.44 log_lsun + time_explosion: 13 day + +atom_data: kurucz_atom_pure_simple.h5 + +model: + + structure: + type: file + filename: density.dat + filetype: simple_ascii + v_inner_boundary: 11000 km/s + v_outer_boundary: 20000 km/s + + abundances: + type: uniform + O: 0.19 + Mg: 0.03 + Si: 0.52 + S: 0.19 + Ar: 0.04 + Ca: 0.03 + +plasma: + disable_electron_scattering: no + ionization: lte + excitation: lte + radiative_rates_type: dilute-blackbody + line_interaction_type: macroatom + +montecarlo: + seed: 23111963 + no_of_packets : 1.0e+5 + iterations: 20 + + black_body_sampling: + start: 1 angstrom + stop: 1000000 angstrom + num: 1.e+6 + last_no_of_packets: 1.e+5 + no_of_virtual_packets: 5 + + convergence_criteria: + type: specific + damping_constant: 1.0 + threshold: 0.05 + fraction: 0.8 + hold: 3 + t_inner: + damping_constant: 1.0 + +spectrum: + start : 500 angstrom + stop : 20000 angstrom + num: 10000 + + + + + + + + + + + + +