Skip to content

Conversation

Samhori
Copy link

@Samhori Samhori commented Mar 18, 2025

Pull request for the development of the posterior skymap request. Currently, still some work to be done before we are ready to merge.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make ang_err own function

@jessiethw jessiethw self-requested a review June 19, 2025 16:13
Copy link
Collaborator

@jessiethw jessiethw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the new code @Samhori ! A few suggestions to make parts a bit clearer + some formatting. Overall looks very good!

One comment I made a couple times but not everywhere is to add docstrings to each function for the documentation. Most of the info you already included, but please format so that they appear correctly in the documentation when it's generated

_float_index = not _fix_index
_index = 2.5
_index = 2.5
_nside = 512
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a different nside than current. can you either make this a default in the posterior part of the code, or somehow else differentiate the nside you need? (giving it a new name also works)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be whatever we want (changed for testing, will change it back), but we should probably talk about what value we want to send out. Multiple neutrinos can give resolutions much better than the floor for a single neutrino

from . import sensitivity_utils
from . import plotting_utils
from .reports import FastResponseReport
from .reports import FastResponseReport,FastResponsePosteriorReport
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space after the comma

if livestream_start is None or livestream_stop is None:
livestream_start = self.start - 6.
livestream_stop = self.stop
print("livestream",livestream_start, livestream_stop)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for troubleshooting purposes? can probably put these in the if self._verbose or remove (same on ln 205)

events = self.llh.exp
events = events[(events['time'] < self.stop) & (events['time'] > self.start)]

print(custom_events)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this a bit clearer? I think it's a good idea to print any custom events injected, but can you give the user a message about what is being printed and the names (assuming this is the normal structured ndarray as events). something like

Custom events injected:
run, event, ra, dec
<array>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move this somewhere else? It is in there for debugging for now, but I don't think this is the right place to print custom events if we want to keep that


print(custom_events)
if(custom_events is not None):
events=np.concatenate([events,custom_events])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're passing these separately in each function, can you maybe plot them with a different linestyle to show they are injected? maybe dashed or something, to make it clearer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment in ln 619/637-638


self.PosteriorSkymap=outputProbHPMap
self._make_posterior_fits()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra newlines

temporal_weights = self.llh.temporal_model.signal(self.llh._events)
msk = spatial_weights * energy_ratio * temporal_weights > 10
self.coincident_events = []
if(custom_events!=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment above about distinguishing injected events also applies here

Phi[bins] = Phi[0]

return Theta, Phi
def plot_events2(dec,ra,sigmas, src_ra, src_dec, reso, sigma_scale=5., col = 'k', constant_sigma=False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you choose a more descriptive name here? just so it's clear what the difference between this and just plot_events is

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rather than adding these shell scripts, can you add the calls for two examples to the README at top level?


f = CascadeFollowup(name, args.skymap, start, stop, skipped=args.alert_id)
t_mask=(f.llh.exp['time']<=f.stop)&(f.llh.exp['time']>=f.start)
print("__________________________________",f.start,f.stop)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you have several messages printing by default - can you make sure that it's clear what each is when printed for the user to understand?

@Samhori Samhori self-assigned this Jul 11, 2025
@Samhori Samhori requested a review from physics-png July 11, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants