Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redo observations #392

Merged
merged 6 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading