galaxia_ananke.Output module#

Contains the Output class definition

Please note that this module is private. The Output class is available in the main galaxia_ananke namespace - use that instead.

galaxia_ananke.Output.shift_g_lon(lon)[source]#
class galaxia_ananke.Output.Output(survey: Survey)[source]#

Bases: object

__init__(survey: Survey) None[source]#

Driver to exploit the output of Galaxia.

Call signature::

output = Output(survey)

Parameters:

survey (Survey) – Survey object that returned this 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:

  • Stellar ages in years and decimal logarithmic scale via key age

  • Parallax in milliarcseconds via key pi

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

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

  • Equatorial proper motions in milliarcseconds per year via keys (mura, mudec)

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

  • Velocity coordinates in \(km/s\) via keys (vx, vy, vz)

  • Current stellar mass in solar masses via key mact

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

  • 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

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

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

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

  • Distance modulus in magnitude units via key dmod

  • Index of parent particle via key parentid

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

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

  • Distance in \(kpc\) via key rad

  • Surface temperature in Kelvin and decimal logarithmic scale via key teff

  • Celestial equatorial coordinates in \(degrees\) via keys (ra, dec)

Additionally, depending on what optional properties were provided with the input particle data, the output can also include the following properties:

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

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

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

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

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

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

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

  • Formation distance of parent particle in kpc via key dform

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

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

  • Index of parent particle population via key satid

  • Neon abundance \([Ne/H]\) in \(dex\) via key neon

read_galaxia_output(partitioning_rule: CallableDFtoInt | None, max_pp_workers: int, pp_auto_flush: bool) None[source]#
apply_post_process_pipeline_and_flush(post_process: CallableDFtoNone, *args, flush_with_columns=(), hold_flush: bool = False, hold_reload: bool = False, consolidate_partitions_per_process: bool = False, update_metadata: Dict[str, str | int | float] | None = None) None[source]#

Apply a given post processing routine to the catalogue

Parameters:
  • post_process (callable) – Post processing pipeline to apply to the catalogue. This must be defined as a callable that returns nothing, and take only positional arguments, the first of which being the DataFrame representing the catalogue.

  • *args (callable args) – Any other positinoal arguments that should be passed to the post_process callable pipeline, in the order they should be passed.

  • flush_with_columns (iterable) – If given an iterable structure of existing column keys, the flushing done after application of the post-processing will also overwrite those in the backend file with their current in-memory values. Default to an empty tuple.

  • hold_flush (bool) – Flag to hold the flushing from being done after application of the post-processing. Default to False.

  • hold_reload (bool) – Flag to hold the reload from being done after application of the post-processing and flushing. Default to False.

  • consolidate_partitions_per_process (bool) – TODO

  • update_metadata (dict) – TODO

post_process_output() None[source]#
save(path)[source]#

Save output to new path

Danger

currently not implemented

property check_state_before_running#
property caching#
property verbose#
property survey#
property photosystems#
property export_keys: Tuple[str]#
property catalogue_keys: Tuple[str]#
property output_dir#
property output_name#
property rsun_skycoord#
property parameters: Dict[str, str | int | float]#
property parameter_mag_color_names: str#
property parameter_magnitude_name: str#
property parameter_abs_mag_hi: str#
property parameter_app_mag_hi: str#
property all_metadata: Dict[str, Any]#
flush_extra_columns_to_hdf5(with_columns: Iterable | None = (), update_metadata: Dict[str, str | int | float] | None = None) None[source]#

Flush the dataframe new columns to its backend memory-mapped file

Parameters:
  • with_columns (iterable) – If given an iterable structure of existing column keys, the flushing will also overwrite those in the backend file with their current in-memory values. Default to an empty tuple.

  • update_metadata (dict) – TODO