Esempio n. 1
0
def f_references(readout_mode, exposure_type, seed=-1):
    '''
        Basic function to generate the necessary reference files which
        include the noise model
        
        Note: uses namedtuple package
        
        :param readout_mode:
        :param exposure_type:
        :param seed:
        :return:
        '''
    #
    if readout_mode == 'traditional': readout_mode = 'TRAD'

    dark = fpa106_toolbox.f_generate_dark(uniform=False, seed=seed)
    gain = fpa106_toolbox.f_generate_gain(exposure_type.upper())
    ctm = fpa106_toolbox.f_generate_ctm()
    readout = fpa106_toolbox.f_generate_readout_noise(readout_mode)
    noise_model = fpa106_toolbox.f_generate_noise_model(readout_mode)
    references = namedtuple("references",
                            ['dark', 'gain', 'ctm', 'readout', 'noise_model'])

    return references(dark, gain, ctm, readout, noise_model)
Esempio n. 2
0
configfpa = c_configurationfpa.ConfigurationFPA()
configfpa.m_set_mode('IRS2', 'full-frame')
configfpa.m_set_array_parameters()
configfpa.m_set_header('none', 'none', 'none')

multiaccum = c_multiaccum.Multiaccum()
multiaccum.m_set_configuration(configfpa)
multiaccum.m_set_header('none', 'none', 'none')
multiaccum.m_set(nint, ng, nf)
multiaccum.m_info()

# =======================================================================
# Generating the instances of the reference files (nrspydet.references)
# =======================================================================
print("# Generating the instances of the reference files (gain & IPC).")
gain = fpa106_toolbox.f_generate_gain('FULL-FRAME')
ctm = fpa106_toolbox.f_generate_ctm()

print("# Generating the count-rate maps.")
# Looping over dither pointings (all unity-maps)
count = 0
for i in range(len(mos_erm)):
    t_map = mos_erm[i]
    print('# Processing ' + t_map)
    t_erm = c_electronratemap.ElectronRateMap()
    t_erm.m_read_from_fits(os.path.join(input_path, t_map))

    s_erm = c_electronratemap.ElectronRateMap()
    s_erm.m_read_from_fits(os.path.join(input_path, fxs_erm[i]))

    # Adding slit and mos flats together