Metals Module

Typically called via the functions in Relaxation Module (sim.add_metals,`sim.metallicity`, etc.)

metals.py: Contains the class for ramping in new species to existing solutions, as well as computing mass fractions of species for a given metallicity.

class wind_ae.wrapper.wrapper_utils.metals.metal_class(windsoln_object)

Bases: object

load_spectrum_add_metals(generate=False, wl_norm=1e-07)

Identical behavior to load_spectrum() function in relax_wrapper.py. Loads the high resolution spectrum referenced in the guess solution so that it can be re-smoothed when new metals are added to the solution.

Parameters:
  • generate (bool) – if True, generates a new smoothed spectrum stored in inputs/spectrum.inp

  • wl_norm (float) – converts nm to cm. Should not need to be changed.

add_species_to_guess(new_species_names)

Adds new species to the list of species in the wind solution object and updates all species-dependent properties.

Parameters:

new_species_names (list of str) – The names of the new species to add. (e.g., [‘O3’,’c1’,’Ne II’])

remove_species_from_guess(remove_species)

Removes specified species from the wind solution object. Likely to break if removing Helium, so it is recommended to ramp directly from pure-H solutions provided.

Parameters:

remove_species (list of str) – The names of the species to remove. (e.g., [‘O3’,’c1’,’Ne II’])

rewrite_guess(regrid=False, degree=1, ramping_metals=False)

Reformats wind_ae/inputs/guess.inp (the guess needed for relaxation routine). Only called when new species is added to solution.

Parameters:
  • regrid (bool) – If True, regrids the solution with a dynamic grid size.

  • degree (int) – The degree of the polynomial for regridding.

  • ramping_metals (bool) – If True, applies ramping to metal species.

metallicity(species_list, Z=1)
Given a metallicity (Z, where Z=1 is solar), returns an array of mass

fractions for the species in species_list. NOTE: Mass fraction must sum to 1, so delta=1-sum(mass fraction Z) is added to the mass fraction of hydrogen. Relative abundances from Lodders (2009).

Parameters:
  • species_list (list of str) – The list of species for which to compute metallicity (e.g., [‘O3’,’c1’,’Ne II’])

  • Z – The metallicity (default is 1 for solar).