nenupy.io.xst.TV_Image

class nenupy.io.xst.TV_Image(tv_image, analog_pointing, fov_radius)[source]

Bases: object

Class to store and display NenuFAR TV image.

__init__(tv_image, analog_pointing, fov_radius)[source]

Produce an instance of TV_Image.

Parameters:
  • tv_image (HpxSky) – The celestial image in HEALPix format, such as returned by make_image() for instance

  • analog_pointing (SkyCoord) – Celestial coordinates of the mean Mini-Array pointing in effect during the data acquisition, only serves as image display center

  • fov_radius (Quantity) – Radius of the image field of view

Example

>>> from nenupy.io.xst import XST, TV_Image
>>> from nenupy.astro import radec_to_altaz
>>> from astropy.coordinates import SkyCoord
>>> import astropy.units as u

>>> xst = XST(".../nenupy/tests/test_data/XST.fits")
>>> i_data = xst.get_stokes(stokes="I")
>>> tau_a = SkyCoord.from_name("Tau A")
>>> im = i_data.make_image(
        resolution=1*u.deg,
        fov_radius=10*u.deg,
        phase_center=tau_a,
        stokes="I"
    )
>>> pointing = radec_to_altaz(tau_a, xst.time[0])
>>> tv_im = TV_Image(im, pointing, 10*u.deg)

Methods

__init__(tv_image, analog_pointing, fov_radius)

Produce an instance of TV_Image.

from_fits(file_name)

Read the content of a FITS file and return an instance of TV_Image.

save_fits(file_name[, partial])

Store the NenuFAR-TV image in a FITS file.

save_png([figname, beam_contours, show_sources])

Plot the NenuFAR-TV image.

Attributes

analog_pointing

Analog pointing representing the image center in Alt-Az frame.

property analog_pointing

Analog pointing representing the image center in Alt-Az frame.

Returns:

The celestial coordinates in Alt-Az frame

Return type:

SkyCoord

Raises:

ValueError – Raised if the celestial coordinates frame is different from AltAz.

classmethod from_fits(file_name)[source]

Read the content of a FITS file and return an instance of TV_Image.

Parameters:

file_name (str) – FITS file path storing the NenuFAR-TV image (such as produced by save_fits())

Returns:

NenuFAR-TV image loaded

Return type:

TV_Image

Example

>>> from nenupy.io.xst import TV_Image

>>> tv_im = TV_Image.from_fits(".../my_nenufar_tv_image.fits")
save_fits(file_name, partial=True)[source]

Store the NenuFAR-TV image in a FITS file. The HEALPix FITS file is written using write_map().

Parameters:
  • file_name (str) – Name of the FITS file to be written

  • partial (bool, optional) – If True, the HEALPix map is only written where the sky isn’t masked to save space (argument directly passed to write_map()), by default True

Example

>>> from nenupy.io.xst import XST, TV_Image
>>> from astropy.coordinates import SkyCoord
>>> import astropy.units as u
>>> from nenupy.astro import radec_to_altaz

>>> xst = XST(".../nenupy/tests/test_data/XST.fits")
>>> i_data = xst.get_stokes(stokes="I")
>>> tau_a = SkyCoord.from_name("Tau A")
>>> im = i_data.make_image(
        resolution=1*u.deg,
        fov_radius=10*u.deg,
        phase_center=tau_a,
        stokes="I"
    )
>>> pointing = radec_to_altaz(tau_a, xst.time[0])
>>> tv_im = TV_Image(im, pointing, 10*u.deg)
>>> tv_im.save_fits(".../nenufar-tv.fits")
save_png(figname='', beam_contours=True, show_sources=True, **kwargs)[source]

Plot the NenuFAR-TV image. Most of the arguments are passed to plot().

Parameters:
  • figname (str, optional) – If a name is provided, the figure will be saved, by default “”

  • beam_contours (bool, optional) – Display the simulated analog beam contours, by default True

  • show_sources (bool, optional) – Show the positions of (bright) radio sources listed in nenufar_tv_sources.json, by default True

Example

>>> from nenupy.io.xst import XST, TV_Image
>>> from astropy.coordinates import SkyCoord
>>> import astropy.units as u
>>> from nenupy.astro import radec_to_altaz

>>> xst = XST(".../nenupy/tests/test_data/XST.fits")
>>> i_data = xst.get_stokes(stokes="I")
>>> tau_a = SkyCoord.from_name("Tau A")
>>> im = i_data.make_image(
        resolution=1*u.deg,
        fov_radius=10*u.deg,
        phase_center=tau_a,
        stokes="I"
    )
>>> pointing = radec_to_altaz(tau_a, xst.time[0])
>>> tv_im = TV_Image(im, pointing, 10*u.deg)
>>> tv_im.save_png()
../_images/tv_image.png