Esempio n. 1
0
def test_header_cal_type_flat(mock_instrument_info, mock_namer):
    mock_namer.return_value = lambda *x: 'foo.fits'

    mock_instrument_info.return_value = None, None, None
    fake_context = FakeContext()
    fake_context.db_address = ''

    maker = FlatMaker(fake_context)
    master_flat = maker.do_stage([FakeFlatImage() for x in range(6)])[0]

    header = master_flat.header
    assert header['OBSTYPE'].upper() == 'SKYFLAT'
Esempio n. 2
0
def test_bias_level_is_average_of_inputs(mock_instrument_info):
    nimages = 20
    bias_levels = np.arange(nimages, dtype=float)

    images = [FakeBiasImage(bias_level=i) for i in bias_levels]

    mock_instrument_info.return_value = None, None, None
    fake_context = FakeContext()
    fake_context.db_address = ''

    maker = BiasMaker(fake_context)
    master_bias = maker.do_stage(images)[0]

    header = master_bias.header

    assert header['BIASLVL'] == np.mean(bias_levels)
Esempio n. 3
0
def test_bias_level_is_average_of_inputs(mock_instrument_info, mock_namer):
    mock_namer.return_value = lambda *x: 'foo.fits'
    nimages = 20
    bias_levels = np.arange(nimages, dtype=float)

    images = [FakeBiasImage(bias_level=i) for i in bias_levels]

    mock_instrument_info.return_value = None, None, None
    fake_context = FakeContext()
    fake_context.db_address = ''

    maker = BiasMaker(fake_context)
    master_bias = maker.do_stage(images)[0]

    header = master_bias.header

    assert header['BIASLVL'] == np.mean(bias_levels)