Skip to content

Commit

Permalink
Gaiapm (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein committed May 17, 2024
1 parent 0f14c97 commit 15829b4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
27 changes: 25 additions & 2 deletions nuztf/cat_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ def ampel_api_tns(
return full_name, discovery_date, source_group


def get_cross_match_info(raw: dict, logger=None):
""" """
def get_cross_match_info(raw: dict, logger=None) -> str:
"""
Function to get cross-match info for a given alert
:param raw: Raw alert data
:param logger: Logger
:return: String with cross-match info
"""
cache_file = CROSSMATCH_CACHE.joinpath(f"{raw['objectId']}.json")

if cache_file.exists():
Expand Down Expand Up @@ -184,6 +189,7 @@ def get_cross_match_info(raw: dict, logger=None):
logger=logger,
)
if res is not None:

if res[0]["body"]["Plx"] is not None:
plx_sig = res[0]["body"]["Plx"] / res[0]["body"]["ErrPlx"]
if plx_sig > 3.0:
Expand All @@ -192,6 +198,23 @@ def get_cross_match_info(raw: dict, logger=None):
f"({res[0]['dist_arcsec']:.2f} arsec)]"
)

elif res[0]["body"]["PMRA"] is not None:
pmra_sig = abs(res[0]["body"]["PMRA"] / res[0]["body"]["ErrPMRA"])
if pmra_sig > 3.0:
label = (
f"[GAIADR2: {pmra_sig:.1f}-sigma proper motion (RA) "
f"({res[0]['dist_arcsec']:.2f} arsec)]"
)
elif res[0]["body"]["PMDec"] is not None:
pmdec_sig = abs(
res[0]["body"]["PMDec"] / res[0]["body"]["ErrPMDec"]
)
if pmdec_sig > 3.0:
label = (
f"[GAIADR2: {pmdec_sig:.1f}-sigma proper motion (Dec) "
f"({res[0]['dist_arcsec']:.2f} arsec)]"
)

# Check if classified as probable star in SDSS

if label == "":
Expand Down
7 changes: 7 additions & 0 deletions nuztf/skymap_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ def unpack_skymap(self, output_nside: None | int = None):

mask = self.skymap.data[self.skymap.key] > self.skymap.pixel_threshold

max_pix = max(self.skymap.data[self.skymap.key])
idx_max = list(self.skymap.data[self.skymap.key]).index(max_pix)

ra, dec = self.extract_ra_dec(nside, idx_max)

self.logger.info(f"hottest_pixel: {ra} {dec}")

map_coords = []

pixel_nos = []
Expand Down

0 comments on commit 15829b4

Please sign in to comment.