Utility functions and input folder

read_instrument_model[source]

read_instrument_model(filename='instrument_model/cmbs4_instrument_model.tbl')

Read the CMB-S4 instrument model

Includes all instrument parameters with units except bandpasses

Paramters
---------
filename : str path
    path to instrument model in ASCII IPAC format
Returns
-------
s4 : QTable
    astropy table with units, 1 row per channel

get_telescope[source]

get_telescope(channel)

Identify if a channel is in SAT or LAT

Parameters
----------
channel : str
    channel tag, e.g. MFH1

Returns
-------
telescope : str
    'SAT' or 'LAT'

get_observing_efficiency[source]

get_observing_efficiency(observing_efficiency_config, site, telescope, channel)

Extract the observing frequency for a specific channel from
the configuration dictionary

Parameters
----------
observing_efficiency_config : dict
    the order of keys should be site, telescope, channel
    e.g. {"Pole":{"LAT":{"HFL1":0.1}}, "default":0.2}
site : str
    site, Pole or Chile
telescope : str
    LAT or SAT
channel: str
    e.g. HFL1

Returns
-------
observing_efficiency : float
    observing efficiency in decimal form, for example .2 for 20%
observing_efficiency_config =  {"Pole":{"LAT":{"HFL1":0.1}}, "default":0.2}
assert get_observing_efficiency(observing_efficiency_config, "Pole", "LAT", "HFL1") == .1
assert get_observing_efficiency(observing_efficiency_config, "Pole", "LAT", "MFL1") == .2
assert get_observing_efficiency(observing_efficiency_config, "Chile", "LAT", "MFL2") == .2
observing_efficiency_config_telescope_default =  {"Pole":{"LAT":{"HFL2":0.1, "default":.15}}, "default":0.2}

assert get_observing_efficiency(observing_efficiency_config_telescope_default, "Pole", "LAT", "HFL2") == .1
assert get_observing_efficiency(observing_efficiency_config_telescope_default, "Pole", "LAT", "MFL1") == .15
observing_efficiency_config_site_default =  {"Pole":{"default":.19, "LAT":{"HFL2":0.1, "default":.15}}, "default":0.2}

assert get_observing_efficiency(observing_efficiency_config_site_default, "Pole", "LAT", "HFL2") == .1
assert get_observing_efficiency(observing_efficiency_config_site_default, "Pole", "LAT", "MFL1") == .15
assert get_observing_efficiency(observing_efficiency_config_site_default, "Pole", "SAT", "LFS1") == .19