Esempio n. 1
0
def test_pathloss_source_type(rtdata):
    """Test PathLossStep forcing source type"""
    with dm.open(rtdata.get_data('nirspec/ifu/nrs1_flat_field.fits')) as data:
        pls = PathLossStep()
        pls.source_type = 'extended'
        pls.run(data)

    assert np.allclose(pls.correction_pars.data,
                       pls.correction_pars.pathloss_uniform,
                       equal_nan=True)
Esempio n. 2
0
def test_pathloss_source_type(rtdata):
    """Test PathLossStep forcing source type"""
    with dm.open(rtdata.get_data('nirspec/fs/nrs1_flat_field.fits')) as data:
        pls = PathLossStep()
        pls.source_type = 'extended'
        pls.run(data)

    bad_slits = []
    for idx, slit in enumerate(pls.correction_pars.slits):
        if slit:
            if not np.allclose(slit.data, slit.pathloss_uniform, equal_nan=True):
                bad_slits.append(idx)
    assert not bad_slits, f'Force to uniform failed for slits {bad_slits}'
Esempio n. 3
0
def test_pathloss_source_type(jail, rtdata_module):
    """Test PathLossStep forcing source type"""
    rtdata = rtdata_module
    data = dm.open(rtdata.get_data('nirspec/mos/usf_wavecorr.fits'))

    pls = PathLossStep()
    pls.source_type = 'extended'
    pls.run(data)

    bad_slits = []
    for idx, slit in enumerate(pls.correction_pars.slits):
        if slit:
            if not np.allclose(
                    slit.data, slit.pathloss_uniform, equal_nan=True):
                bad_slits.append(idx)
    assert not bad_slits, f'Force to uniform failed for slits {bad_slits}'