Skip to content

Input Files

nabajour edited this page Jul 21, 2020 · 7 revisions

Alfrodull can use 3 input files:

  • opacities (mandatory)
  • stellar spectrum (optional)
  • cloud data (optional)

Some example tools and functions are provided to generate those files. They are provided as a basis for further customisation, but provide the functions to have the correct input format for Alfrodull. They might need more testing for physical validity.

Opacity file

This is the file defining the wavelength bins used in the simulation, and the gas property grid per temperature and pressure. This file is the same as HELIOS’s opac_sample input file. Only change is that it can be the one generated by HELIOS in CGS units, or the same, converted to SI.

Format

Its an HDF5 file containing:

  • a grid of points in kpoints dataset (cm2/g or m2/kg), matching each temperature, pressure and wavelength.
  • a temperature scale in temperatures (linearly spaced), describing the grid points
  • a pressure scale in pressures (log10 spaced), describing the grid points
  • ypoints: if using ktable, this gives the number of weights per sample in the grid. (This needs to be tested, as ktable are not currently generated by helios’ ktable generator). By default, this is 1, and using sampling mode.
  • weighted Rayleigh cross-sections in weighted Rayleigh cross-sections in [cm-2 or m-2]
  • mean molecular mass Temperature/pressure grid in meanmolmass in atomic mass unit.
  • center wavelengths for bins in center wavelengths or wavelengths [cm or m]
  • bin interface wavelengths in interface wavelengths (marks the borders of each bin), [cm or m] (optional, is computed from bin center wavelength if absent)
  • bin width in wavelength width of bins, [cm or m] (optional, is computed from bin center wavelength if absent)

Tools

HELIOS’ file in CGS unit can be converted to SI using the tools/opacities_to_si.py python script.

Example files

Some example files are provided in the input directory, from 0.35um to 200um:

  • opac_sample_r5.h5: resolution R5 sample from Helios default mixture. 35 wavelength bins.
  • opac_sample_r50.h5: resolution R50 sample from Helios default mixture. 323 wavelength bins.
  • opac_sample_r500.h5: resolution R500 sample from Helios default mixture. 3192 wavelength bins. (stored externally, does not fit on GitHub)

And same as above, in SI units:

  • opac_sample_SI_r5.h5
  • opac_sample_SI_r50.h5
  • opac_sample_SI_r500.h5 (stored externally, does not fit on GitHub)

Stellar Spectrum

A stellar spectrum template can be used as input to Alfrodull, instead of the black-body spectrum.

Format

The HDF5 file contains two tables, in SI units:

  • wavelength: center of wavelength bins. Must match opacity table wavelength bins. [m]
  • flux: stellar flux per bin [J s-1 m-2 m-1]

Tools

There is a tool (tools/download_and_prepare_phoenix_spectrum.py) provided loading HiRes fluxes tables from PHOENIX database and doing some interpolation and rebinning to the opacity’s file bins.

To get a spectrum for Teff, logg, FeH and Alpha, for an opacity sample, stored to an output file, and also storing the intermediate interpolated stellar spectrum:

$ python3 tools/download_and_prepare_phoenix_spectrum.py <spectrum_output_name> -o <opacity_file_input> -i <intermediate_file_output>  -t <Teff> -l <logg> -Z <FeH> -a <Alpha>

For example for a Wasp43 profile:

$ python3 tools/download_and_prepare_phoenix_spectrum.py input/stellar_spectrum_wasp43.h5 -o input/opac_sample_SI_r50.h5 -i input/intermediate_sample_wasp43.h5  -t 4798 -l 4.55 -Z -0.13 -a 0.0

The same operation can be done interactively with the jupyter notebook tools/create_alf_stellar_spectrum.ipynb which also plots the spectrum before storage, for visual inspection.

Examples

  • input/stellar_spectrum_wasp43_r5.h5: stellar spectrum for Wasp43, resolution R=5
  • input/stellar_spectrum_wasp43_r50.h5: stellar spectrum for Wasp43, resolution R=50
  • stellar_spectrum_wasp43_r500.h5 input/stellar_spectrum_wasp43_r500.h5: stellar spectrum for Wasp43, resolution R=500

Clouds

Optional cloud file.

Format

HDF5 file in SI units, containing linear tables of values per wavelength bin, also matching opacity binning:

  • wavelength: wavelength bins centers [m]
  • asymmetry: cloud particle g0
  • absorption: cloud particle absorption cross section [m-2]
  • scattering: cloud particle scattering cross section [m-2]

Tools

A script is provided to convert a file from Daniel Kitzmann’s files to Alfrodull input.

To convert input/cross_sections_mgsio3_r1mu.dat to input/clouds_enstatite_r5.h5 using input/opac_sample_SI_r5.h5 bins:

$ python3 tools/make_alf_cloud_data_from_dk.py input/cross_sections_mgsio3_r1mu.dat input/clouds_enstatite_r5.h5 -o input/opac_sample_SI_r5.h5    

Again, the same can be done in a jupyter notebook interactively with plots using tools/create_cloud_file.ipynb.

Example

  • input/cross_sections_mgsio3_r1mu.dat: example DK source file for enstatite.
  • input/clouds_enstatite_r5.h5: cloud input file for enstatite, R=5
  • input/clouds_enstatite_r5.h5: cloud input file for enstatite, R=50
  • input/clouds_enstatite_r5.h5: cloud input file for enstatite, R=500
Clone this wiki locally