edges.sim.beams

Beam models and chromaticity corrections.

class edges.sim.beams.Beam(*, beam: ndarray, frequency: Annotated[Quantity, PhysicalType('frequency')], elevation, azimuth, simulator=None, instrument=None, raw_file=None)[source]

A beam model object.

Variables:
  • beam (numpy.ndarray) – The beam model, as a function of frequency, elevation, and azimuth.

  • frequency (astropy.units.quantity.Quantity) – The frequencies at which the beam is defined.

  • elevation (numpy.ndarray) – The elevation angles at which the beam is defined.

  • azimuth (numpy.ndarray) – The azimuth angles at which the beam is defined.

  • simulator (str | None) – The simulator used to generate the beam.

  • instrument (str | None) – The instrument for which the beam is defined.

  • raw_file (str | None) – The path to the raw file from which the beam was read.

angular_interpolator(freq_indx: int, interp_kind: Literal['linear', 'nearest', 'slinear', 'quintic', 'pchip', 'spline', 'sphere-spline'] = 'linear') Callable[[ndarray, ndarray], ndarray][source]

Return a callable function that interpolates the beam.

The returned function has the signature interp(az, el), where az is azimuth in degrees, and el is elevation in degrees. They may be arrays, in which case they should be the same length.

at_freq(freq: Annotated[Quantity, PhysicalType('frequency')], model: Model = Polynomial(parameters=None, n_terms=13, _transform=ScaleTransform(scale=75.0), xtransform=ScaleTransform(scale=75.0), basis_scaler=None, data_transform=IdentityTransform(), offset=0.0, spacing=1.0), **fit_kwargs) Self[source]

Interpolate the beam to a new set of frequencies.

Parameters:
  • freq – Frequencies to interpolate to.

  • model – The model to use for interpolation.

  • fit_kwargs – Keyword arguments to pass to the model fit.

Returns:

beam – The Beam object at the new frequencies.

between_freqs(low: ~astropy.units.quantity.Annotated[~astropy.units.quantity.Quantity, PhysicalType('frequency')] = <Quantity 0. MHz>, high: ~astropy.units.quantity.Annotated[~astropy.units.quantity.Quantity, PhysicalType('frequency')] = <Quantity inf MHz>) Self[source]

Return a new Beam object restricted to a given frequency range.

compute_ground_loss()[source]

Compute the ground loss for the beam.

classmethod from_cst(file_name_prefix: str | Path, f_low: int = 40, f_high: int = 100, freq_p: int = 61, theta_p: float = 181, phi_p: float = 361, az_antenna_axis: float = 0) Self[source]

Read a CST beam file.

Parameters:
  • filename – The path to the file.

  • az_antenna_axis – The azimuth of the primary antenna axis, in degrees.

  • f_low, f_high – lower and higher frequency bounds

  • freq_p – Number of frequency points in the simulation file.

  • theta_p – Number of zenith angle points in the simulation file.

  • phi_p – Number of azimuth points in the simulation file.

Returns:

beam – The beam object.

classmethod from_feko(path: str | Path, az_antenna_axis: float = 0) Self[source]

Read a FEKO beam file.

Parameters:
  • filename – The path to the file.

  • az_antenna_axis – The azimuth of the primary antenna axis, in degrees.

classmethod from_feko_raw(file_name_prefix: str | Path, ext: str = 'txt', f_low: int = 40, f_high: int = 100, freq_p: int = 61, theta_p: float = 181, phi_p: float = 361, az_antenna_axis: float = 0) Self[source]

Read a FEKO beam file.

Parameters:
  • filename – The path to the file.

  • az_antenna_axis – The azimuth of the primary antenna axis, in degrees.

  • f_low, f_high – lower and higher frequency bounds

  • freq_p – Number of frequency points in the simulation file.

  • theta_p – Number of zenith angle points in the simulation file.

  • phi_p – Number of azimuth points in the simulation file.

Returns:

beam – The beam object.

classmethod from_file(band: str | None, simulator: str = 'feko', beam_file: str | Path = ':', configuration: str = 'default', rotation_from_north: float = 90) Self[source]

Read a beam from file.

classmethod from_hfss(path: str | Path, frequency: Annotated[Quantity, PhysicalType('frequency')], linear: bool = True, theta_min: float = 0, theta_max: float = 180, theta_resolution: float = 1, phi_min: float = 0, phi_max: float = 359, phi_resolution: float = 1) Self[source]

Create a Beam object from a HFSS file.

Parameters:
  • path – Path to the file. Use resolve_file() to get the absolute path from a a relative path (starting with ‘:’).

  • linear – Whether the beam values are in linear units (or decibels)

  • theta_min, theta_max – Min/Max of the zenith angle (degrees)

  • theta_resolution – Resolution of the zenith angle.

  • phi_min, phi_max – Min/Max of the azimuth angles (degrees)

  • phi_resolution – The resolution of the azimuth angle.

Returns:

beam – The beam object.

classmethod from_wipld(path: str | Path, az_antenna_axis: float = 0) Self[source]

Read a WIPL-D beam.

Parameters:
  • path – The path to the file.

  • az_antenna_axis – The azimuth of the primary antenna axis, in degrees.

classmethod get_beam_path(band: str, kind: str | None = None) Path[source]

Get a standard path to a beam file.

get_beam_solid_angle() float[source]

Calculate the integrated beam solid angle.

classmethod resolve_file(path: str | Path, band: str | None = None, configuration: str = 'default', simulator: str = 'feko') Path[source]

Resolve a file path to a standard location.

select_freqs(indx: Sequence[int]) Self[source]

Select a subset of frequencies.

Parameters:

indx – The indices of the frequencies to select.

static shift_beam_maps(az_antenna_axis: float, beam_maps: ndarray) ndarray[source]

Rotate beam maps around an axis.

Parameters:
  • az_antenna_axis – The aximuth angle of the antenna axis.

  • beam_maps – Beam maps as a function of frequency, za and az.

Returns:

beam maps – Array of the same shape as the input, but rotated.

smoothed(model: Model = Polynomial(parameters=None, n_terms=12, _transform=IdentityTransform(), xtransform=IdentityTransform(), basis_scaler=None, data_transform=IdentityTransform(), offset=0.0, spacing=1.0), **fit_kwargs) Self[source]

Return a new beam, smoothed over the frequency axis, but without decimation.

Parameters:
  • model – The model to use for smoothing.

  • fit_kwargs – Keyword arguments to pass to the model fit.

Returns:

beam – The Beam object smoothed over its same frequencies.

classmethod uniform(delta_f=2, f_low=40, f_high=200, delta_az=1, delta_el=1)[source]

Create an ideal beam that is completely unity.