Skip to content

Commit

Permalink
Better Gaia check
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed Apr 22, 2024
1 parent 438c5f4 commit 3044d1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mirar/catalog/multibackend/gaia2mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ def set_backend(backend: str | None) -> Type[BaseCatalog]:

if backend is None:
# pylint: disable=protected-access,no-member
if Gaia._TapPlus__getconnhandler().get_response_status() != 0:
if Gaia._TapPlus__getconnhandler().get_response_status() == 200:
# Gaia goes down sometimes
# response status 0 means it's down, need to confirm what it is when up
# my guess is 200 but could be 1
# Response status 0 means it's down, 200 when up and working
backend = "gaia_tap"
else:
logger.warning("Gaia TAP service is down, cannot use default backend.")
Expand Down
6 changes: 5 additions & 1 deletion mirar/catalog/tap/gaia2mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Gaia2MassTAP(BaseGaia2Mass):
Crossmatched Gaia/2Mass catalog
"""

def __init__(self, *args, snr_threshold: DEFAULT_SNR_THRESHOLD, **kwargs):
def __init__(self, *args, snr_threshold: float = DEFAULT_SNR_THRESHOLD, **kwargs):
super().__init__(*args, **kwargs)
self.snr_threshold = snr_threshold

Expand Down Expand Up @@ -57,8 +57,12 @@ def get_source_table(
src_list["ph_qual"] = src_list["ph_qual"].astype(str)
src_list["ra_errdeg"] = src_list["ra_error"] / 3.6e6
src_list["dec_errdeg"] = src_list["dec_error"] / 3.6e6

src_list["FLAGS"] = 0
src_list["magnitude"] = src_list[f"{self.filter_name.lower()}_m"]
src_list["magnitude_err"] = src_list[f"{self.filter_name.lower()}_msigcom"]
src_list["h_m"] = src_list["hs_m"]
src_list["h_msigcom"] = src_list["hs_msigcom"]

logger.debug(f"Found {len(src_list)} sources in Gaia")
return src_list

0 comments on commit 3044d1a

Please sign in to comment.