Single star

[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)

The EpochAstrometry class is used for storing Gaia epoch astrometry. For now, we can simulate epoch astrometry for Gaia DR4 or DR5. To do so, we can either set the stellar parameters manually or retrieve parameters from DR3. In this example, we will simulate DR4 epoch astrometry for the star HD 135344 A.

[4]:
source_id = 6199395656645840384  # HD 135344 A
primary_mass = (2.2, 0.1)  # (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

Next, we query the stellar parameters from Gaia DR3. These will be stored as attributes of the EpochAstrometry object and returned as list for convenience.

[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

We use the retrieved parameters of HD 135344 A, so we don’t need to provide any parameters in the model_param dictionary.

[7]:
model_param = epoch_astrom.simulate_data(
    model_param=None,
    mass_2=None,
    flux_ratio=None,
    occ_rate=None,
    sigma_per_ccd=None,
    csv_out=None,
    reject_fraction=False,
)

-------------
Simulate data
-------------

System type: single

Primary mass (Msun): 2.20 +/- 0.10

AL scan uncertainty (per CCD) = 193.14 uas
AL scan uncertainty (per transit) = 68.29 uas

-----------------------
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
[8]:
print(model_param)
{'parallax': 7.410549860402929, 'pm_ra': -18.737737844165032, 'pm_dec': -24.00776147540073, 'ra_offset': 0.0, 'dec_offset': 0.0}

Next, we run a 5-parameter least-squares fit to determine the best-fit parameters and uncertainties of the stellar track.

[9]:
leastsq = LeastSquares(epoch_astrometry=epoch_astrom)
[10]:
results = leastsq.singl_5param(plot_file='plot.png')

--------------------------
Single star (5 parameters)
--------------------------

Reduced chi^2 = 0.899
RUWE = 0.948
F2 estimator = -0.658
Inflation factor = 0.952

Best-fit parameters:
   - RA offset = 0.003 +/- 0.014 mas
   - Dec offset = -0.006 +/- 0.010 mas
   - Parallax = 7.432 +/- 0.016 mas
   - mu in RA = -18.727 +/- 0.009 mas/yr
   - mu in Dec = -24.014 +/- 0.005 mas/yr
../_images/tutorials_single_star_14_1.png