1414import shutil
1515import tarfile
1616import zipfile
17- from urllib .parse import urlencode , quote_plus
1817from builtins import isinstance
1918from datetime import datetime
2019
2322from astropy .coordinates import SkyCoord
2423from astropy .table import vstack
2524from astropy .units import Quantity
26- from astroquery .exceptions import RemoteServiceError
2725from requests .exceptions import ConnectionError
28- from astroquery .utils import send_request
2926
30- from astroquery .query import BaseQuery
27+ from astroquery .exceptions import RemoteServiceError
3128from astroquery .ipac .ned import Ned
29+ from astroquery .query import BaseQuery
3230from astroquery .simbad import Simbad
3331from astroquery .utils import commons
3432from astroquery .utils .tap import TapPlus
3533from astroquery .vizier import Vizier
3634from . import conf
3735from .data_access import JwstDataHandler
3836
39-
4037__all__ = ['Jwst' , 'JwstClass' ]
4138
4239
4340class JwstClass (BaseQuery ):
4441
4542 """
4643 Proxy class to default TapPlus object (pointing to JWST Archive)
44+ THIS MODULE IS NOT OPERATIVE YET. METHODS WILL NOT WORK UNTIL eJWST ARCHIVE IS OFFICIALLY RELEASED
4745 """
4846
4947 JWST_DEFAULT_COLUMNS = ['observationid' , 'calibrationlevel' , 'public' ,
@@ -60,7 +58,7 @@ class JwstClass(BaseQuery):
6058 CAL_LEVELS = ['ALL' , 1 , 2 , 3 , - 1 ]
6159 REQUESTED_OBSERVATION_ID = "Missing required argument: 'observation_id'"
6260
63- def __init__ (self , tap_plus_handler = None , data_handler = None ):
61+ def __init__ (self , * , tap_plus_handler = None , data_handler = None ):
6462 if tap_plus_handler is None :
6563 self .__jwsttap = TapPlus (url = conf .JWST_TAP_SERVER ,
6664 data_context = 'data' )
@@ -70,9 +68,9 @@ def __init__(self, tap_plus_handler=None, data_handler=None):
7068 if data_handler is None :
7169 self .__jwstdata = JwstDataHandler (
7270 base_url = conf .JWST_DATA_SERVER )
73- # self.__jwstdata = self.__jwsttap;
7471 else :
7572 self .__jwstdata = data_handler
73+ print ("THIS MODULE IS NOT OPERATIVE YET. METHODS WILL NOT WORK UNTIL eJWST ARCHIVE IS OFFICIALLY RELEASED" )
7674
7775 def load_tables (self , * , only_names = False , include_shared_tables = False ,
7876 verbose = False ):
@@ -677,7 +675,7 @@ def set_token(self, token):
677675 token: str, mandatory
678676 MAST token to have access to propietary data
679677 """
680- subContext = "jwstToken"
678+ subContext = conf . JWST_TOKEN
681679 args = {"token" : token }
682680 connHandler = self .__jwsttap ._TapPlus__getconnhandler ()
683681 data = connHandler .url_encode (args )
@@ -689,6 +687,19 @@ def set_token(self, token):
689687 else :
690688 print ("MAST token has been set successfully" )
691689
690+ def get_status_messages (self ):
691+ """Retrieve the messages to inform users about
692+ the status of JWST TAP
693+ """
694+
695+ subContext = conf .JWST_MESSAGES
696+ connHandler = self .__jwsttap ._TapPlus__getconnhandler ()
697+ response = connHandler .execute_tapget (subContext , False )
698+ if response .status == 200 :
699+ for line in response :
700+ string_message = line .decode ("utf-8" )
701+ print (string_message [string_message .index ('=' )+ 1 :])
702+
692703 def get_product_list (self , * , observation_id = None ,
693704 cal_level = "ALL" ,
694705 product_type = None ):
0 commit comments