gaia_access 0.1.1

Access the Gaia ESA Archive for astronomical data.
Documentation
// This code is generated by generate_code.py, do not modify it manually.

//! This module contains all the known columns in the gaiadr2_geometric_distance table.

use crate::traits::{Column, Table};

/// Estimating distances from parallaxes IV: Distances to 1.33 billion stars in Gaia Data Release 2. Bailer-Jones et al. 2018 AJ 156:58, https://doi.org/10.3847/1538-3881/aacb21. The catalogue provides distances estimates (and uncertainties therein) for 1.33 billion stars over the whole sky brighter than about G=20.7. These have been estimated using the parallaxes (and their uncertainties) from Gaia data release 2. A Bayesian procedure was used involving a prior with a single parameter L(l,b), which varies smoothly with Galactic longitude and latitude according to a Galaxy model. The posterior is summarized with a point estimate (usually the mode) and a confidence interval (usually the 68% highest density interval). The estimation procedure is described in detail in the accompanying paper, which also analyses the catalogue content. The catalogue comprises one table with 1.33 billion rows and seven columns. The accompanying paper explains under what circumstances the different estimates/modality occur. These should not be mixed in any statistical analyses. Around 99.9% of all sources have result_flag=1 and modality_flag=1.
#[allow(non_camel_case_types)]
pub struct gaiadr2_geometric_distance;

impl Table for gaiadr2_geometric_distance {
    fn string(&self) -> String {
        "gaiadr2_geometric_distance".to_string()
    }
}

/// The columns in the gaiadr2_geometric_distance table.
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, strum::Display)]
pub enum Col {
    /// Gaia source identifier, identical to the Gaia-DR2 source_id.
    source_id,
    /// Estimated distance.
    r_est,
    /// Lower bound on the confidence interval of the estimated distance.
    r_lo,
    /// Upper bound on the confidence interval of the estimated distance.
    r_hi,
    /// Length scale used in the prior for the distance estimation.
    r_len,
    /// Type of result. Three possible values: 0 = failed estimate (r_est, r_lo, r_hi are all null) ; 1 = r_est is the mode (highest if the posterior is bimodal); r_lo/r_hi define the lower/upper limits of the highest density interval (HDI) containing 68% of the posterior probability ; 2 = r_est is the median; r_lo/r_hi define the lower/upper limits of the equal-tailed interval (ETI), containing 68% of the posterior probability.
    result_flag,
    /// Result regime flag: number of modes in the posterior (1 or 2).
    modality_flag,
}

impl Column for Col {}

#[cfg(test)]
pub fn collect_known(map: &mut std::collections::HashMap<String, Vec<String>>) {
    let mut col_strings = Vec::new();
    col_strings.push(Col::source_id.to_string());
    col_strings.push(Col::r_est.to_string());
    col_strings.push(Col::r_lo.to_string());
    col_strings.push(Col::r_hi.to_string());
    col_strings.push(Col::r_len.to_string());
    col_strings.push(Col::result_flag.to_string());
    col_strings.push(Col::modality_flag.to_string());
    map.insert(gaiadr2_geometric_distance.string(), col_strings);
}