25
25
26
26
from astropy .utils import deprecated
27
27
from astropy .utils .console import ProgressBarOrSpinner
28
- from astropy .utils .exceptions import AstropyDeprecationWarning
29
28
30
29
from six .moves .urllib .parse import quote as urlencode
31
30
@@ -151,28 +150,6 @@ def _parse_caom_criteria(self, **criteria):
151
150
objectname = criteria .pop ('objectname' , None )
152
151
radius = criteria .pop ('radius' , 0.2 * u .deg )
153
152
154
- # Dealing with observation type (science vs calibration)
155
- if ('obstype' in criteria ) and ('intentType' in criteria ):
156
- warn_string = ("Cannot specify both obstype and intentType, "
157
- "obstype is the deprecated version of intentType and will be ignored." )
158
- warnings .warn (warn_string , InputWarning )
159
- criteria .pop ('obstype' , None )
160
-
161
- # Temporarily issuing warning about change in behavior
162
- # continuing old behavior
163
- # grabbing the observation type (science vs calibration)
164
- obstype = criteria .pop ('obstype' , None )
165
- if obstype :
166
- warn_string = ("Criteria obstype argument disappeared in May 2019. "
167
- "Criteria 'obstype' is now 'intentType', options are 'science' or 'calibration', "
168
- "if intentType is not supplied all observations (science and calibration) are returned." )
169
- warnings .warn (warn_string , AstropyDeprecationWarning )
170
-
171
- if obstype == "science" :
172
- criteria ["intentType" ] = "science"
173
- elif obstype == "cal" :
174
- criteria ["intentType" ] = "calibration"
175
-
176
153
# Build the mashup filter object and store it in the correct service_name entry
177
154
if coordinates or objectname :
178
155
mashup_filters = self ._portal_api_connection .build_filter_set ("Mast.Caom.Cone" ,
@@ -452,11 +429,11 @@ def get_product_list_async(self, observations):
452
429
"""
453
430
454
431
# getting the obsid list
455
- if type (observations ) == Row :
432
+ if isinstance (observations , Row ) :
456
433
observations = observations ["obsid" ]
457
434
if np .isscalar (observations ):
458
435
observations = [observations ]
459
- if type (observations ) == Table :
436
+ if isinstance (observations , Table ) :
460
437
observations = observations ['obsid' ]
461
438
462
439
service = 'Mast.Caom.Products'
@@ -496,7 +473,7 @@ def filter_products(self, products, mrp_only=False, extension=None, **filters):
496
473
filter_mask &= (products ['productGroupDescription' ] == "Minimum Recommended Products" )
497
474
498
475
if extension :
499
- if type (extension ) == str :
476
+ if isinstance (extension , str ) :
500
477
extension = [extension ]
501
478
502
479
mask = np .full (len (products ), False , dtype = bool )
@@ -508,7 +485,7 @@ def filter_products(self, products, mrp_only=False, extension=None, **filters):
508
485
# Applying the rest of the filters
509
486
for colname , vals in filters .items ():
510
487
511
- if type (vals ) == str :
488
+ if isinstance (vals , str ) :
512
489
vals = [vals ]
513
490
514
491
mask = np .full (len (products ), False , dtype = bool )
@@ -711,14 +688,14 @@ def download_products(self, products, download_dir=None,
711
688
The manifest of files downloaded, or status of files on disk if curl option chosen.
712
689
"""
713
690
# If the products list is a row we need to cast it as a table
714
- if type (products ) == Row :
691
+ if isinstance (products , Row ) :
715
692
products = Table (products , masked = True )
716
693
717
694
# If the products list is not already a table of products we need to
718
695
# get the products and filter them appropriately
719
- if type (products ) != Table :
696
+ if not isinstance (products , Table ) :
720
697
721
- if type (products ) == str :
698
+ if isinstance (products , str ) :
722
699
products = [products ]
723
700
724
701
# collect list of products
@@ -748,10 +725,6 @@ def download_products(self, products, download_dir=None,
748
725
749
726
return manifest
750
727
751
- @deprecated (since = "v0.3.9" , alternative = "get_cloud_uris" )
752
- def get_hst_s3_uris (self , data_products , include_bucket = True , full_url = False ):
753
- return self .get_cloud_uris (data_products , include_bucket , full_url )
754
-
755
728
def get_cloud_uris (self , data_products , include_bucket = True , full_url = False ):
756
729
"""
757
730
Takes an `~astropy.table.Table` of data products and returns the associated cloud data uris.
@@ -780,10 +753,6 @@ def get_cloud_uris(self, data_products, include_bucket=True, full_url=False):
780
753
781
754
return self ._cloud_connection .get_cloud_uri_list (data_products , include_bucket , full_url )
782
755
783
- @deprecated (since = "v0.3.9" , alternative = "get_cloud_uri" )
784
- def get_hst_s3_uri (self , data_product , include_bucket = True , full_url = False ):
785
- return self .get_cloud_uri (data_product , include_bucket , full_url )
786
-
787
756
def get_cloud_uri (self , data_product , include_bucket = True , full_url = False ):
788
757
"""
789
758
For a given data product, returns the associated cloud URI.
0 commit comments