Skip to content

Command-line driven tool to create dust opacities

License

Notifications You must be signed in to change notification settings

cdominik/optool

Repository files navigation

Introduction to optool

This tool produces complex dust particle opacities right from the command line. It is derived from Michiel Min’s DHS OpacityTool and also implements Ryo Tazaki’s MMF theory for highly porous aggregates.

Capabilities

  • stand-alone tool, fully command line driven, no input files need to be edited
  • full scattering matrix output in several formats, including for RADMC-3D
  • combining materials through mixing into a complex grain with porosity
  • built-in: a curated collection of materials for applications in astronomy
  • external refractive index data can be used just as easily. A selection of readily prepared files can be found here.
  • computational methods: (i) DHS (Distribution of Hollow Spheres) for irregular grains and low-porosity aggregates. Standard Mie theory for perfect spheres is available as a limiting case. (ii) MMF (Modified Mean Field) theory for high-porosity/fractal aggregates. (iii) CDE (Continuous Distribution of Ellipsoids) approximation in the Rayleigh limit.
  • Python interface module for plotting and post-processing

Terms of use

optool is distributed under the MIT license and can be used, changed and redistributed freely. But we do ask you to provide a reference to optool when using it. Relevant references are listed below and the corresponding BibTeX entries are available in the file optool.bib. optool is hosted on github.

Examples

A simple grain made only of the default pyroxene, for the default grain size distribution (a-3.5 powerlaw from 0.05 to 3000μm), on the default wavelength grid (0.05μm to 1cm).

optool pyr

Include the scattering matrix in the produced output

optool pyr -s

Reproduce the DIANA standard dust model, using a specific pyroxene (70% Mg) and carbon, in a mass ratio 0.87/0.13, and with a porosity of 25%.

optool pyr-mg70 0.87  c 0.13  -p 0.25

List the built-in materials

optool -c

Add a water ice mantle (built-in data from Warren+08) that is 20% of the core mass

optool pyr-mg70 0.87  c 0.13  -m h2o-w 0.2  -p 0.25

Like the previous example, but use ice refractive index data from a separate file.

optool pyr-mg70 0.87  c 0.13  -p 0.25  -m data/ice_hudgins.dat 0.2

Pure water ice grains in a narrow size distribution from 1 to 3 microns, with 15 sample sizes following an f(a)\propto a-2.5 powerlaw size distribution. Also, restrict the wavelength range to 10-100μm, and turn off DHS to get perfect spheres.

optool h2o  -a 1 3 2.5 15  -l 10 100 -fmax 0

Use a log-normal size distribution around 2 μm with σ=0.7 instead.

optool h2o  -a 0.1 30 2.0:0.7  -l 10 100 -mie

For silicon carbide, compute the opacity of a single grains size (2.5μm) at λ=8.9μm.

optool -a 2.5 -l 8.9 sic

Represent the default dust model (DIANA, you also get this when you do not give any materials at all) in 42 grain sizes, and produce input files for RADMC-3D, one for each grain size, with full scattering matrix, chopping 3 degrees from the scattering peak.

optool -na 42 -d -s -radmc -chop 3

Use MMF to compute the opacities of dust aggregates made of pyroxene monomers. Use a monomer radius of 0.3 μm to construct aggregates with compact-volume radii between 10 and 30 μm, and a fractal dimension of 1.9.

optool pyr  -a 10 30  -mmf 0.3 1.9

Compute the CDE approximation of small graphite grains.

optool gra  -a 0.01 0.1 -l 1 30 -cde

Acknowledgments

  • The Jena Database of Optical Constants and the Aerosol Refractive Index Archive for their invaluable collections of refractive index datasets.
  • Rens Waters, Thomas Henning, Xander Tielens, Elisabetta Palumbo, Laurent Pilon, Jeroen Bouwman, and Melissa McClure for discussions around optical properties of cosmic dust analogues.
  • Charlène Lefèvre for SIGMA, which inspired me to add grain mantles.
  • Kees Dullemond for discussions about the RADMC-3D input format and the scattering matrix, for the idea to write optool2tex and for letting me include his incredible python plotting routine viewarr (available on github).
  • Gabriel-Dominique Marleau for testing and feedback, in particular on optool2tex.
  • Thiébaut Schirmer for triggering the addition of a log-normal size distribution.

