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 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, rho_pos, rho_vel=None, input_dir='/home/docs/checkouts/readthedocs.org/user_builds/py-galaxia-ananke/checkouts/v0.4.0/docs/source', name='sim', ngb=nres, k_factor=1., former_kernel=False) input = Input(pname, kname, former_kernel=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 metallicity \([Fe/H]\) in dex relative to solar via key ``feh``
* Stellar masses in solar masses via key ``mass``
\* Position coordinates in \(kpc\) (Nx3) via key ``pos3``
\* Velocity coordinates in \(km/s\) (Nx3) via key ``vel3``
* Stellar ages in years and decimal logarithmic scale via key ``age``
Additionally, Galaxia can optionally receive particle properties
that will be carried over to the generated synthetic star, those
include the following
\* Calcium abundance \([Ca/H]\) in \(dex\) via key ``calcium``
\* Oxygen abundance \([O/H]\) in \(dex\) via key ``oxygen``
* Index of the data partition that contains the particle via key ``partitionid``
\* Magnesium abundance \([Mg/H]\) in \(dex\) via key ``magnesium``
\* Helium abundance \([He/H]\) in \(dex\) via key ``helium``
\* Neon abundance \([Ne/H]\) in \(dex\) via key ``neon``
* Index of parent particle via key ``parentid``
\* Silicon abundance \([Si/H]\) in \(dex\) via key ``silicon``
\* Carbon abundance \([C/H]\) in \(dex\) via key ``carbon``
* Index of parent particle population via key ``id``
* Formation distance of parent particle in kpc via key ``dform``
\* Nitrogen abundance \([N/H]\) in \(dex\) via key ``nitrogen``
\* Alpha abundance \([Mg/Fe]\) in \(dex\) via key ``alpha``
\* Sulphur abundance \([S/H]\) in \(dex\) via key ``sulphur`` – Input comes with class method make_dummy_particles_input to produce a dummy example of that dictionary.
rho_pos (array_like) – Contains the position-determined kernel density estimates for the input particles. Must have equal lengths as the elements in the particles dictionary.
rho_vel (array_like) – Contains the velocity-determined kernel density estimates for the input particles. Must have equal lengths as the elements in the particles dictionary.
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/v0.4.0/docs/source’.
name (string) – Optional name Galaxia should use for the input files. Default to ‘sim’.
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.
former_kernel (bool or dict) – Flag that allow the utilization of the former implementation for the kernels lengths with the consideration of a kernel normalization factor. If providing a dictionary, you can configure the former kernel normalization factor knorm by including the value knorm under key ‘knorm’. Default to False, if True, knorm defaults to 0.596831.
- particles_dictionary_description = '\n The particle dictionary includes the following properties with\n corresponding keys:\n \n * Stellar metallicity $[Fe/H]$ in dex relative to solar via key ``feh``\n * Stellar masses in solar masses via key ``mass``\n * Position coordinates in $kpc$ (Nx3) via key ``pos3``\n * Velocity coordinates in $km/s$ (Nx3) via key ``vel3``\n * Stellar ages in years and decimal logarithmic scale via key ``age``\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 * Calcium abundance $[Ca/H]$ in $dex$ via key ``calcium``\n * Oxygen abundance $[O/H]$ in $dex$ via key ``oxygen``\n * Index of the data partition that contains the particle via key ``partitionid``\n * Magnesium abundance $[Mg/H]$ in $dex$ via key ``magnesium``\n * Helium abundance $[He/H]$ in $dex$ via key ``helium``\n * Neon abundance $[Ne/H]$ in $dex$ via key ``neon``\n * Index of parent particle via key ``parentid``\n * Silicon abundance $[Si/H]$ in $dex$ via key ``silicon``\n * Carbon abundance $[C/H]$ in $dex$ via key ``carbon``\n * Index of parent particle population via key ``id``\n * Formation distance of parent particle in kpc via key ``dform``\n * Nitrogen abundance $[N/H]$ in $dex$ via key ``nitrogen``\n * Alpha abundance $[Mg/Fe]$ in $dex$ via key ``alpha``\n * Sulphur abundance $[S/H]$ in $dex$ via key ``sulphur``\n '#
- all_possible_keys_in_particles = {'age', 'alpha', 'calcium', 'carbon', 'dform', 'feh', 'helium', 'id', 'magnesium', 'mass', 'neon', 'nitrogen', 'oxygen', 'parentid', 'partitionid', 'pos3', 'silicon', 'sulphur', 'vel3'}#
- property particles#
- property length#
- property rho_pos#
- property rho_vel#
- property rho#
- property hdim#
- property name: str#
- property ngb#
- property k_factor#
- property kernels#
- property kname#
- property pname#
- prepare_input(photosys: PhotoSystem, cmd_magnames: str | Dict[str, str], **kwargs) Tuple[str, Path, Dict[str, str | float | int]][source]#
- 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 metallicity \([Fe/H]\) in dex relative to solar via key
fehStellar masses in solar masses via key
massPosition coordinates in \(kpc\) (Nx3) via key
pos3Velocity coordinates in \(km/s\) (Nx3) via key
vel3Stellar ages in years and decimal logarithmic scale via key
age
Additionally, Galaxia can optionally receive particle properties that will be carried over to the generated synthetic star, those include the following:
Calcium abundance \([Ca/H]\) in \(dex\) via key
calciumOxygen abundance \([O/H]\) in \(dex\) via key
oxygenIndex of the data partition that contains the particle via key
partitionidMagnesium abundance \([Mg/H]\) in \(dex\) via key
magnesiumHelium abundance \([He/H]\) in \(dex\) via key
heliumNeon abundance \([Ne/H]\) in \(dex\) via key
neonIndex of parent particle via key
parentidSilicon abundance \([Si/H]\) in \(dex\) via key
siliconCarbon abundance \([C/H]\) in \(dex\) via key
carbonIndex of parent particle population via key
idFormation distance of parent particle in kpc via key
dformNitrogen abundance \([N/H]\) in \(dex\) via key
nitrogenAlpha abundance \([Mg/Fe]\) in \(dex\) via key
alphaSulphur abundance \([S/H]\) in \(dex\) via key
sulphur
- classmethod make_dummy_densities_input(n_parts=100000)[source]#
Generate an example dummy input densities for Input made of randomly generated arrays.
- Parameters:
n_parts (int) – Number of particles the example include. Default to 10**5.
- Returns:
rho_pos (array) – Dummy example input position densities for Input.
rho_vel (array) – Dummy example input velocity densities for Input.