Welcome to compass’s documentation!

The code described by this documentation is available on https://github.com/herzphi/compass. This package presents a method to evaluate the likelihood of a candidate being a true companion to a host star using a proper motion model based on stochastic models.

Usage

Installation

You can install compass by installing this repo:

pip install git+https://github.com/herzphi/compass.git

Code

To get the odds ratios of all candidates use the Survey class:

import pandas as pd
from compass import model
from compass import helperfunctions

observation = pd.read_csv('observation.csv')
survey_object = model.Survey(observation, magnitudes_column_name)
survey_object.set_fieldstar_models(
    # Color transformed column name from Gaias G-Band.
    magnitudes_column_name_CALC,
    # Column name of the corresponding magnitude in 2MASS.
    magnitudes_column_name_2MASS,
    cone_radius=0.3,  # in degree
    binsize=200  # Number of objects in a single magnitude bin
)
# Inflating parameters to adjust the sharp drop-off of the Gaussians.

survey_object.set_evaluated_fieldstar_models(
    sigma_cc_min=0,
    sigma_model_min=0
)

Indices and tables

compass.model Module

Classes

BackgroundModel(candidate_mag, ...)

Candidate(df_survey, index_candidate, ...)

Model, true data and likelihoods, p_ratios of one candidate.

CovarianceMatrix()

HostStar(target)

Host star of the candidates.

Survey(survey, survey_bandfilter_colname)

Creates odds ratio table based on the observational data of candidates and the field star models.

compass.helperfunctions Module

Functions

add_ellp_patch(pdf, major, minor, angle, ...)

Adds a patch to a figure.

add_ellp_patch2(x_mean, y_mean, major, ...)

Adds a patch to a figure.

calc_prime_1(prime_0, pm, plx, time, plx_proj)

color_trafo_2MASS_H(g_band_mag, bp_rp_mag)

color_trafo_2MASS_J(g_band_mag, bp_rp_mag)

color_trafo_2MASS_K_S(g_band_mag, bp_rp_mag)

convert_df_to_array(df, x_col_name, y_col_name)

Convert dataframe to two 1D arrays.

convolution2d(a, b, A, B)

Returns a Gaussian2D functions and its covariance matrix of the convolution from the two Gaussian2D.

ellipse(x_mean, y_mean, cov, color, axis[, ...])

func_const(x, a)

func_exp(x, a, b, c)

func_exp_inc(x, a, b, c)

func_lin(x, a, b)

gaussian1D(g2d_astropy_func, x_or_y)

get_ellipse_props(cov, confidence)

Calculates the eigenvalues/eigenvectors of the covariance matrix and returns the major and minor axis length of the ellipse. Args: cov (numpy.array (2x2)): Covariance matrix. confidence (float): Probability between 0 and 1. Returns: major_axis (float): Semi-major axis. minor_axis (float): Semi-minor axis. angle (float): Angle of rotation of the ellipse.

get_g2d_func(x_mean, y_mean, x_std, y_std, rho)

get_g2d_parameters(x_data, y_data)

Calculate 2D Gaussian parameters based on two arrays.

n_dim_gauss_evaluated(obs, mean, cov)

parallax_projection(time, host_star)

compass.preset_plots Module

Functions

odds_ratio_sep_mag_plot(candidates_table, ...)

Creates a odds ratio vs.

p_ratio_plot(candidate_object, target, band)

p_ratio_relative_position(candidate_df, ...)

plot_pm_plx_binning_parameters(...)

pm_mag_plot(catalogue, catalogue_name, ...)

propagation_plot(candidate_object, ...)