galaxia_ananke.Input module#
Contains the Input class definition
Please note that this module is private. The Input class is
available in the main galaxia_ananke namespace - use that instead.
- class galaxia_ananke.Input.Input(*args, **kwargs)[source]#
Bases:
object- __init__(*args, **kwargs) None[source]#
Driver to store and prepare the input data for Galaxia.
Call signatures:
input = Input(particles, kernels, input_dir='/home/docs/checkouts/readthedocs.org/user_builds/py-galaxia-ananke/checkouts/latest/docs/source', name='sim', caching=False, ngb=nres, k_factor=1.) input = Input(pname, kname, caching=False)
- Parameters:
particles (dict) – Dictionary where each elements represent the properties of the input particles, given as equal-length array_like objects.
The particle dictionary includes the following properties with
corresponding keys
* Stellar ages in years and decimal logarithmic scale via key ``age``
\* Stellar metallicity \([Fe/H]\) in dex relative to solar via key ``feh``
* Initial stellar masses in solar masses via key ``massinit``
\* Position coordinates in \(kpc\) (Nx3) via key ``pos3``
\* Velocity coordinates in \(km/s\) (Nx3) via key ``vel3``
Additionally, Galaxia can optionally receive particle properties
that will be carried over to the generated synthetic star, those
include the following
\* Oxygen abundance \([O/H]\) in \(dex\) via key ``oxygen``
\* Nitrogen abundance \([N/H]\) in \(dex\) via key ``nitrogen``
\* Silicon abundance \([Si/H]\) in \(dex\) via key ``silicon``
* Formation distance of parent particle in kpc via key ``dform``
\* Neon abundance \([Ne/H]\) in \(dex\) via key ``neon``
\* Sulphur abundance \([S/H]\) in \(dex\) via key ``sulphur``
\* Calcium abundance \([Ca/H]\) in \(dex\) via key ``calcium``
\* Alpha abundance \([Mg/Fe]\) in \(dex\) via key ``alpha``
\* Carbon abundance \([C/H]\) in \(dex\) via key ``carbon``
* Index of parent particle population via key ``id``
\* Magnesium abundance \([Mg/H]\) in \(dex\) via key ``magnesium``
* Index of the data partition that contains the particle via key ``partitionid``
\* Helium abundance \([He/H]\) in \(dex\) via key ``helium``
* Index of parent particle via key ``parentid`` – Input comes with class method make_dummy_particles_input to produce a dummy example of that dictionary.
kernels (array_like) – Array containing the kernel characteristic lengths for each input particle. Must be of equal length N as the arrays provided in the particles dictionary, as either a (N) or a (Nx2) array if representing respectively kernels in position space, or in phase space (using the same position and velocity unit as that of the corresponding particles dictionary entry).
input_dir (string or pathlib.Path) – Optional arguments to specify path for the directory where Galaxia’s input data should be generated. Default to ‘/home/docs/checkouts/readthedocs.org/user_builds/py-galaxia-ananke/checkouts/latest/docs/source’.
name (string) – Optional name Galaxia should use for the input files. Default to ‘sim’.
caching (bool) – TODO
append_hash (bool) – TODO
ngb (int) – Number of neighbouring particles Galaxia should consider. Default to nres. ONLY SUPPORT 8, 32, 64 & 128.
k_factor (float) – Scaling factor applied to the kernels lengths to adjust all the kernels sizes uniformly. Lower values reduces the kernels extents, while higher values increases them. Default to 1 (no adjustment).
pname (string) – Path to existing pre-formatted particles EBF files to use as input for Galaxia. This keyword argument must be used in conjunction with kname. Default to None if unused.
kname (string) – Path to existing pre-formatted kernel EBF files to use as input for Galaxia. This keyword argument must be used in conjunction with pname. Default to None if unused.
- particles_dictionary_description = '\n The particle dictionary includes the following properties with\n corresponding keys:\n \n * Stellar ages in years and decimal logarithmic scale via key ``age``\n * Stellar metallicity $[Fe/H]$ in dex relative to solar via key ``feh``\n * Initial stellar masses in solar masses via key ``massinit``\n * Position coordinates in $kpc$ (Nx3) via key ``pos3``\n * Velocity coordinates in $km/s$ (Nx3) via key ``vel3``\n \n Additionally, Galaxia can optionally receive particle properties\n that will be carried over to the generated synthetic star, those\n include the following: \n \n * Oxygen abundance $[O/H]$ in $dex$ via key ``oxygen``\n * Nitrogen abundance $[N/H]$ in $dex$ via key ``nitrogen``\n * Silicon abundance $[Si/H]$ in $dex$ via key ``silicon``\n * Formation distance of parent particle in kpc via key ``dform``\n * Neon abundance $[Ne/H]$ in $dex$ via key ``neon``\n * Sulphur abundance $[S/H]$ in $dex$ via key ``sulphur``\n * Calcium abundance $[Ca/H]$ in $dex$ via key ``calcium``\n * Alpha abundance $[Mg/Fe]$ in $dex$ via key ``alpha``\n * Carbon abundance $[C/H]$ in $dex$ via key ``carbon``\n * Index of parent particle population via key ``id``\n * Magnesium abundance $[Mg/H]$ in $dex$ via key ``magnesium``\n * Index of the data partition that contains the particle via key ``partitionid``\n * Helium abundance $[He/H]$ in $dex$ via key ``helium``\n * Index of parent particle via key ``parentid``\n '#
- all_possible_keys_in_particles = {'age', 'alpha', 'calcium', 'carbon', 'dform', 'feh', 'helium', 'id', 'magnesium', 'massinit', 'neon', 'nitrogen', 'oxygen', 'parentid', 'partitionid', 'pos3', 'silicon', 'sulphur', 'vel3'}#
- property caching: bool#
- property particles: Dict[str, ndarray[Any, dtype[_ScalarType_co]]]#
- property length: int#
- property hdim: int#
- property name: str#
- property append_hash: bool#
- property name_hash: str#
- property ngb: int#
- property k_factor: float | ndarray[Any, dtype[_ScalarType_co]]#
- property kernels: ndarray[Any, dtype[_ScalarType_co]]#
- property pname: Path#
- property kname: Path#
- property input_sorter: ndarray[Any, dtype[int64]]#
- property hash: str#
- property metadata: Dict[str, Any]#
- classmethod make_dummy_particles_input(n_parts=100000)[source]#
Generate an example dummy input particles dictionary for Input made of randomly generated arrays.
- Parameters:
n_parts (int) – Number of particles the example include. Default to 10**5.
- Returns:
p – Dummy example input particles dictionary for Input.
- Return type:
dict
Notes
The particle dictionary includes the following properties with corresponding keys:
Stellar ages in years and decimal logarithmic scale via key
ageStellar metallicity \([Fe/H]\) in dex relative to solar via key
fehInitial stellar masses in solar masses via key
massinitPosition coordinates in \(kpc\) (Nx3) via key
pos3Velocity coordinates in \(km/s\) (Nx3) via key
vel3
Additionally, Galaxia can optionally receive particle properties that will be carried over to the generated synthetic star, those include the following:
Oxygen abundance \([O/H]\) in \(dex\) via key
oxygenNitrogen abundance \([N/H]\) in \(dex\) via key
nitrogenSilicon abundance \([Si/H]\) in \(dex\) via key
siliconFormation distance of parent particle in kpc via key
dformNeon abundance \([Ne/H]\) in \(dex\) via key
neonSulphur abundance \([S/H]\) in \(dex\) via key
sulphurCalcium abundance \([Ca/H]\) in \(dex\) via key
calciumAlpha abundance \([Mg/Fe]\) in \(dex\) via key
alphaCarbon abundance \([C/H]\) in \(dex\) via key
carbonIndex of parent particle population via key
idMagnesium abundance \([Mg/H]\) in \(dex\) via key
magnesiumIndex of the data partition that contains the particle via key
partitionidHelium abundance \([He/H]\) in \(dex\) via key
heliumIndex of parent particle via key
parentid
- classmethod make_dummy_kernels_input(n_parts=100000)[source]#
Generate an example dummy input kernels for Input made of randomly generated arrays.
- Parameters:
n_parts (int) – Number of particles the example include. Default to 10**5.
- Returns:
kernels – Dummy example input phase space kernels for Input.
- Return type:
array