Stellar companion¶
[1]:
import matplotlib.pyplot as plt
import numpy as np
[2]:
from exogaia.data import EpochAstrometry
from exogaia.leastsq import LeastSquares
The archive is unstable and may perform below expectations. If launching multiple, consecutive, heavy queries through Python, please space them out (e.g., using sleep(1)) to avoid overloading the system. Please contact the Gaia helpdesk in case of questions (https://www.cosmos.esa.int/web/gaia/gaia-helpdesk). Workaround solutions for the issues following the December 2025 infrastructure upgrade: https://www.cosmos.esa.int/web/gaia/news#WorkaroundArchive
[3]:
np.random.seed(42)
[4]:
source_id = 6199395656645840384 # HD 135344 A
primary_mass = (2.2, 0.1) # (Msun)
mass_2 = 0.7 # (Msun)
[5]:
epoch_astrom = EpochAstrometry(primary_mass=primary_mass, gaia_release='DR4')
----------------
Epoch astrometry
----------------
Gaia release: DR4
Reference epoch: 2017.5
Primary mass (Msun): 2.20 +/- 0.10
[6]:
star_param = epoch_astrom.query_source(source_id=source_id, gaia_release='DR3')
---------------
Querying source
---------------
Gaia release: DR3
Source ID: 6199395656645840384
INFO: Query finished. [astroquery.utils.tap.core]
RA = 228.954 deg +/- 0.038 mas
Dec = -37.149 deg +/- 0.026 mas
Parallax = 7.411 +/- 0.040 mas
Proper motion in RA = -18.738 +/- 0.051 mas/yr
Proper motion in Dec = -24.008 +/- 0.035 mas/yr
G-band magnitude = 7.748
Pseudocolor = 1.73 um-1
UWE = 1.96
RUWE = 0.95
Astrometric excess noise (mas) = 0.2075 +/- 0.0103
Non single star = 0
[7]:
model_param = {
'ecc': 0.0,
'tau': 0.5,
'inc': np.radians(30.),
'aop': np.radians(0.),
'pan': np.radians(90.),
'sma': 2.,
}
[8]:
model_param = epoch_astrom.simulate_data(
model_param=model_param,
mass_2=mass_2,
flux_ratio=None,
occ_rate=None,
sigma_per_ccd=None,
csv_out=None,
)
-------------
Simulate data
-------------
System type: binary
Primary mass (Msun): 2.20 +/- 0.10
AL scan uncertainty (per CCD) = 193.14 uas
AL scan uncertainty (per transit) = 68.29 uas
Additional parameters:
- Primary mass (Msun) = 2.20
- Companion mass (Msun) = 7.00e-01
- Mass ratio = 3.18e-01
- Flux ratio = 1.82e-02
- Relative semi-major axis (au) = 2.00
-----------------------
Calculate stellar track
-----------------------
Stellar parameters:
- RA offset (mas) = 0.000
- Dec offset (mas) = 0.000
- Parallax (mas) = 7.411
- Proper motion in RA (mas/yr) = -18.738
- Proper motion in Dec (mas/yr) = -24.008
---------------------
Calculate orbit model
---------------------
Orbit parameters:
- Period (days) = 606.647
- Eccentricity = 0.000
- Relative time of periastron = 0.500
- Semi-major axis (mas) = 14.821
- Inclination (deg) = 30.000
- Argument of periastron (deg) = 0.000
- PA of ascending node (deg) = 90.000
Applying AL bias from binarity:
- Unresolved epochs = 64 / 97
- Marginally resolved epochs = 33 / 97
- Resolved epochs = 0 / 97
[9]:
leastsq = LeastSquares(epoch_astrometry=epoch_astrom)
[10]:
fig = leastsq.orbit_grid(plot_file='orbit_grid.png', n_points=30)
--------------------------
Orbit grid (12-parameters)
--------------------------
Best-fit RUWE = 15.880
Best-fit stellar track:
- RA offset (mas) = 3.573 +/- 0.135
- Dec offset (mas) = -1.429 +/- 0.108
- Parallax (mas) = 8.263 +/- 0.072
- mu in RA (mas/yr) = -18.860 +/- 0.039
- mu in Dec (mas/yr) = -23.742 +/- 0.020
Best-fit orbit:
- Period (days) = 672.336
- Eccentricity = 0.767
- Relative time of periastron = 0.07
- Thiele-Innes A = -0.946 +/- 0.077
- Thiele-Innes B = 3.238 +/- 0.108
- Thiele-Innes F = -2.746 +/- 0.080
- Thiele-Innes G = -1.634 +/- 0.123
Derived parameters:
- Semi-major axis of photocenter (mas) = 3.681 +/- 0.107
- Relative semi-major axis (au) = 2.114
- Mass function (Msun) = 2.609e-02
- Companion mass (Msun) = 5.875e-01
Conversion to campbell elements:
- Period = 672.336 days
- Eccentricity = 0.767
- Relative time of periastron = 0.067
- Semi-major axis of photocenter (mas) = 3.681
- Inclination (deg) = 39.624
- Argument of periastron (deg) = 38.881
- PA of ascending node (deg) = 74.449
[11]:
fig = leastsq.orbit_fit(inc_jitter=False, plot_file='orbit_fit.png')
-------------------------
Orbit fit (12 parameters)
-------------------------
Reduced chi^2: 0.479
RUWE: 0.692
Best-fit stellar track:
- RA offset (mas) = 0.008 +/- 0.044
- Dec offset (mas) = 0.012 +/- 0.016
- Parallax (mas) = 7.406 +/- 0.017
- mu in RA (mas/yr) = -18.718 +/- 0.010
- mu in Dec (mas/yr) = -24.016 +/- 0.006
Best-fit orbit:
- Period (days) = 606.451 +/- 0.355
- Eccentricity = 0.000 +/- 0.008
- Relative time of periastron = 0.040 +/- 4917.879
- Semi-major axis of photocenter (mas) = 3.334 +/- 0.021
- Inclination (deg) = 30.339 +/- 0.796
- Argument of periastron (deg) = 14.983 +/- 1770436.314
- PA of ascending node (deg) = 89.117 +/- 1.657
Number of function evaluations: 16
Number of Jacobian evaluations: 13
Derived parameters:
- Relative semi-major axis (au) = 1.987
- Mass function (Msun) = 3.309e-02
- Companion mass (Msun) = 6.445e-01