StarFormationHistory#
- class cogsworth.sfh.StarFormationHistory(**kwargs)[source]#
Bases:
objectClass for a generic galactic star formation history model from which to sample
This class sets out an outline for sampling from a star formation history model but a subclass will be needed for things to function properly.
All attributes listed below are a given value for the sampled points in the galaxy. If one hasn’t been sampled/calculated when accessed then it will be automatically sampled/calculated. If sampling, ALL values will be sampled.
Attributes Summary
The metallicities of the sampled points
The galactocentric azimuthal angle of the sampled points
The galactocentric positions of the sampled points
The galactocentric cylindrical radius of the sampled points
The lookback times of the sampled points
The galactocentric radial velocity of the sampled points
The galactocentric tangential velocity of the sampled points
The galactocentric azimuthal velocity of the sampled points
The galactocentric x velocity of the sampled points
The galactocentric y velocity of the sampled points
The galactocentric vertical velocity of the sampled points
The galactocentric x positions of the sampled points
The galactocentric y positions of the sampled points
The galactocentric z positions of the sampled points
Methods Summary
copy()Return a copy of this star formation history
draw_heights(size)draw_lookback_times(size)draw_phi(size)draw_radii(size)get_citations([filename])Print the citations for the packages/papers used in the star formation history
plot(**kwargs)Plot the star formation history using the default plotting function
sample(size)Sample from the distributions for each component, combine and save in class attributes
save(file_name[, key])Save the entire class to storage.
sfh_citation_statement(citations[, filename])Print the citations for the packages/papers used in the star formation history
Attributes Documentation
- Z[source]#
The metallicities of the sampled points
- Returns:
- Z
Quantity[dimensionless] The metallicities of the sampled points (absolute metallicity not solar metallicity)
- Z
- phi[source]#
The galactocentric azimuthal angle of the sampled points
A shortcut for \(\arctan(y / x)\)
- Returns:
- phi
Quantity[angle] The galactocentric azimuthal angle of the sampled points
- phi
- positions[source]#
The galactocentric positions of the sampled points
- Returns:
- positions
Quantity[length], shape=(3,size) The galactocentric positions of the sampled points
- positions
- rho[source]#
The galactocentric cylindrical radius of the sampled points
A shortcut for the radius in the x-y plane, \(\sqrt{x^2 + y^2}\)
- Returns:
- rho
Quantity[length] The galactocentric cylindrical radius of the sampled points
- rho
- tau[source]#
The lookback times of the sampled points
- Returns:
- tau
Quantity[time] The lookback times of the sampled points
- tau
- v_phi[source]#
The galactocentric azimuthal velocity of the sampled points
A shortcut for \((v_T / \rho)\)
- v_x[source]#
The galactocentric x velocity of the sampled points
A shortcut for \(v_R \cos(\phi) - v_T \sin(\phi)\)
- v_y[source]#
The galactocentric y velocity of the sampled points
A shortcut for \(v_R \sin(\phi) + v_T \cos(\phi)\)
- x[source]#
The galactocentric x positions of the sampled points
- Returns:
- x
Quantity[length] The galactocentric x positions of the sampled points
- x
- y[source]#
The galactocentric y positions of the sampled points
- Returns:
- y
Quantity[length] The galactocentric y positions of the sampled points
- y
- z[source]#
The galactocentric z positions of the sampled points
- Returns:
- z
Quantity[length] The galactocentric z positions of the sampled points
- z
Methods Documentation
- get_citations(filename=None)[source]#
Print the citations for the packages/papers used in the star formation history
- plot(**kwargs)[source]#
Plot the star formation history using the default plotting function
See
plot_sfh()for more details and options.
- sample(size)[source]#
Sample from the distributions for each component, combine and save in class attributes
- save(file_name, key='sfh')[source]#
Save the entire class to storage.
Data will be stored in an hdf5 file using file_name.
- Parameters:
- file_namestr
A name to use for the hdf5 file in which samples will be stored. If this doesn’t end in “.h5” then “.h5” will be appended.
- keystr, optional
Key to use for the hdf5 file, by default “sfh”
- static sfh_citation_statement(citations, filename=None)[source]#
Print the citations for the packages/papers used in the star formation history
- Parameters:
- citationslist of str
The list of citations to include in the statement, these should be keys in the CITATIONS dict
- filenamestr, optional
Filename for generating a bibtex file (leave blank to just print to terminal), by default None