Skip to content

Commit

Permalink
Redo observations (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein authored Mar 28, 2024
1 parent 4a08aae commit 53302ca
Show file tree
Hide file tree
Showing 9 changed files with 428 additions and 779 deletions.
468 changes: 91 additions & 377 deletions nuztf/base_scanner.py

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions nuztf/irsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from ztfquery.lightcurve import LCQuery

from nuztf.ampel_api import ampel_api_name
from nuztf.observations import get_most_recent_obs
from nuztf.parse_nu_gcn import find_gcn_no, parse_gcn_circular
from nuztf.style import base_height, base_width, big_fontsize, dpi, plot_dir
from nuztf.utils import cosmo, is_tns_name, is_ztf_name, query_tns_by_name
Expand Down Expand Up @@ -307,24 +306,6 @@ def plot_irsa_lightcurve(
f"{latest['filtercode'][1]}={latest['mag']:.2f}+/-{latest['magerr']:.2f}"
)

# If you want, you can check the most recent observation

if check_obs:
logger.info(
f"Getting most recent ZTF observation, looking back {check_obs_lookback_weeks} weeks."
)
mro = get_most_recent_obs(
ra=source_coords[0],
dec=source_coords[1],
lookback_weeks_max=check_obs_lookback_weeks,
)

if mro is not None:
ot = format_date(Time(mro["obsjd"], format="jd"), atel=atel)
logger.info(f"Most recent observation at {ot}")
else:
logger.info("No recent observation found.")

# Plot each band (g/r/i)

for fc in ["zg", "zr", "zi"]:
Expand Down
12 changes: 10 additions & 2 deletions nuztf/neutrino_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,16 @@ def unpack_skymap(self, skymap=None, output_nside: None | int = None):
data = np.zeros(hp.nside2npix(output_nside), dtype=np.dtype([(key, float)]))
data[np.array(pixel_nos)] = map_probs

pixel_area = hp.nside2pixarea(output_nside, degrees=True) * float(
total_pixel_area = hp.nside2pixarea(output_nside, degrees=True) * float(
len(map_coords)
)

return map_coords, pixel_nos, output_nside, map_probs, data, pixel_area, key
return (
map_coords,
pixel_nos,
output_nside,
map_probs,
data,
total_pixel_area,
key,
)
Loading

0 comments on commit 53302ca

Please sign in to comment.