User Guide

See the User Guide for more information.

Important changes

Release 1.9.14
  • The python interface can now read the results from an earlier run by leaving the CMD argument empty.
      part = optool.particle("","path/to/directory")
            

    This is useful, for example, if you precompute many opacities that you then want to read with a python program. Thanks to Julien Milli for the request.

Release 1.9.13
  • The -print command line option allows a richer variety of outputs to STDOUT, for human reading as well as for use in a pipe or redirect. Run optool -print ? for a list of options.
Release 1.9.12
  • A material can now also be described by giving values for n, k, and the density on the command line, like this: -c n:k:rho. For example, -c 2.5:0.3:3.01 describes a material with a complex refractive index of 2.5+0.3i and a mass density of 3.01 g/cm^3. This can be useful in parameter searches when trying to fit optical properties of an unknown material.
Release 1.9.11
  • New subdirectory lnk_data/ad contains the crystalline Axis dependant Data for some of the crystalline materials in the distribution. This allows to create opacity mix computations as opposed to the refractive index mixing that has been used to produce the crystalline datasets in optool. See appendix D.1 in the UserGuide.
Release 1.9.10
  • STDOUT and STDERR are now properly separated and portable, using the ISO_FORTRAN_ENV module.
Release 1.9.9
  • More careful treatment of short-wavelength computation using very large grains with size parameter x>1e4. This change makes the code slower for computation involving very large size parameters. Use -xlim 1e4 to get back the old speed if that bothers you, and if in your application the short-wavelength opacities are dominated by smaller grains with size parameters x<1e4.
Release 1.9.8
  • Sparse scattering matrix files can save space if the target program can read them.
  • Literature standard compositions DIANA and DSHARP have been built in. They are accessible with the options -diana, -dsharp, and -dsharp-no-ice.
Release 1.9.7
  • Do not allow qabs to drop below 1e-4*qext, to avoid numerical problems.
Release 1.9.6
  • Log-normal size distribution is now a standard option, using AMEAN:ASIG instead of the powerlaw in the -a switch. A negative value for ASIG triggers a normal (not log-normal) distribution around AMEAN, with ASIG interpreted as the width in micrometers.
  • The size distribution can also be read from a file.
  • The new option -wgrid makes optool write the size distribution and the wavelength grid into files optool_sd.dat and optool_lam.dat, respectively. These also serve as examples of what kind of file can be read in by -l FILE and -a FILE.
  • We no longer provide binary versions of optool.
  • The default number of size bins has been increased to 15 per grain size decade, to get better results at long wavelengths out of the box. This slows down the computation by 50%.
Release 1.9.4
  • Improve installation process and instructions.
  • Get help about specific command line options with, for example, optool -h mmf.
  • Shell completion of command line options and arguments is now supported with the optool-complete script. You need to link it into your shell setup using the instructions in optool-complete.
Release 1.9.3
  • New option -print, to direct output to STDOUT instead of files.
  • Grain sizes and wavelengths can be specified on the command lines in units other than microns, for example mm or GHz (frequency) or cm^-1 (wavenumbers).
  • Add Fayalite and also the Mg-rich Olivine from Fabian 2001.
  • Switch out the Forsterite dataset: Steyer is out, Suto is in.
  • Continuous Distribution of Ellipsoids (CDE) approximation has been implemented. It is only valid in the Rayleigh limit and includes quite extreme particle shapes, but it is good as a comparison and frequently used in the literature.
  • optool -a 15 -2 will compute a size range from 13-17um with a flat size distribution.
Release 1.9
  • The proper reference for optool is now the entry in the Astrophysics Source Code Library, please refer to it when optool is used in your paper. The reference looks like this:
    • Dominik, C., Min, M., Tazaki, R. 2021, Optool, 1.9, Astrophysics Source Code Library, record ascl:2104.010

    Here is a pointer to the ADS entry, from where you can also download the corresponding BibTeX entry. That BibTeX entry is also in optool.bib, with the citation key 2021ascl.soft04010D.

  • Add an amorphous water ice, from Hudgins 1993. This dataset is amended at short and long wavelengths with the Warren data of crystalline ice, to get a wide dataset.