sunbather.tools

Tools for sunbather

Functions

alt_array_to_Cloudy(alt, quantity, altmax, ...)

Takes an atmospheric quantity as a function of altitude/radius, and returns it as a 2D array of that same quantity as a function of distance from the top of the atmosphere.

calc_mu(rho, ne[, abundances, mass])

Calculates the mean particle mass of an atomic/ionic gas mixture, but neglecting molecules (and the negligible mass contributed by electrons).

copyadd_Cloudy_in(oldsimname, newsimname[, ...])

Makes a copy of a Cloudy input file and appends commands.

find_line_lowerstate_in_en_df(species, ...)

Finds the column name of the .den file that corresponds to the ground state of the given line.

get_SED_norm_1AU(SEDname)

Reads in an SED file and returns the normalization in monochromatic flux (i.e., nu*F_nu or lambda*F_lambda) and Ryd units.

get_abundances([zdict])

Returns a dictionary of the fractional abundances of each element (sums to 1).

get_cloudy_path()

get_mass(species)

Returns the mass of an atomic or positive ion.

get_specieslist([max_ion, exclude_elements])

Returns a list of atomic and ionic species names.

get_sunbather_project_path()

get_zdict([z, zelem])

Returns a dictionary of the scale factors of each element relative to solar.

hden_to_rho(hden[, abundances])

Converts a hydrogen number density in units of cm-3 to a mass density in units of g cm-3, for a given chemical composition.

insertden_Cloudy_in(simname, denspecies[, ...])

Takes a Cloudy .in input file and adds extra species to the 'save species densities' command.

process_continuum(filename[, nonzero])

Reads a .con file from the 'save continuum units angstrom' command.

process_cooling(filename[, Rp, altmax, ...])

Reads a .cool file from the 'save cooling' command.

process_coolingH2(filename[, Rp, altmax])

Reads a .coolH2 file from the 'save H2 cooling' command, which keeps track of cooling and heating processes unique to the H2 molecule, when using the 'database H2' command.

process_densities(filename[, Rp, altmax])

Reads a .den file from the 'save species densities' command.

process_energies(filename[, rewrite, ...])

Reads a '.en' file from the 'save species energies' command.

process_heating(filename[, Rp, altmax, ...])

Reads a .heat file from the 'save heating' command.

process_overview(filename[, Rp, altmax, ...])

Reads in a '.ovr' file from the 'save overview' command.

read_parker(plname, temp, mdot, pdir[, filename])

Reads an isothermal Parker wind profile as generated by the construct_parker.py module.

read_planets_file()

remove_duplicates(law, fmt)

Takes a Cloudy law (e.g., dlaw or tlaw) and a formatter, and removes duplicate rows from the law.

rho_to_hden(rho[, abundances])

Converts a mass density in units of g cm-3 to a hydrogen number density in units of cm-3, for a given chemical composition.

roche_radius(a, Mp, Mstar)

Returns the Hill/Roche radius.

run_Cloudy(filename[, folder])

Run a Cloudy simulation from within Python.

set_alt_ax(ax[, altmax, labels])

Sets the xscale of a figure to represent altitude/radius in units of planetary radius.

set_sunbather_project_path(projectpath)

Set project path and ensure it has a planets.txt file

smooth_gaus_savgol(y[, size, fraction])

Smooth an array using a Gaussian filter, but smooth the start and end of the array with a Savitzky-Golay filter.

speciesstring(specieslist[, ...])

Takes a list of species names and returns a long string with those species

verbose_print(message[, verbose])

Prints the provided string only if verbose is True.

write_Cloudy_in(simname[, title, ...])

Writes a Cloudy input file for simulating an exoplanet atmosphere.

Classes

Parker(plname, temp, mdot, pdir[, fH, ...])

Class that stores a Parker wind profile and its parameters.

Planet(name[, fullname, R, Rstar, a, M, ...])

Class that stores planet/star parameters.

Sim(simname[, altmax, proceedFail, files, ...])

Loads the output of a Cloudy simulation.