Skip to content

Commit

Permalink
Added Gaia RUWE to output table, fixed issues with selecting the corr…
Browse files Browse the repository at this point in the history
…ect Gaia source catalog
  • Loading branch information
tomasstolker committed Nov 4, 2023
1 parent b98752d commit 3d5c265
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions calistar/calistar.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,19 +386,22 @@ def target_star(
print(f"Metallicity = {gaia_result['mh_gspphot'][0]:.2f}")
print(f"G-band extinction = {gaia_result['ag_gspphot'][0]:.2f}")

print(
f"\nAstrometric excess noise = {gaia_result['astrometric_excess_noise'][0]:.2f}"
)

if "ruwe" in gaia_result.columns:
print(f"RUWE = {gaia_result['ruwe'][0]:.2f}")

if "non_single_star" in gaia_result.columns:
print(f"\nNon single star = {gaia_result['non_single_star'][0]}")
print(f"Non single star = {gaia_result['non_single_star'][0]}")

if "classprob_dsc_combmod_star" in gaia_result.columns:
print(
"Single star probability from DSC-Combmod = "
f"{gaia_result['classprob_dsc_combmod_star'][0]:.2f}"
)

print(
f"Astrometric excess noise = {gaia_result['astrometric_excess_noise'][0]:.2f}"
)

if "has_xp_continuous" in gaia_result.columns:
print(f"\nXP continuous = {gaia_result['has_xp_continuous'][0]}")

Expand Down Expand Up @@ -627,7 +630,7 @@ def find_calib(
gaia_query = f"""
SELECT *, DISTANCE({target_dict['Gaia RA'][0]},
{target_dict['Gaia Dec'][0]}, ra, dec) AS ang_sep
FROM gaiadr3.gaia_source
FROM gaia{self.gaia_release.lower()}.gaia_source
WHERE DISTANCE({target_dict['Gaia RA'][0]},
{target_dict['Gaia Dec'][0]}, ra, dec) < {search_radius}
AND phot_g_mean_mag > {mag_low}
Expand All @@ -647,9 +650,10 @@ def find_calib(
"Gaia ID",
"SpT",
"Separation",
"Astrometric excess noise",
"RUWE",
"Non single star",
"Single star probability",
"Astrometric excess noise",
]

columns += self.all_filters
Expand Down Expand Up @@ -776,7 +780,7 @@ def find_calib(
# This query returns no sources?
# gaia_query = f"""
# SELECT *
# FROM gaiadr3.allwise_best_neighbour
# FROM gaia{self.gaia_release.lower()}.allwise_best_neighbour
# WHERE source_id = {self.gaia_source}
# """
# gaia_job = Gaia.launch_job_async(gaia_query,
Expand All @@ -786,18 +790,23 @@ def find_calib(
else:
drop_indices.append(gaia_item.index)

cal_df.loc[gaia_item.index, "Non single star"] = gaia_item[
"non_single_star"
]

cal_df.loc[gaia_item.index, "Single star probability"] = gaia_item[
"classprob_dsc_combmod_star"
]

cal_df.loc[gaia_item.index, "Astrometric excess noise"] = gaia_item[
"astrometric_excess_noise"
]

if "ruwe" in gaia_item:
cal_df.loc[gaia_item.index, "RUWE"] = gaia_item["ruwe"]

if "non_single_star" in gaia_item:
cal_df.loc[gaia_item.index, "Non single star"] = gaia_item[
"non_single_star"
]

if "classprob_dsc_combmod_star" in gaia_item:
cal_df.loc[gaia_item.index, "Single star probability"] = gaia_item[
"classprob_dsc_combmod_star"
]

# Query The Washington Visual Double Star Catalog

if simbad_result is not None:
Expand Down

0 comments on commit 3d5c265

Please sign in to comment.