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: object

Represents 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_docs to find what parameters can be defined

  • e_params (dict) – Parameters to configure the extinction pipeline. Use class method display_extinction_docs to find what parameters can be defined

  • err_params (dict) – Parameters to configure the error model pipeline. Use class method display_errormodel_docs to find what parameters can be defined

  • observer (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 pos3 and vel3. 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 method display_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 band1 is the magnitude filter and (band2, band3) are the filters that define the band2-band3 color 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 (lo for lower and hi for upper). app_mag, abs_mag and color represent 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 method make_dummy_particles_input to 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 vaex online 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 method apply_post_process_pipeline_and_flush. Also if such Output object was generated by other software than Galaxia_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_filtername

where

  • photo_sys corresponds to the chosen photometric system

  • filtername corresponds to a filter name of that system

As an example, the photometry in filters gbp, grp & g of the Gaia DR2 system identified as GAIA__DR2 are respectively under keys gaia__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 partitionid

  • Flag = 1 if star not at center of its parent particle via key partid

  • Stellar metallicity \([Fe/H]\) in \(dex\) relative to solar via key feh

  • Distance in \(kpc\) via key rad

  • Celestial galactic coordinates in \(degrees\) via keys (glon, glat)

  • Current stellar mass in solar masses via key mact

  • Position coordinates in \(kpc\) via keys (px, py, pz)

  • Galactic proper motions in milliarcseconds per year via keys (mul, mub)

  • Parallax in milliarcseconds via key pi

  • Equatorial 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 teff

  • Index of parent particle via key parentid

  • Radial velocity in \(km/s\) via key vr

  • Tip of the Red Giant Branch stellar mass in solar masses via key mtip

  • Surface gravity in CGS units and decimal logarithmic scale via key grav

  • Stellar luminosity in solar luminosities and decimal logarithmic scale via key lum

  • Distance modulus in magnitude units via key dmod

  • Zero Age Main Sequence stellar mass in solar masses via key smass

  • Stellar 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 magnesium

  • Oxygen abundance \([O/H]\) in \(dex\) via key oxygen

  • Nitrogen abundance \([N/H]\) in \(dex\) via key nitrogen

  • Carbon abundance \([C/H]\) in \(dex\) via key carbon

  • Calcium abundance \([Ca/H]\) in \(dex\) via key calcium

  • Alpha abundance \([Mg/Fe]\) in \(dex\) via key alpha

  • Index of parent particle population via key satid

  • Sulphur abundance \([S/H]\) in \(dex\) via key sulphur

  • Formation distance of parent particle in kpc via key dform

  • Silicon abundance \([Si/H]\) in \(dex\) via key silicon

  • Helium abundance \([He/H]\) in \(dex\) via key helium

  • Neon 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 the photosys_filtername format with relevant prefixing/suffixing as listed below:

  • The intrinsic photometry are stored in the suffixed _Intrinsic keys

  • The extinction values are stored in the prefixed A_ keys

  • The properties’ standard error are stored in the suffixed _Sig keys

  • The properties’ actually drawn gaussian error are stored in the suffixed _Err keys

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_NH

  • The 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: Universe#
property universe_rshell: ndarray[Any, dtype[_ScalarType_co]]#
property observer: Observer#
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_dictionary_description() str[source]#
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 pos3

  • Velocity coordinates in \(km/s\) (Nx3) via key vel3

  • Stellar masses in solar masses via key mass

  • Stellar metallicity \([Fe/H]\) in dex relative to solar via key feh

  • 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:

  • Magnesium abundance \([Mg/H]\) in \(dex\) via key magnesium

  • Index of the data partition that contains the particle via key partitionid

  • Index of parent particle via key parentid

  • Oxygen abundance \([O/H]\) in \(dex\) via key oxygen

  • Nitrogen abundance \([N/H]\) in \(dex\) via key nitrogen

  • Index of parent particle population via key id

  • Carbon abundance \([C/H]\) in \(dex\) via key carbon

  • Calcium abundance \([Ca/H]\) in \(dex\) via key calcium

  • Alpha abundance \([Mg/Fe]\) in \(dex\) via key alpha

  • Sulphur abundance \([S/H]\) in \(dex\) via key sulphur

  • Formation distance of parent particle in kpc via key dform

  • Silicon abundance \([Si/H]\) in \(dex\) via key silicon

  • Helium abundance \([He/H]\) in \(dex\) via key helium

  • Neon 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_pos

  • Velocity 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_density_docs() None[source]#

Print the DensitiesDriver constructor docstring

classmethod display_EnBiD_docs() None[source]#

Print the EnBiD.run_enbid method docstring

classmethod display_extinction_docs() None[source]#

Print the ExtinctionDriver constructor docstring

classmethod display_errormodel_docs() None[source]#

Print the ErrorModelDriver constructor docstring

classmethod display_galaxia_makesurvey_docs() None[source]#

Print the Galaxia.Survey.make_survey method docstring