GiftsEquatorialPlot¶
- class gdt.missions.gifts.plot.GiftsEquatorialPlot(projection='mollweide', flipped=True, xticks_res=30, yticks_res=15, **kwargs)[source]¶
Bases:
EquatorialPlotAttributes Summary
The matplotlib axes object for the plot
The plotting canvas, if set upon initialization.
The collection of detector plot elements
The Earth plot element
The effective area plot element
The matplotlib figure object
The font size of the text labels.
The galactic plane plot element
(
PlotElementCollectionofSkyLineorSkyPolygon): The localization contour plot elementsThe localization gradient plot element
The Sun plot element
The color of the text labels
The plotting range of the x axis
The scale of the x axis, either 'linear' or 'log'.
The plotting range of the y axis.
The scale of the y axis, either 'linear' or 'log'.
Methods Summary
add_effective_area(hpx[, frame])Add a HealPixEffectiveArea object to plot the effective area.
add_frame(frame[, trigtime, detectors, ...])Add a SpacecraftFrame object to plot the location of the Earth, Sun, and detector pointings.
add_localization(hpx[, gradient, clevels, ...])Add a HealPixLocalization object to plot a localization and optionally plot the location of the Earth, Sun, and detector pointings.
plot_detector(det_coord, det[, radius])Plot a detector pointing.
plot_earth(geo_coord, radius, **kwargs)Plot the Earth.
Plot the Galactic plane.
plot_heatmap(heatmap, lon_array, lat_array, ...)Plot a heatmap on the sky.
plot_sun(time, **kwargs)Plot the sun.
Attributes Documentation
- ax¶
The matplotlib axes object for the plot
- Type:
(
matplotlib.axes)
- canvas¶
The plotting canvas, if set upon initialization.
- Type:
(Canvas Backend object)
- detectors¶
The collection of detector plot elements
- Type:
(
PlotElementCollectionofDetectorPointing)
- earth¶
The Earth plot element
- Type:
(
SkyCircle)
- effective_area¶
The effective area plot element
- Type:
(
SkyHeatmap)
- fig¶
The matplotlib figure object
- Type:
(
matplotlib.figure)
- fontsize¶
The font size of the text labels.
- Type:
(int)
- galactic_plane¶
The galactic plane plot element
- Type:
(
GalacticPlane)
- loc_contours¶
(
PlotElementCollectionofSkyLineorSkyPolygon): The localization contour plot elements
- loc_posterior¶
The localization gradient plot element
- Type:
(
SkyHeatmap)
- sun¶
The Sun plot element
- Type:
(
Sun)
- text_color¶
The color of the text labels
- Type:
(str)
- xlim¶
The plotting range of the x axis
- Type:
(float, float)
- xscale¶
The scale of the x axis, either ‘linear’ or ‘log’.
- Type:
(str)
- ylim¶
The plotting range of the y axis.
- Type:
(float, float)
- yscale¶
The scale of the y axis, either ‘linear’ or ‘log’.
- Type:
(str)
Methods Documentation
- add_effective_area(hpx, frame=None, **kwargs)¶
Add a HealPixEffectiveArea object to plot the effective area. Optionally add a SpacecraftFrame object to plot the location of the Earth, Sun, galactic plane, and detector pointings.
- Parameters:
hpx (
HealPixEffectiveArea) – The HEALPix objectframe (
gdt.core.coords.SpacecraftFrame, optional) – The spacecraft frame containing position and orientation informationdetectors ('all' or list) – A list of detectors or “all” to plot the pointings on the sky
earth (bool, optional) – If True, plot the Earth. Default is True.
sun (bool, optional) – If True, plot the Sun. Default is True.
galactic_plane (bool, optional) – If True, plot the Galactic plane. Default is True.
- add_frame(frame, trigtime=None, detectors='all', earth=True, sun=True, galactic_plane=True)¶
Add a SpacecraftFrame object to plot the location of the Earth, Sun, and detector pointings.
- Parameters:
frame (
gdt.core.coords.SpacecraftFrame) – The spacecraft frame containing position and orientation informationtrigtime (astropy.time.Time, optional) – The time of interest. This must be set if
framecontains more than one frame with a corresponding time. Ifframeis of size=1, then the corresponding time for that frame will be used.detectors (list or "all") – A list of detectors or “all” to plot the pointings on the sky.
earth (bool, optional) – If True, plot the Earth. Default is True.
sun (bool, optional) – If True, plot the Sun. Default is True.
galactic_plane (bool, optional) – If True, plot the Galactic plane. Default is True.
- add_localization(hpx, gradient=True, clevels=None, sun=True, earth=True, detectors='all', galactic_plane=True)¶
Add a HealPixLocalization object to plot a localization and optionally plot the location of the Earth, Sun, and detector pointings.
- Parameters:
hpx (
HealPixLocalization) – The HEALPix objectgradient (bool, optional) – If True, plots the posterior as a color gradient. If False, plot the posterior as color-filled confidence regions.
clevels (list of float, optional) – The confidence levels to plot contours. Default plots at the 1, 2, and 3 sigma level.
detectors ('all' or list) – A list of detectors or “all” to plot the pointings on the sky
earth (bool, optional) – If True, plot the Earth. Default is True.
sun (bool, optional) – If True, plot the Sun. Default is True.
galactic_plane (bool, optional) – If True, plot the Galactic plane. Default is True.
Note
Setting gradient=False when plotting an annulus may produce unexpected results at this time. It is suggested to use gradient=True for plotting annuli maps.
- plot_detector(det_coord, det, radius=10.0, **kwargs)¶
Plot a detector pointing.
- Parameters:
det_coord (astropy.coordinates.SkyCoord) – The detector coordinate
det (str) – The detector name
radius (float, optional) – The radius of pointing, in degrees. Default is 10.0
**kwargs – Options to pass to
SkyCircle
- plot_earth(geo_coord, radius, **kwargs)¶
Plot the Earth.
- Parameters:
geo_coord (astropy.coordinates.SkyCoord) – The coordinates of the geocenter.
radius (astropy.quantity.Quantity) – The angular radius of the Earth
**kwargs – Options to pass to
SkyCircle
- plot_galactic_plane()¶
Plot the Galactic plane.
- plot_heatmap(heatmap, lon_array, lat_array, **kwargs)[source]¶
- Plot a heatmap on the sky.
This is a workaround for the issue in the parent SkyPlot.plot_heatmap(), where the meshgrid results in a lon_array starting/ending with 0 degrees. This causes issues where the heatmap generated from a HEALPix location is populated at both RA=0/360 degrees, resulting in an unexpected output from the subsequent call to Matplotlib’s pcolormesh().
The old GBM Data Tools didn’t generate a meshgrid, and just passes the specified coordinate arrays unchanged.
TODO: confirm whether this is still required with latest gdt-core
- Parameters:
heatmap (np.array) – A 2D array of values
ra_array (np.array) – The array of longitudinal gridpoints
dec_array (np.array) – The array of latitudinal gridpoints
**kwargs – Options to pass to
SkyHeatmap
- plot_sun(time, **kwargs)¶
Plot the sun.
- Parameters:
time (astropy.time.Time) – The time at which to plot the sun
**kwargs – Options to pass to
Sun