Exemplo n.º 1
0
def test_query_region_box_async(coordinates, patch_get):
    response = Irsa.query_region_async(
        coordinates, catalog='fp_psc', spatial='Box',
        width=2 * u.arcmin, get_query_payload=True)
    assert response['size'] == 120
    response = Irsa.query_region_async(
        coordinates, catalog='fp_psc', spatial='Box', width=2 * u.arcmin)
    assert response is not None
Exemplo n.º 2
0
def test_query_region_cone_async(coordinates, patch_get):
    response = Irsa.query_region_async(
        coordinates, catalog='fp_psc', spatial='Cone',
        radius=2 * u.arcmin, get_query_payload=True)
    assert response['radius'] == 2
    assert response['radunits'] == 'arcmin'
    response = Irsa.query_region_async(
        coordinates, catalog='fp_psc', spatial='Cone', radius=2 * u.arcmin)
    assert response is not None
Exemplo n.º 3
0
def test_query_region_async_polygon(polygon, patch_get):
    response = Irsa.query_region_async(
        "m31", catalog="fp_psc", spatial="Polygon",
        polygon=polygon, get_query_payload=True)

    for a, b in zip(re.split("[ ,]", response["polygon"]),
                    re.split("[ ,]", "10.1 +10.1,10.0 +10.1,10.0 +10.0")):
        for a1, b1 in zip(a.split(), b.split()):
            a1 = float(a1)
            b1 = float(b1)
            np.testing.assert_almost_equal(a1, b1)

    response = Irsa.query_region_async(
        "m31", catalog="fp_psc", spatial="Polygon", polygon=polygon)

    assert response is not None
Exemplo n.º 4
0
 def test_query_region_box_async(self):
     response = Irsa.query_region_async("00h42m44.330s +41d16m07.50s",
                                        catalog='fp_psc',
                                        spatial='Box',
                                        width=2 * u.arcmin,
                                        cache=False)
     assert response is not None
Exemplo n.º 5
0
 def test_query_region_cone_async(self):
     response = Irsa.query_region_async('m31',
                                        catalog='fp_psc',
                                        spatial='Cone',
                                        radius=2 * u.arcmin,
                                        cache=False)
     assert response is not None
Exemplo n.º 6
0
    def test_query_region_async_polygon(self):
        polygon = [
            SkyCoord(ra=10.1, dec=10.1, unit=(u.deg, u.deg)),
            SkyCoord(ra=10.0, dec=10.1, unit=(u.deg, u.deg)),
            SkyCoord(ra=10.0, dec=10.0, unit=(u.deg, u.deg))
        ]
        response = Irsa.query_region_async("m31",
                                           catalog="fp_psc",
                                           spatial="Polygon",
                                           polygon=polygon,
                                           cache=False)

        assert response is not None