[yt-svn] commit/yt-doc: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Oct 25 09:14:44 PDT 2013
3 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/commits/4198effec1a2/
Changeset: 4198effec1a2
User: atmyers
Date: 2013-10-24 01:30:18
Summary: adding docs for the RADMC-3D exporter
Affected #: 3 files
diff -r 6bc4a9e1b8fc5c60e2a1d71ab8c429c8f210b20f -r 4198effec1a20936afbeff614c5541fe6d544732 source/analysis_modules/_images/31micron.png
Binary file source/analysis_modules/_images/31micron.png has changed
diff -r 6bc4a9e1b8fc5c60e2a1d71ab8c429c8f210b20f -r 4198effec1a20936afbeff614c5541fe6d544732 source/analysis_modules/index.rst
--- a/source/analysis_modules/index.rst
+++ b/source/analysis_modules/index.rst
@@ -26,3 +26,4 @@
sunrise_export
ellipsoid_analysis
xray_emission_fields
+ radmc3d_export
diff -r 6bc4a9e1b8fc5c60e2a1d71ab8c429c8f210b20f -r 4198effec1a20936afbeff614c5541fe6d544732 source/analysis_modules/radmc3d_export.rst
--- /dev/null
+++ b/source/analysis_modules/radmc3d_export.rst
@@ -0,0 +1,94 @@
+.. _radmc3d_export:
+
+Exporting to RADMC-3D
+====================
+
+.. sectionauthor:: Andrew Myers <atmyers2 at gmail.com>
+.. versionadded:: 2.6
+
+RADMC-3D is a three-dimensional Monte-Carlo radiative transfer code
+that is capable of handling both line and continuum emission. The RadMC3DWriter
+class can save AMR data to disk in an ACSII format that RADMC-3D recognizes.
+In principle, this allows one to use RADMC-3D to make synthetic observations
+from any simulation data format that yt recognizes.
+
+Continuum Emission
+-----------------
+
+To compute thermal emission intensities, RADMC-3D needs a file called
+"dust_density.inp" that specifies the density of dust for every cell in the AMR
+hierarchy. To generate this file, first import the RADMC-3D exporter, which
+is not loaded into your environment by default:
+
+.. code-block:: python
+
+ from yt.mods import *
+ from yt.analysis_modules.radmc3d_export.api import *
+
+Then, define a field that calculates the dust density in each cell. Here, we assume
+a constant dust-to-gas mass ratio of 0.01:
+
+.. code-block:: python
+
+ dust_to_gas = 0.01
+ def _DustDensity(field, data):
+ return dust_to_gas*data["Density"]
+ add_field("DustDensity", function=_DustDensity)
+
+Now load up a dataset and call the RADMC-3D writer:
+
+.. code-block:: python
+
+ pf = load("galaxy0030/galaxy0030")
+ writer = RadMC3DWriter(pf)
+
+ writer.write_amr_grid()
+ writer.write_dust_file("DustDensity", "dust_density.inp")
+
+The method write_amr_grid() creates an "amr_grid.inp" file that tells RADMC-3D how
+to interpret the rest of the data, while "dust_density.inp" contains the actual data field.
+
+We can also supply temperature information. The following code creates a "DustTemperature"
+field that is constant at 10 K, and saves it into a file called "dust_temperature.inp"
+
+.. code-block:: python
+
+ def _DustTemperature(field, data):
+ return 10.0*data["Ones"]
+ add_field("DustTemperature", function=_DustTemperature)
+
+ writer.write_dust_file("DustTemperature", "dust_temperature.inp")
+
+With the "amr_grid.inp", "dust_density.inp", and "dust_temperature.inp" files, RADMC-3D
+has everything it needs to compute the thermal dust emission (you may also have to include
+the location and spectra of any sources, which currently must be done manually).
+The result is something that looks like this:
+
+.. image:: _images/31micron.png
+
+Line Emission
+-----------------
+
+The file format required for line emission is slightly different. The following script will generate
+two files, one called "numderdens_co.inp", which contains the number density of CO molecules
+for every cell in the hierarchy, and another called "gas-velocity.inp", which is useful if you want
+to include doppler broadening.
+
+.. code-block:: python
+
+ from yt.mods import *
+ from yt.analysis_modules.radmc3d_export.api import *
+
+ x_co = 1.0e-4
+ mu_h = 2.34e-24
+ def _NumberDensityCO(field, data):
+ return (x_co/mu_h)*data["Density"]
+ add_field("NumberDensityCO", function=_NumberDensityCO)
+
+ pf = load("galaxy0030/galaxy0030")
+ writer = RadMC3DWriter(pf)
+
+ writer.write_amr_grid()
+ writer.write_line_file("NumberDensityCO", "numberdens_co.inp")
+ velocity_fields = ["x-velocity", "y-velocity", "z-velocity"]
+ writer.write_line_file(velocity_fields, "gas_velocity.inp")
https://bitbucket.org/yt_analysis/yt-doc/commits/faac3b84a2c0/
Changeset: faac3b84a2c0
User: atmyers
Date: 2013-10-24 01:33:23
Summary: include a link to the RADMC-3D website
Affected #: 1 file
diff -r 4198effec1a20936afbeff614c5541fe6d544732 -r faac3b84a2c02d274f07e06b3b1a78eeaad0dbf0 source/analysis_modules/radmc3d_export.rst
--- a/source/analysis_modules/radmc3d_export.rst
+++ b/source/analysis_modules/radmc3d_export.rst
@@ -6,7 +6,8 @@
.. sectionauthor:: Andrew Myers <atmyers2 at gmail.com>
.. versionadded:: 2.6
-RADMC-3D is a three-dimensional Monte-Carlo radiative transfer code
+`RADMC-3D
+<http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/>`_ is a three-dimensional Monte-Carlo radiative transfer code
that is capable of handling both line and continuum emission. The RadMC3DWriter
class can save AMR data to disk in an ACSII format that RADMC-3D recognizes.
In principle, this allows one to use RADMC-3D to make synthetic observations
https://bitbucket.org/yt_analysis/yt-doc/commits/a059cbb57ddf/
Changeset: a059cbb57ddf
User: atmyers
Date: 2013-10-24 08:24:49
Summary: link to API docs
Affected #: 2 files
diff -r faac3b84a2c02d274f07e06b3b1a78eeaad0dbf0 -r a059cbb57ddf355a8e311bc1816c0728351deee4 source/analysis_modules/radmc3d_export.rst
--- a/source/analysis_modules/radmc3d_export.rst
+++ b/source/analysis_modules/radmc3d_export.rst
@@ -1,20 +1,20 @@
.. _radmc3d_export:
Exporting to RADMC-3D
-====================
+=====================
.. sectionauthor:: Andrew Myers <atmyers2 at gmail.com>
.. versionadded:: 2.6
`RADMC-3D
<http://www.ita.uni-heidelberg.de/~dullemond/software/radmc-3d/>`_ is a three-dimensional Monte-Carlo radiative transfer code
-that is capable of handling both line and continuum emission. The RadMC3DWriter
-class can save AMR data to disk in an ACSII format that RADMC-3D recognizes.
+that is capable of handling both line and continuum emission. The :class:`~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter`
+class saves AMR data to disk in an ACSII format that RADMC-3D can read.
In principle, this allows one to use RADMC-3D to make synthetic observations
from any simulation data format that yt recognizes.
Continuum Emission
------------------
+------------------
To compute thermal emission intensities, RADMC-3D needs a file called
"dust_density.inp" that specifies the density of dust for every cell in the AMR
@@ -36,7 +36,8 @@
return dust_to_gas*data["Density"]
add_field("DustDensity", function=_DustDensity)
-Now load up a dataset and call the RADMC-3D writer:
+Now load up a dataset and call the
+:class:`~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter`:
.. code-block:: python
@@ -68,7 +69,7 @@
.. image:: _images/31micron.png
Line Emission
------------------
+-------------
The file format required for line emission is slightly different. The following script will generate
two files, one called "numderdens_co.inp", which contains the number density of CO molecules
diff -r faac3b84a2c02d274f07e06b3b1a78eeaad0dbf0 -r a059cbb57ddf355a8e311bc1816c0728351deee4 source/api/api.rst
--- a/source/api/api.rst
+++ b/source/api/api.rst
@@ -333,6 +333,14 @@
~yt.analysis_modules.sunrise_export.sunrise_exporter.export_to_sunrise
~yt.analysis_modules.sunrise_export.sunrise_exporter.export_to_sunrise_from_halolist
+RADMC-3D exporting:
+
+.. autosummary::
+ :toctree: generated/
+
+ ~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DLayer
+ ~yt.analysis_modules.radmc3d_export.RadMC3DInterface.RadMC3DWriter
+
Radial Column Density
^^^^^^^^^^^^^^^^^^^^^
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list