def test_cone_search(self): esa_hubble = ESAHubble() c = coordinates.SkyCoord("00h42m44.51s +41d16m08.45s", frame='icrs') temp_file = self.temp_folder.name + "/cone_search_m31_5.vot" table = esa_hubble.cone_search(c, 7, temp_file, verbose=True) assert os.path.exists(temp_file) assert 'observation_id' in table.columns assert len(table) > 0 remove_last_job()
import unittest import os import pytest from astropy.tests.helper import remote_data from requests.models import Response from astroquery.esa.hubble import ESAHubble from astroquery.utils.testing_tools import MockResponse from astropy import coordinates from unittest.mock import MagicMock from astropy.table.table import Table import shutil import random from PIL import Image esa_hubble = ESAHubble() def data_path(filename): data_dir = os.path.join(os.path.dirname(__file__), 'data') return os.path.join(data_dir, filename) def create_temp_folder(): return tempfile.TemporaryDirectory() def remove_last_job(): jobs = esa_hubble._tap.list_async_jobs() if len(jobs) > 0: esa_hubble._tap.remove_jobs(jobs[-1].jobid)
def test_hap_composite_to_hap_simple(self): esa_hubble = ESAHubble() result = esa_hubble.get_member_observations('hst_15446_4v_acs_wfc_f606w_jdrz4v') assert result == ['hst_15446_4v_acs_wfc_f606w_jdrz4vkv', 'hst_15446_4v_acs_wfc_f606w_jdrz4vkw']
def test_hst_simple_to_hst_composite(self): esa_hubble = ESAHubble() result = esa_hubble.get_member_observations('jdrz0cjxq') assert result == ['jdrz0c010']
def test_hst_simple_to_hap_simple(self): esa_hubble = ESAHubble() result = esa_hubble.get_hap_hst_link('jec071i9q') assert result == ['hst_16316_71_acs_sbc_f150lp_jec071i9']
def test_hap_simple_to_hap_composite(self): esa_hubble = ESAHubble() result = esa_hubble.get_member_observations('hst_16316_71_acs_sbc_f150lp_jec071i9') assert result == ['hst_16316_71_acs_sbc_f150lp_jec071']