Skip to content

Commit

Permalink
Store astrophysical parameters in output dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasstolker committed Jun 18, 2024
1 parent 8e4e10c commit 7aa09b9
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions calistar/calistar.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,17 @@ def target_star(
float(gaia_result["parallax_error"][0]), # (mas)
)

target_dict[f"GAIA/GAIA{self.gaia_idx}.G"] = (
float(gaia_result["phot_g_mean_mag"][0]),
mag_g_error,
)
if "phot_g_mean_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["phot_g_mean_mag"][0]):
target_dict[f"GAIA/GAIA{self.gaia_idx}.G"] = (
float(gaia_result["phot_g_mean_mag"][0]),
mag_g_error,
)

print(
f"\nG mag = {gaia_result['phot_g_mean_mag'][0]:.6f} +/- {mag_g_error:.6f}"
)


if "phot_bp_mean_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["phot_bp_mean_mag"][0]):
Expand All @@ -310,20 +317,34 @@ def target_star(
mag_bp_error,
)

print(
f"BP mag = {gaia_result['phot_bp_mean_mag'][0]:.6f} +/- {mag_bp_error:.6f}"
)

if "phot_rp_mean_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["phot_rp_mean_mag"][0]):
target_dict[f"GAIA/GAIA{self.gaia_idx}.Grp"] = (
float(gaia_result["phot_rp_mean_mag"][0]),
mag_rp_error,
)

print(
f"RP mag = {gaia_result['phot_rp_mean_mag'][0]:.6f} +/- {mag_rp_error:.6f}"
)

if "grvs_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["grvs_mag"][0]):
target_dict[f"GAIA/GAIA{self.gaia_idx}.Grvs"] = (
float(gaia_result["grvs_mag"][0]),
float(gaia_result["grvs_mag_error"][0]),
)

print(
f"GRVS mag = {gaia_result['grvs_mag'][0]:.6f} "
f"+/- {gaia_result['grvs_mag_error'][0]:.6f}"
)


# Create SkyCoord object from the RA and Dec of the selected Gaia source ID

gaia_coord = SkyCoord(
Expand Down Expand Up @@ -376,29 +397,6 @@ def target_star(
f"+/- {gaia_result['radial_velocity_error'][0]:.2f} km/s"
)

print(
f"\nG mag = {gaia_result['phot_g_mean_mag'][0]:.6f} +/- {mag_g_error:.6f}"
)

if "phot_bp_mean_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["phot_bp_mean_mag"][0]):
print(
f"BP mag = {gaia_result['phot_bp_mean_mag'][0]:.6f} +/- {mag_bp_error:.6f}"
)

if "phot_rp_mean_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["phot_rp_mean_mag"][0]):
print(
f"RP mag = {gaia_result['phot_rp_mean_mag'][0]:.6f} +/- {mag_rp_error:.6f}"
)

if "grvs_mag" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["grvs_mag"][0]):
print(
f"GRVS mag = {gaia_result['grvs_mag'][0]:.6f} "
f"+/- {gaia_result['grvs_mag_error'][0]:.6f}"
)

if "teff_gspphot" in gaia_result.columns:
if not np.ma.is_masked(gaia_result["teff_gspphot"]):
print(
Expand All @@ -408,6 +406,11 @@ def target_star(
print(f"Metallicity = {gaia_result['mh_gspphot'][0]:.2f}")
print(f"G-band extinction = {gaia_result['ag_gspphot'][0]:.2f}")

target_dict["teff"] = float(gaia_result['teff_gspphot'][0])
target_dict["log(g)"] = float(gaia_result['logg_gspphot'][0])
target_dict["metallicity"] = float(gaia_result['mh_gspphot'][0])
target_dict["ag_ext"] = float(gaia_result['ag_gspphot'][0])

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

0 comments on commit 7aa09b9

Please sign in to comment.