edges.sim.simulate¶
Simulation functions for ideal sky observations.
- edges.sim.simulate.simulate_spectra(beam: Beam, sky_model: SkyModel, ground_loss: ndarray | None = None, f_low: float | None = 0, f_high: float | None = inf, normalize_beam: bool = True, index_model: IndexModel = ConstantIndex(index=2.5), lsts: ndarray = None, beam_smoothing: bool = True, smoothing_model: Model = Polynomial(parameters=None, n_terms=12, _transform=IdentityTransform(), xtransform=IdentityTransform(), basis_scaler=None, data_transform=IdentityTransform(), offset=0.0, spacing=1.0), interp_kind: Literal['linear', 'nearest', 'slinear', 'cubic', 'quintic', 'pchip', 'spline', 'sphere-spline'] = 'sphere-spline', use_astropy_azel: bool = True) tuple[ndarray, ndarray, ndarray][source]¶
Simulate global spectra from sky and beam models.
- Parameters:
band – The band of the antenna (low, mid, high).
beam – A
Beamobject.ground_loss – An array of ground-loss values for the beam, shape (Nfreq,).
f_low – Minimum frequency to keep in the simulation (frequencies otherwise defined by the beam).
f_high – Maximum frequency to keep in the simulation (frequencies otherwise defined by the beam).
normalize_beam – Whether to normalize the beam to be maximum unity.
sky_model – A sky model to use.
index_model – An
IndexModelto use to generate different frequencies of the sky model.lsts – The LSTs at which to simulate
- Returns:
antenna_temperature_above_horizon – The antenna temperature for pixels above the horizon, shape (Nlst, Nfreq)
freq – The frequencies at which the simulation is defined.
lst – The LSTs at which the sim is defined.
- edges.sim.simulate.sky_convolution_generator(lsts: ~numpy.ndarray, beam: ~edges.sim.beams.Beam, sky_model: ~edges.sim.sky_models.SkyModel, index_model: ~edges.sim.sky_models.IndexModel, normalize_beam: bool, beam_smoothing: bool, smoothing_model: ~edges.modeling.core.Model, ground_loss: ~numpy.ndarray | None = None, location: ~astropy.coordinates.earth.EarthLocation = <EarthLocation (-2553239.64058645, 5097473.27470581, -2850021.53546025) m>, ref_time: ~astropy.time.core.Time = <Time object: scale='utc' format='isot' value=2014-01-01T09:39:42.000>, interp_kind: ~typing.Literal['linear', 'nearest', 'slinear', 'cubic', 'quintic', 'pchip', 'spline', 'sphere-spline'] = 'sphere-spline', lst_progress: bool = True, freq_progress: bool = True, ref_freq_idx: int = 0, use_astropy_azel: bool = True)[source]¶
Iterate through given LSTs and generate a beam*sky product at each freq and LST.
This is a generator, so it will yield a single item at a time (to save on memory).
- Parameters:
lsts – The LSTs at which to evaluate the convolution.
ground_loss – An array of ground-loss values for the beam, shape (Nfreq,).
beam – The beam to convolve.
sky_model – The sky model to convolve
index_model – The spectral index model of the sky model.
normalize_beam – Whether to ensure the beam is properly normalised.
beam_interpolation – Whether to smooth over freq axis
interp_kind – The kind of interpolation to use for the beam. “spline” uses
scipy.interpolate.RectBivariateSplineand “sphere-spline” usesscipy.interpolate.RectSphereBivariateSpline. All other options usescipy.interpolate.RegularGridInterpolator. with the given kind asmethod.use_astropy_azel – Whether to use the astropy coordinate system for azimuth and elevation. If False, compute the az/el using Alan’s method.
- Yields:
i – The LST enumerator
j – The frequency enumerator
mean_conv_temp – The mean temperature after multiplying by the beam (above the horizon)
conv_temp – An array containing the temperature after multiuplying by the beam in each pixel above the horizon.
sky – An array containing the sky temperature in pixel above the horizon.
beam – An array containing the interpolatedbeam in pixels above the horizon
time – The local time at each LST.
n_pixels – The total number of pixels that are not masked.
Examples
Use this function as follows:
>>> for i, j, mean_t, conv_t, sky, bm, time, npix in sky_convolution_generator(): >>> print(conv_t)