From 2a2245c7631df2f59fc36530119a46ad2522066a Mon Sep 17 00:00:00 2001 From: Tomas Stolker Date: Tue, 23 Apr 2024 10:01:27 +0200 Subject: [PATCH] Added allwise_catalog parameter to target_star --- calistar/calistar.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/calistar/calistar.py b/calistar/calistar.py index fd61647..47ae9e3 100644 --- a/calistar/calistar.py +++ b/calistar/calistar.py @@ -170,6 +170,7 @@ def target_star( self, write_json: bool = True, get_gaiaxp: bool = True, + allwise_catalog: bool = True, ) -> Dict[str, Union[str, float]]: """ Function for retrieving the the astrometric and @@ -190,6 +191,10 @@ def target_star( If set to ``True``, the spectrum will be written to a data file and a plot will also be created. The spectrum is not retrieved when the argument is set to ``False``. + allwise_catalog : bool + Select the WISE magnitudes from the ALLWISE catalog if set + to ``True`` or select the magnitudes from the earlier WISE + catalog if set to ``False``. Returns ------- @@ -536,7 +541,7 @@ def target_star( print("\n-> Querying VizieR...\n") vizier_obj = Vizier( - columns=["*", "+_r"], catalog=["II/246/out", "II/328/allwise"] + columns=["*", "+_r"], catalog=["II/246/out", "II/328/allwise", "II/311/wise"] ) radius = u.Quantity(1.0 * u.arcmin) @@ -587,13 +592,21 @@ def target_star( # WISE data from VizieR - vizier_wise = vizier_result["II/328/allwise"] + if allwise_catalog: + vizier_wise = vizier_result["II/328/allwise"] + else: + vizier_wise = vizier_result["II/311/wise"] + vizier_wise = vizier_wise[0] - print(f"\nALLWISE source ID = {vizier_wise['AllWISE']}") + if allwise_catalog: + print(f"\nALLWISE source ID = {vizier_wise['AllWISE']}") + else: + print(vizier_wise.columns) + print(f"\nWISE source ID = {vizier_wise['WISE']}") print( - f"Separation between Gaia and ALLWISE source = " + f"Separation between Gaia and WISE source = " f"{1e3*vizier_wise['_r']:.1f} mas" )