Plotting Points on the SkyΒΆ

It is sometimes interesting to see how various point on the sky relate to the position of Fermi. Here we will demonstrate but plotting the position of a BALROG posterior on the sky.

[1]:
from gbmgeometry import plot_in_space, PositionInterpolator
from gbmgeometry.utils.plotting.sky_point import balrog_to_skypoints
from gbmgeometry.utils.package_utils import get_path_of_data_file

pi = PositionInterpolator.from_trigdat(get_path_of_data_file('balrog_trig.fits'))

skypoints = balrog_to_skypoints(get_path_of_data_file('balrog.fits'), new_nside=2**6, cmap='viridis', as_point=True)

We have constructed a series of SkyPoints from the BALROG posterior. We have chosen to plot them as points on the sky.

[2]:
plot_in_space(pi, 0, sky_points=skypoints,
              show_detector_pointing=True,
              show_moon=True,earth_time='day',
              show_stars=True);
/opt/hostedtoolcache/Python/3.7.11/x64/lib/python3.7/site-packages/gbmgeometry-0+untagged.1.g0bce356-py3.7.egg/gbmgeometry/geometry/sphere.py:180: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (array(float64, 2d, C), array(float64, 1d, A))

Alternatively, we could plot them as rays from Fermi.

[3]:
skypoints = balrog_to_skypoints(get_path_of_data_file('balrog.fits'), new_nside=2**4, cmap='winter_r', as_point=False)

plot_in_space(pi, 0,
              sky_points=skypoints,
              earth_time='thats_no_moon',
              show_stars=True);