MapSim

class mapsims.MapSim(channels, nside=None, modeling_nside=None, lmax_over_nside=None, car=False, healpix=True, car_resolution=None, num=0, nsplits=1, unit='uK_CMB', output_folder='output', tag='sky', output_filename_template='mapsims_{tag}_{telescope}_{band}_nside{nside}_{split}_of_{nsplits}_{pixelization}.fits', pysm_components_string=None, output_reference_frame=None, pysm_custom_components=None, other_components=None, instrument_parameters=None)[source] [edit on github]

Bases: object

Run map based simulations

MapSim executes PySM for each of the input channels with a sky defined by default PySM components in pysm_components_string and custom components in pysm_custom_components and rotates in Alm space to the reference frame output_reference_frame. Then for each of the channels specified, smoothes the map with the channel beam and finally adds the map generated by other_components, for example noise maps, and writes the outputs to disk.

Parameters:
channelsstr

If “all”, all channels are included. Otherwise a list of channel tags: LT1_UHF1 and LT0_UHF1 = “LT1_UHF1,LT0_UHF1” Otherwise, provide a string with: * a key, e.g. tube or telescope * : * comma separated list of desider values e.g. all SAT channels = “telescope:SA” LT1 and LT2 tubes = “tube:LT1,LT2”

modeling_nsideint

Run PySM at higher Nside to increase the accuracy of the results, it is recommended to set modeling Nside twice of nside If None, modeling is done using nside

nsideint

output HEALPix Nside, if None, automatically pick the default resolution of the first channel, see https://github.com/simonsobs/mapsims/tree/master/mapsims/data/so_default_resolution.csv

lmax_over_nsidefloat

used to compute Ell_max used in the smoothing process

carbool

True for CAR output

healpixbool

True for HEALPix output

car_resolutionastropy.Quantity

CAR pixels resolution with angle unit

unitstr

Unit of output maps

output_folderstr

Relative or absolute path to output folder, string template with {nside} and {tag} fields

numint

Realization number, generally used as seed, default is 0, automatically padded to 4 digits

nsplitsint

Number of noise splits, see the documentation of SONoiseSimulator

tagstr

String to describe the current simulation, for example its content, which is used into string interpolation for output_folder and output_filename_template

output_filename_templatestr

String template with {telescope} {channel} {nside} {tag} fields

pysm_components_stringstr

Comma separated string of PySM components, i.e. “s1,d4,a2”

output_reference_framestr

The requested output reference frame G for Galactic, C for Equatorial or E for Ecliptic, set to None to apply no rotation

pysm_custom_componentsdict

Dictionary of other components executed through PySM

other_componentsdict

Dictionary of component name, component class pairs, the output of these are not rotated, they should already be in the same reference frame specified in output_reference_frame.

instrument_parametersascii file in IPAC table format path or str

A string specifies an instrument parameters file included in the package data/ folder A path or a string containing a path to an externally provided IPAC table file with the expected format. Instrument parameters in IPAC ascii format, one channel per row, with columns (with units):

tag, band, center_frequency, fwhm

It also assumes that in the same folder there are IPAC table files named bandpass_{tag}.tbl with columns:

bandpass_frequency, bandpass_weight

Methods Summary

execute([write_outputs])

Run map simulations

Methods Documentation

execute(write_outputs=False)[source] [edit on github]

Run map simulations

Execute simulations for all channels and write to disk the maps, and return their filenames (relative to output folder) unless write_outputs is False, then return them.