Example #1
0
def test_poly():
    """
    Test that polygon regions can be added and written to .reg files
    """
    ra = [5., 5., 7., 7.]
    dec = [-2., -2.5, -2.5, -2.]
    region = Region(maxdepth=6)
    positions = list(zip(np.radians(ra), np.radians(dec)))
    region.add_poly(positions)
    region.write_reg('test.reg')
    if not (os.path.exists('test.reg')): raise AssertionError()
    os.remove('test.reg')
Example #2
0
def test_poly():
    """
    Test that polygon regions can be added and written to .reg files
    """
    ra = [5., 5., 7., 7.]
    dec = [-2., -2.5, -2.5, -2.]
    region = Region(maxdepth=6)
    positions = list(zip(np.radians(ra), np.radians(dec)))
    region.add_poly(positions)
    region.write_reg('test.reg')
    if not (os.path.exists('test.reg')): raise AssertionError()
    os.remove('test.reg')
Example #3
0
def test_reg():
    """
    Test that .reg files can be written without crashing
    (Not a test that the .reg files are valid)
    """
    ra = np.radians([285])
    dec = np.radians([-66])
    radius = np.radians([3])
    region = Region(maxdepth=5)
    region.add_circles(ra, dec, radius)
    region.write_reg('test.reg')
    if not (os.path.exists('test.reg')): raise AssertionError()
    os.remove('test.reg')
Example #4
0
def test_reg():
    """
    Test that .reg files can be written without crashing
    (Not a test that the .reg files are valid)
    """
    ra = np.radians([285])
    dec = np.radians([-66])
    radius = np.radians([3])
    region = Region(maxdepth=5)
    region.add_circles(ra, dec, radius)
    region.write_reg('test.reg')
    if not (os.path.exists('test.reg')): raise AssertionError()
    os.remove('test.reg')