# Licensed under a 3-clause BSD style license - see LICENSE.rst


import warnings
import re
import time
from math import cos, radians
import requests
from bs4 import BeautifulSoup
from io import BytesIO, StringIO

import astropy.units as u
import astropy.coordinates as coord
import astropy.io.votable as votable

from ..query import QueryWithLogin
from ..exceptions import InvalidQueryError, TimeoutError, NoResultsWarning
from ..utils import commons
from ..exceptions import TableParseError

__all__ = ['BaseWFAUClass', 'clean_catalog']


class BaseWFAUClass(QueryWithLogin):

    """
    The BaseWFAUQuery class.  This is intended to be inherited by other classes
    that implement specific interfaces to Wide-Field Astronomy Unit
    (http://www.roe.ac.uk/ifa/wfau/) archives
    """
    BASE_URL = ""
    LOGIN_URL = BASE_URL + "DBLogin"
    IMAGE_URL = BASE_URL + "GetImage"
    ARCHIVE_URL = BASE_URL + "ImageList"
    REGION_URL = BASE_URL + "WSASQL"
    CROSSID_URL = BASE_URL + "CrossID"
    TIMEOUT = ""

    def __init__(self, username=None, password=None, community=None,
                 database='', programme_id='all'):
        """
        The BaseWFAUClass __init__ is meant to be overwritten