UVBeam Class

UVBeam is the main user class for beam models. It provides import and export functionality to supported file formats and can be interacted with directly.

class pyuvdata.UVBeam[source]

A class for defining a radio telescope antenna beam.

UVParameter objects

For full list see UVBeam Parameters (http://pyuvdata.readthedocs.io/en/latest/uvbeam_parameters.html). Some are always required, some are required for certain beam_types, antenna_types and pixel_coordinate_systems and others are always optional.

az_za_to_healpix(nside=None)[source]

Convert beam in az_za coordinates to healpix coordinates. The interpolation is done using scipy’s interpolate.RectBivariateSpline().

Parameters:
  • nside – The nside to use for the Healpix map. If not specified, use
  • nside that gives the closest resolution that is higher than the (the) –
  • resolution. (input) –
check(run_check_acceptability=True)[source]

Check that all required parameters are set reasonably.

Check that required parameters exist and have appropriate shapes. Optionally check if the values are acceptable.

Parameters:run_check_acceptability – Option to check if values in required parameters are acceptable. Default is True.
read_beamfits(filename, run_check=True, run_check_acceptability=True)[source]

Read in data from a beamfits file.

Parameters:
  • filename – The beamfits file or list of files to read from.
  • run_check – Option to check for the existence and proper shapes of required parameters after reading in the file. Default is True.
  • run_check_acceptability – Option to check acceptable range of the values of required parameters after reading in the file. Default is True.
read_cst_beam(filename, beam_type='power', feed_pol='x', rotate_pol=None, frequency=None, telescope_name=None, feed_name=None, feed_version=None, model_name=None, model_version=None, history='', run_check=True, run_check_acceptability=True)[source]

Read in data from a cst file.

Parameters:
  • filename – The cst file or list of files to read from. If a list is passed, the files are combined along the appropriate axes.
  • beam_type – what beam_type to read in (‘power’ or ‘efield’). Defaults to ‘power’.
  • feed_pol – the feed or polarization or list of feeds or polarizations the files correspond to. Defaults to ‘x’ (meaning x for efield or xx for power beams).
  • rotate_pol – If True, assume the structure in the simulation is symmetric under 90 degree rotations about the z-axis (so that the y polarization can be constructed by rotating the x polarization or vice versa). Default: True if feed_pol is a single value, False if it is a list.
  • frequency – the frequency or list of frequencies corresponding to the filename(s). This is assumed to be in the same order as the files, so if it’s used, make sure the files are an ordered datatype. If not passed, the code attempts to parse it from the filenames.
  • telescope_name – the name of the telescope corresponding to the filename(s).
  • feed_name – the name of the feed corresponding to the filename(s).
  • feed_version – the version of the feed corresponding to the filename(s).
  • model_name – the name of the model corresponding to the filename(s).
  • model_version – the version of the model corresponding to the filename(s).
  • history – A string detailing the history of the filename(s).
  • run_check – Option to check for the existence and proper shapes of required parameters after reading in the file. Default is True.
  • run_check_acceptability – Option to check acceptable range of the values of required parameters after reading in the file. Default is True.
select(axis1_inds=None, axis2_inds=None, pixels=None, frequencies=None, freq_chans=None, feeds=None, polarizations=None, run_check=True, run_check_acceptability=True, inplace=True)[source]

Select specific image axis indices or pixels (if healpix), frequencies and feeds or polarizations (if power) to keep in the object while discarding others.

The history attribute on the object will be updated to identify the operations performed.

Parameters:
  • axis1_inds – The indices along the first image axis to keep in the object. Cannot be set if pixel_coordinate_system is “healpix”.
  • axis2_inds – The indices along the second image axis to keep in the object. Cannot be set if pixel_coordinate_system is “healpix”.
  • pixels – The healpix pixels to keep in the object. Cannot be set if pixel_coordinate_system is not “healpix”.
  • frequencies – The frequencies to keep in the object.
  • freq_chans – The frequency channel numbers to keep in the object.
  • feeds – The feeds to keep in the object. Cannot be set if the beam_type is “power”.
  • polarizations – The polarizations to keep in the object. Cannot be set if the beam_type is “efield”.
  • run_check – Option to check for the existence and proper shapes of required parameters after downselecting data on this object. Default is True.
  • run_check_acceptability – Option to check acceptable range of the values of required parameters after downselecting data on this object. Default is True.
  • inplace – Option to perform the select directly on self (True, default) or return a new UVBeam object, which is a subselection of self (False)
set_cs_params()[source]

Set various forms and required parameters depending on pixel_coordinate_system.

set_efield()[source]

Set beam_type to ‘efield’ and adjust required parameters.

set_phased_array()[source]

Set antenna_type to ‘phased_array’ and adjust required parameters.

set_power()[source]

Set beam_type to ‘power’ and adjust required parameters.

set_simple()[source]

Set antenna_type to ‘simple’ and adjust required parameters.

write_beamfits(filename, run_check=True, run_check_acceptability=True, clobber=False)[source]

Write the data to a beamfits file.

Parameters:
  • filename – The beamfits file to write to.
  • run_check – Option to check for the existence and proper shapes of required parameters before writing the file. Default is True.
  • run_check_acceptability – Option to check acceptable range of the values of required parameters before writing the file. Default is True.
  • clobber – Option to overwrite the filename if the file already exists. Default is False.