Model¶
-
class
pysm3.
Model
(nside, map_dist=None)[source] [edit on github]¶ Bases:
object
This is the template object for PySM objects.
If a MPI communicator is passed as input and
pixel_indices
is None, the class automatically distributes the maps across processes. You can implement your own pixel distribution passing both a MPI communicator andpixel_indices
, however that won’t support smoothing withlibsharp
. Iflibsharp
is available, the rings are distributed as expected bylibsharp
to perform distributed spherical harmonics transforms, seepysm.mpi.distribute_rings_libsharp()
, thelibsharp
grid object is saved inself.libsharp_grid
. If libsharp is not available, pixels are distributed uniformly across processes, seepysm.mpi.distribute_pixels_uniformly()
- Parameters
- mpi_comm: object
MPI communicator object (optional, default=None).
- nside: int
Resolution parameter at which this model is to be calculated.
- smoothing_lmaxint
\(\ell_{max}\) for the smoothing step, by default \(2*N_{side}\)
Methods Summary
get_emission
(self, freqs[, weights])This function evaluates the component model at a either a single frequency, an array of frequencies, or over a bandpass.
read_map
(self, path[, unit, field, nside])Wrapper of the PySM read_map function that automatically uses nside, pixel_indices and mpi_comm defined in this Model by default.
read_txt
(self, path, **kwargs)Methods Documentation
-
get_emission
(self, freqs: Unit(‘GHz’), weights=None)[source] [edit on github]¶ This function evaluates the component model at a either a single frequency, an array of frequencies, or over a bandpass.
- Parameters
- freqs: scalar or array astropy.units.Quantity
Frequency at which the model should be evaluated, in a frequency which can be converted to GHz using astropy.units. If an array of frequencies is provided, integrate using trapz with a equal weighting, i.e. simulate a top-hat bandpass.
- weights: np.array, optional
Array of weights describing the frequency response of the instrument, i.e. the bandpass. Weights are normalized and applied in Jy/sr.
- Returns
- outputastropy.units.Quantity
Simulated map at the given frequency or integrated over the given bandpass. The shape of the output is (3,npix) for polarized components, (1,npix) for temperature-only components. Output is in
uK_RJ
.
-
read_map
(self, path, unit=None, field=0, nside=None)[source] [edit on github]¶ Wrapper of the PySM read_map function that automatically uses nside, pixel_indices and mpi_comm defined in this Model by default. If the
nside
keyword is set, this will override theModel
value when reading the map. This can be used to read in data products that must be processed at a specific nside.
-
read_txt
(self, path, **kwargs)[source] [edit on github]¶