Functions for converting optical properties to stored table format. More...
Functions | |
def | convertDustemOpticalProps (inFilePaths, outFilePaths) |
This function converts optical properties given in DustEM format to stored table format. More... | |
def | convertGenericOpticalProps (inFilePaths, outFilePaths) |
This function converts optical properties listed in a single text file (in the format described below) to stored table format. More... | |
def | convertMinOpticalProps (inFilePaths, outFilePaths) |
This function converts optical properties given in the format provided by Michiel Min to stored table format. More... | |
def | convertStokesPolarizedOpticalProps (inFilePaths, outFilePaths) |
This function converts optical properties given in STOKES format to stored table format. More... | |
Functions for converting optical properties to stored table format.
The functions in this module can convert various kinds of optical property data to SKIRT stored table format. The stored tables for basic optical properties produced by the functions in this module have a two axes:
def pts.storedtable.convert_opticalprops.convertDustemOpticalProps | ( | inFilePaths, | |
outFilePaths | |||
) |
This function converts optical properties given in DustEM format to stored table format.
It expects three input file paths and a single output file path. The input files should respectively contain:
The files should have a simple text format as described here. For all files, any initial lines that start with a # character are considered to be part of a header and are thus ignored.
In the wavelength grid file, the first number on the first non-header line specifies the number of wavelength grid points
The efficiencies file contains three blocks, each optionally starting with a header consisting of lines that start with a # character. In the first block, the first number on the first non-header line specifies the number of grain size grid points
The scattering assymetry parameter file similarly contains two blocks. The first block describes the grain size grid and should be identical to the first block in the efficiencies file. The second block again contains
def pts.storedtable.convert_opticalprops.convertGenericOpticalProps | ( | inFilePaths, | |
outFilePaths | |||
) |
This function converts optical properties listed in a single text file (in the format described below) to stored table format.
Several options provide extra flexibility to support various existing formats.
In addition to a single output file path for the stored table, the function expects five input argument strings, in order of occurrence: input-file-path, reverse, skip1, skip2, skip3. The last four arguments are booleans. The string "true" (case insensitive) represents True, anything else represents False.
The input file should have a simple text format as described here. Any initial lines that start with a '#' character are considered to be part of a header and are thus ignored. The first number on the first non-header line specifies the number of grain size grid points
Subsequently there must be
For all lines discussed above, any additional information at the end of the line is ignored.
def pts.storedtable.convert_opticalprops.convertMinOpticalProps | ( | inFilePaths, | |
outFilePaths | |||
) |
This function converts optical properties given in the format provided by Michiel Min to stored table format.
In addition to a single output file path for the stored table, the function expects two input arguments: the input filename template, in which the asterisk will be replaced by the grain size to obtain the actual filenames, and the bulk density of the grain material.
There is an input file for each grain size; the grain size (in micron) is encoded in the file name. Each file has the following columns: wavelength (micron), kappa_ext (cm^2/g), kappa_abs (cm^2/g), kappa_scat (cm^2/g), asymmetry parameter. For solid spherical grains we have: Q = kappa * rho_bulk * 4/3*a.
def pts.storedtable.convert_opticalprops.convertStokesPolarizedOpticalProps | ( | inFilePaths, | |
outFilePaths | |||
) |
This function converts optical properties given in STOKES format to stored table format.
It expects a single input file paths and two output file paths: one for the basic optical properties and one for the Mueller matrix coeffients.
The input file should have the text format as used by the STOKES code version 2.06. The file contains the absorption and scattering coefficients as a function of grain size and wavelength, and Mueller matrix coeffients as a function of grain size, wavelength, and scattering angle.