nenupy.astro.sky


Sky

class nenupy.astro.sky.HpxSky(resolution=<Quantity 1. deg>, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.519747>, frequency=<Quantity 50. MHz>, polarization=array([0]), value=0.0, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]

Bases: Sky

classmethod shaped_like(other)[source]
class nenupy.astro.sky.HpxSkySlice(coordinates, frequency, time, polarization, value, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]

Bases: SkySliceBase

class nenupy.astro.sky.Sky(coordinates, time=<Time object: scale='utc' format='datetime' value=2024-05-03 08:29:42.519344>, frequency=<Quantity 50. MHz>, polarization=array([0]), value=0.0, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]

Bases: AstroObject

compute_lmn(phase_center, coordinate_mask=None)[source]

(l, m, n) image domain coordinates computed from HEALPix equatorial coordinates (in Right-Ascension \(\alpha\) and Declination \(\delta\), see coordinates) with respect to the phase_center (of equatorial coordinates \(\alpha_0\), \(\delta_0\)).

\[\begin{split}\cases{ l = \cos(\delta) \sin( \Delta \alpha)\\ m = \sin(\delta) \cos(\delta_0) - \cos(\delta) \sin(\delta_0) \cos(\Delta \alpha)\\ n = \sqrt{ 1 - l^2 - m^2 } }\end{split}\]

where \(\Delta \alpha = \alpha - \alpha_0\).

Parameters:
  • phase_center (SkyCoord) – Image phase center.

  • coordinate_mask (ndarray) – Mask applied to coordinates before computing (l,m,n) values.

Returns:

(l, m, n)

Return type:

tuple of 3 ndarray

property frequency
property polarization
property shape
property time
property value
property visible_mask
class nenupy.astro.sky.SkySlice(coordinates, frequency, time, polarization, value, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]

Bases: SkySliceBase

class nenupy.astro.sky.SkySliceBase(coordinates, frequency, time, polarization, value, observer=<EarthLocation (4323936.68522791, 165534.49991696, 4670345.36540385) m>)[source]

Bases: AstroObject

plot(**kwargs)[source]

Display the selected content of the value attribute belonging to a Sky instance as a celestial map in equatorial coordinates.

This method is available on a SkySlice instance, resulting from a selection upon a Sky instance (using the indexing operator).

Several parameters, listed below, can be tuned to adapt the plot to the user requirements:

Data display keywords

Parameters:
  • center (SkyCoord) – Coordinates of the celestial map to be displayed at the center of the image. Default is (RA=0deg, Dec=0deg).

  • radius (Quantity) – Angular radius from the center of the image above which the plot should be cropped. Default is None (i.e., full sky image).

  • resolution (Quantity) – Set the pixel resolution. The upper threshold is 0.775 deg, any value above that does not affect the figure appearence. Default is astropy.units.Quantity(1, unit="deg").

  • only_visible (bool) – If set to True only the sky above the horizon is displayed. Setting this parameter to False does not really make sense for Sky instances representing antenna response for instance. Default is True.

  • decibel (bool) – If set to True, the data values are displayed at the decibel scale, i.e., \(10 \log( \rm{data} )\). Default is False.

  • interpolation (str) – Matplotlib imshow interpolation method. Default is 'quadric'.

Overplot keywords

Parameters:
  • scatter (tuple) – Add a scatter plot (as defined in matplotlib.pyplot.scatter). Expected syntax is (<SkyCoord>, <marker_size>, <color>). Default is None (i.e., no scatter overplot).

  • text (tuple) – Add a text overlay (as defined in matplotlib.pyplot.text). Expected syntax is (<SkyCoord>, <[text]>, <color>). Default is None (i.e., no text overplot).

  • contour (tuple) – Add a contour plot (as defined in matplotlib.pyplot.contour). Expected syntax is (<numpy.ndarray>, <[levels]>, <colormap>). Default is None (i.e., no contour overplot).

Plotting layout keywords

Parameters:
  • altaz_overlay (bool) – If set to True, the horizontal coordinates grid is overplotted in addition to the equatorial one. Default is False.

  • cmap (str) – Color map applied while representing the data (see Matplotlib colormaps). Default is "YlGnBu_r".

  • show_colorbar (bool) – Show or not the color bar. Default is True.

  • colorbar_label (str) – Set the label of the color bar. Default is "".

  • figname (str) – Name of the file (absolute or relative path) to save the figure. If set to "return", the method returns the tuple (fig, ax) (as defined by matplotlib). Default is None (i.e., only show the figure).

  • figsize (tuple) – Set the figure size. Default is (15, 10).

  • ticks_color (str) – Set the color of the equatorial grid and the Right Ascension ticks. Default is "0.9" (grey).

  • title (str) – Set the figure title. Default is "<time>, <frequency>".

property visible_sky