ananke.Ananke module#
Contains the Ananke class definition
Please note that this module is private. The Ananke class is
available in the main ananke namespace - use that instead.
- class ananke.Ananke.Ananke(particles: Dict[str, ndarray[Any, dtype[_ScalarType_co]]], name: str, ngb: int = 64, d_params: Dict[str, Any] = {}, e_params: Dict[str, Any] = {}, err_params: Dict[str, Any] = {}, **kwargs: Dict[str, Any])[source]#
Bases:
objectRepresents a single ananke pipeline.
- __init__(particles: Dict[str, ndarray[Any, dtype[_ScalarType_co]]], name: str, ngb: int = 64, d_params: Dict[str, Any] = {}, e_params: Dict[str, Any] = {}, err_params: Dict[str, Any] = {}, **kwargs: Dict[str, Any]) None[source]#
- Parameters:
particles (dict) – A dictionary of same-length arrays representing particles data of a stellar population - see notes for formatting
name (str) – Name for the pipeline
ngb (int) – Number of neighbours to use in kernel density estimation
d_params (dict) – Parameters to configure the kernel density estimation. Use class method
display_density_docsto find what parameters can be definede_params (dict) – Parameters to configure the extinction pipeline. Use class method
display_extinction_docsto find what parameters can be definederr_params (dict) – Parameters to configure the error model pipeline. Use class method
display_errormodel_docsto find what parameters can be definedobserver (array-like shape (3,) or dict of array-like shape (3,)) – Coordinates for the observer in phase space. Position and velocity quantities must respectively be given in kpc and km/s. To only specify position, an array-like object of shape (3,) is enough. If specifying both position and velocity, please provide a dictionary containing both coordinates as array-like objects of shape (3,), respectively denoting the position and velocity coordinates with keys
pos3andvel3. Position coordinates default to:[-8.12197337e+00 -1.47294445e-11 2.08000000e-02]
and velocity coordinates default to:
[ 12.9 245.6 7.78]
rshell (array-like shape (2,)) – Range in kpc of distances from the observer position of the particles that are to be considered. Default to:
[ 0 500]
photo_sys (string or list) – Name(s) of the photometric system(s) Galaxia should use to generate the survey. Default to
['padova/GAIA__DR2']. Available photometric systems can be queried with the class methoddisplay_available_photometric_systems.cmd_magnames (string or dict) – Names of the filters Galaxia should use for the color-magnitude diagram box selection. The input can be given as string in which case it must meet the following format:
"band1,band2-band3"where
band1is the magnitude filter and(band2, band3)are the filters that define theband2-band3color index. Alternatively, a dictionary can be passed with the following format:dict('magnitude': band1, 'color_minuend': band2, 'color_subtrahend': band3)
The filter names must correspond to filters that are part of the first chosen photometric system in photo_sys. Default to
'G,Gbp-Grp'.fsample (float) – Sampling rate from 0 to 1 for the resulting synthetic star survey. 1 returns a full sample while any value under returns partial surveys. Default to 1.
app_mag_lim_lo, app_mag_lim_hi, abs_mag_lim_lo, abs_mag_lim_hi, color_lim_lo, color_lim_hi (float) – These allow to specify the limits of the chosen color-magnitude diagram box selection (
lofor lower andhifor upper).app_mag,abs_magandcolorrepresent respectively limits in apparent magnitudes, absolute magnitudes and color index. Default values follow those set in the dictionary:{'abs_mag': [-1000, 20], 'app_mag': [-1000, 1000], 'color': [-1000, 1000]}
Notes
The input particles must include same-length arrays for every key of the list of keys return by property required_particles_keys. Particular attention should be given to arrays of keys
'pos3'and'vel3'that must be shaped as (Nx3) arrays of, respectively, position and velocity vectors. Use the class methodmake_dummy_particles_inputto generate a dummy example of such input dictionary.
- run(**kwargs) Output[source]#
Method to run the pipeline
- Parameters:
input_dir, output_dir, i_o_dir (string) – Optional arguments to specify paths for the directories where ananke should generate input and output data. If the i_o_dir keyword argument is provided, it overrides any path given to the input_dir and output_dir keyword arguments.
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).
surveyname (string) – Optional name Galaxia should use for the output files. Default to ‘survey’.
n_jobs (int) – Number of independent catalog generations ran in parallel. Default to 1.
verbose (bool) – Verbose boolean flag to allow pipeline to print what it’s doing to stdout. Default to True.
rand_seed (int) – Seed to be used by Galaxia’s pseudorandom number generator. Default to 17052
nstart (int) – Index at which to start indexing synthetic stars. Default to 0
longitude, latitude (float) –
Currently not implemented. Respectively default to:
76.273 & 13.4725
star_type (int) – Currently not implemented. Default to 0
geometry_opt (int) – Currently not implemented. Default to 0
survey_area (float) – Currently not implemented. Default to 207.455
pop_id (int) – Currently not implemented. Default to 10
warp_flare_on (int) – Currently not implemented. Default to 0
photo_error (int) – Currently not implemented. Default to 0
- Returns:
galaxia_output – Handler with utilities to utilize the output survey and its data.
- Return type:
Galaxia.Output
Notes
An Output object almost behaves as a vaex DataFrame, also please consult
vaexonline tutorials for more hands-on information:The DataFrame represents the catalogue with columns corresponding to properties of the stars from the synthetic stellar population it simulates.
Warning
When generated directly by
Galaxia_ananke, the catalogue properties reflect directly the quantities as computed by Galaxia. However the catalogue can be modified/amended by applying post-processing routines using the methodapply_post_process_pipeline_and_flush. Also if suchOutputobject was generated by other software thanGalaxia_ananke, post-processing may have been applied: also please refer to that software documentation for a more complete overview of the catalogue.The catalogue properties include the photometric magnitudes per filter, with each filter identified by a key in the following lowercase format:
photosys_filternamewhere
photo_syscorresponds to the chosen photometric systemfilternamecorresponds to a filter name of that system
As an example, the photometry in filters
gbp,grp&gof the Gaia DR2 system identified asGAIA__DR2are respectively under keysgaia__dr2_gbp,gaia__dr2_grp&gaia__dr2_g.With those are also always included the following properties:
Celestial equatorial coordinates in \(degrees\) via keys
(ra, dec)Index of the data partition that contains the particle via key
partitionidFlag = 1 if star not at center of its parent particle via key
partidStellar metallicity \([Fe/H]\) in \(dex\) relative to solar via key
fehDistance in \(kpc\) via key
radCelestial galactic coordinates in \(degrees\) via keys
(glon, glat)Current stellar mass in solar masses via key
mactPosition coordinates in \(kpc\) via keys
(px, py, pz)Galactic proper motions in milliarcseconds per year via keys
(mul, mub)Parallax in milliarcseconds via key
piEquatorial proper motions in milliarcseconds per year via keys
(mura, mudec)Velocity coordinates in \(km/s\) via keys
(vx, vy, vz)Surface temperature in Kelvin and decimal logarithmic scale via key
teffIndex of parent particle via key
parentidRadial velocity in \(km/s\) via key
vrTip of the Red Giant Branch stellar mass in solar masses via key
mtipSurface gravity in CGS units and decimal logarithmic scale via key
gravStellar luminosity in solar luminosities and decimal logarithmic scale via key
lumDistance modulus in magnitude units via key
dmodZero Age Main Sequence stellar mass in solar masses via key
smassStellar ages in years and decimal logarithmic scale via key
age
Additionally, depending on what optional properties were provided with the input particle data, the output can also include the following properties:
Magnesium abundance \([Mg/H]\) in \(dex\) via key
magnesiumOxygen abundance \([O/H]\) in \(dex\) via key
oxygenNitrogen abundance \([N/H]\) in \(dex\) via key
nitrogenCarbon abundance \([C/H]\) in \(dex\) via key
carbonCalcium abundance \([Ca/H]\) in \(dex\) via key
calciumAlpha abundance \([Mg/Fe]\) in \(dex\) via key
alphaIndex of parent particle population via key
satidSulphur abundance \([S/H]\) in \(dex\) via key
sulphurFormation distance of parent particle in kpc via key
dformSilicon abundance \([Si/H]\) in \(dex\) via key
siliconHelium abundance \([He/H]\) in \(dex\) via key
heliumNeon abundance \([Ne/H]\) in \(dex\) via key
neon
Ananke complements this set of properties with those that are generated from its various post-processing subroutines. As a result the
photosys_filtername-formatted columns contain the apparent photometry, computed with addition of extinction and instrument error. Each component contributing to this final apparent photometry are stored in other columns with thephotosys_filternameformat with relevant prefixing/suffixing as listed below:The intrinsic photometry are stored in the suffixed
_IntrinsickeysThe extinction values are stored in the prefixed
A_keysThe properties’ standard error are stored in the suffixed
_SigkeysThe properties’ actually drawn gaussian error are stored in the suffixed
_Errkeys
Note that because the error model generally also affect astrometry, the latter 2 suffixing rules also apply to the astrometric properties.
The extinction post-processing routine also add 3 properties:
The line-of-sight hydrogen column density in \(cm^{-2}\) and decimal logarithmic scale via key
log10_NHThe reddening index via key
E(B-V)The reference extinction (which extinction coefficients are based on) via key
A_0
- property particles: Dict[str, ndarray[Any, dtype[_ScalarType_co]]]#
- property particle_masses: ndarray[Any, dtype[_ScalarType_co]]#
- property particle_positions: ndarray[Any, dtype[_ScalarType_co]]#
- property particle_velocities: ndarray[Any, dtype[_ScalarType_co]]#
- property name: str#
- property ngb: int#
- property universe_rshell: ndarray[Any, dtype[_ScalarType_co]]#
- property observer_position: ndarray[Any, dtype[_ScalarType_co]]#
- property observer_velocity: ndarray[Any, dtype[_ScalarType_co]]#
- property densities: Dict[str, ndarray[Any, dtype[_ScalarType_co]]]#
- property extinctions#
- property errors#
- property parameters: Dict[str, Any]#
- property photo_sys: str#
- property galaxia_photosystems: List[PhotoSystem]#
- property galaxia_isochrones#
- property galaxia_catalogue_mag_names: Tuple[str]#
- property intrinsic_catalogue_mag_names: Tuple[str]#
- property galaxia_catalogue_mag_and_astrometrics: Tuple[str]#
- property galaxia_catalogue_keys: Tuple[str]#
- property photosystems_zeropoints: Quantity#
- property photosystems_zeropoints_dict: Dict[str, Quantity]#
- classmethod make_dummy_particles_input(n_parts=100000, with_densities=False) Dict[str, ndarray[Any, dtype[_ScalarType_co]]][source]#
Generate an example dummy input particles dictionary for Ananke made of randomly generated arrays.
- Parameters:
n_parts (int) – Number of particles the example include. Default to 10**5.
with_densities (bool) – Flag to include dummy densities estimates in the returned dictionary. Default to False
- Returns:
p – Dummy example input particles dictionary for Ananke.
- Return type:
dict
Notes
The particle dictionary includes the following properties with corresponding keys:
Position coordinates in \(kpc\) (Nx3) via key
pos3Velocity coordinates in \(km/s\) (Nx3) via key
vel3Stellar masses in solar masses via key
massStellar metallicity \([Fe/H]\) in dex relative to solar via key
fehStellar 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:
Magnesium abundance \([Mg/H]\) in \(dex\) via key
magnesiumIndex of the data partition that contains the particle via key
partitionidIndex of parent particle via key
parentidOxygen abundance \([O/H]\) in \(dex\) via key
oxygenNitrogen abundance \([N/H]\) in \(dex\) via key
nitrogenIndex of parent particle population via key
idCarbon abundance \([C/H]\) in \(dex\) via key
carbonCalcium abundance \([Ca/H]\) in \(dex\) via key
calciumAlpha abundance \([Mg/Fe]\) in \(dex\) via key
alphaSulphur abundance \([S/H]\) in \(dex\) via key
sulphurFormation distance of parent particle in kpc via key
dformSilicon abundance \([Si/H]\) in \(dex\) via key
siliconHelium abundance \([He/H]\) in \(dex\) via key
heliumNeon abundance \([Ne/H]\) in \(dex\) via key
neon
Ananke compute the phase space densities that are used to determine particle smoothing lengths, but the dictionary can include pre-computed densities with the following entries:
Position space density in \(kpc^{-3}\) via key
rho_posVelocity space density in \([km/s]^{-3}\) via key
rho_vel
- classmethod display_available_photometric_systems()[source]#
Return a nested dictionary of all photometric systems that are available in Galaxia.
- Returns:
available_photo_systems – Dictionary of dictionaries of Isochrone objects.
- Return type:
dict
- classmethod display_extinction_docs() None[source]#
Print the ExtinctionDriver constructor docstring