Пример #1
0
def test_deimos_mask_coordinates():
    f = os.path.join(os.environ['PYPEIT_DEV'], 'RAW_DATA', 'keck_deimos', '830G_M_8500',
                     'DE.20100913.22358.fits.gz')
    spec = KeckDEIMOSSpectrograph()
    spec.get_grating(f)
    spec.get_amapbmap(f)
    spec.get_slitmask(f)
    assert numpy.isclose(spec.grating.central_wave, 8500.0078125), 'Incorrect grating setup'
    # Get the chip and pixel coordinates (1-indexed!) at the central
    # wavelength
    ximg, yimg, ccd, xpix, ypix = spec.mask_to_pixel_coordinates(x=spec.slitmask.center[:, 0],
                                                                 y=spec.slitmask.center[:, 1],
                                                                 wave=spec.grating.central_wave)
    assert ccd[0] == 6, 'Incorrect chip selected'
    assert numpy.isclose(xpix[0], 604.5558558898638), 'Incorrect x coordinate'
    assert numpy.isclose(ypix[0], 362.1307486284081), 'Incorrect y coordinate'
Пример #2
0
def test_deimosslitmask():
    f = os.path.join(os.environ['PYPEIT_DEV'], 'RAW_DATA', 'keck_deimos', '830G_M_8500',
                     'DE.20100913.22358.fits.gz')
    spec = KeckDEIMOSSpectrograph()
    spec.get_slitmask(f)
    assert spec.slitmask.nslits == 106, 'Incorrect number of slits read!'