22
22
from descarteslabs .client .services .raster import Raster
23
23
from descarteslabs .client .services .metadata .metadata_filtering import AndExpression
24
24
25
- CONST_ID_DEPRECATION_MESSAGE = (
26
- "Keyword arg `const_id' has been deprecated and will be removed in "
27
- "future versions of the library. Use the `products` "
28
- "argument instead. Product identifiers can be found with the "
29
- " products() method."
30
- )
31
25
32
26
OFFSET_DEPRECATION_MESSAGE = (
33
27
"Keyword arg `offset` has been deprecated and will be removed in "
@@ -145,28 +139,18 @@ def get_bands_by_key(self, key):
145
139
146
140
return r .json ()
147
141
148
- def get_bands_by_constellation (self , const ):
149
- """
150
- For a given constellation id, return the available bands.
151
-
152
- :param str const: A constellation name/abbreviation.
153
-
154
- :return: A dictionary of band entries and their metadata.
155
- """
156
- r = self .session .get ('/bands/constellation/%s' % const )
157
- return r .json ()
158
-
159
- def products (self , bands = None , limit = None , offset = None , owner = None , ** kwargs ):
142
+ def products (self , bands = None , limit = None , offset = None , owner = None , text = None , ** kwargs ):
160
143
"""Search products that are available on the platform.
161
144
162
145
:param list(str) bands: Band name(s) e.g ["red", "nir"] to filter products by.
163
146
Note that products must match all bands that are passed.
164
147
:param int limit: Number of results to return.
165
148
:param int offset: Index to start at when returning results.
166
149
:param str owner: Filter products by the owner's uuid.
150
+ :param str text: Filter products by string match.
167
151
168
152
"""
169
- params = ['limit' , 'offset' , 'bands' , 'owner' ]
153
+ params = ['limit' , 'offset' , 'bands' , 'owner' , 'text' ]
170
154
171
155
args = locals ()
172
156
kwargs = dict (kwargs , ** {
@@ -194,25 +178,13 @@ def available_products(self):
194
178
195
179
return r .json ()
196
180
197
- def translate (self , const_id ):
198
- """Translate a deprecated constellation identifier
199
- into a new-style product identifier.
200
-
201
- :param string const_id: The constellation identifier to translate.
202
- """
203
-
204
- r = self .session .get ('/products/translate/{}' .format (const_id ))
205
-
206
- return r .json ()
207
-
208
- def summary (self , products = None , const_id = None , sat_id = None , date = 'acquired' , part = None ,
181
+ def summary (self , products = None , sat_id = None , date = 'acquired' , part = None ,
209
182
place = None , geom = None , start_time = None , end_time = None , cloud_fraction = None ,
210
183
cloud_fraction_0 = None , fill_fraction = None , q = None , pixels = None ,
211
184
dltile = None ):
212
185
"""Get a summary of the results for the specified spatio-temporal query.
213
186
214
187
:param list(str) products: Product identifier(s).
215
- :param list(str) const_id: Constellation identifier(s).
216
188
:param list(str) sat_id: Satellite identifier(s).
217
189
:param str date: The date field to use for search (e.g. `acquired`).
218
190
:param str part: Part of the date to aggregate over (e.g. `day`).
@@ -273,13 +245,6 @@ def summary(self, products=None, const_id=None, sat_id=None, date='acquired', pa
273
245
274
246
kwargs ['products' ] = products
275
247
276
- if const_id :
277
- warn (CONST_ID_DEPRECATION_MESSAGE , DeprecationWarning )
278
- if isinstance (const_id , string_types ):
279
- const_id = [const_id ]
280
-
281
- kwargs ['const_id' ] = const_id
282
-
283
248
if date :
284
249
kwargs ['date' ] = date
285
250
@@ -315,7 +280,7 @@ def summary(self, products=None, const_id=None, sat_id=None, date='acquired', pa
315
280
r = self .session .post ('/summary' , json = kwargs )
316
281
return r .json ()
317
282
318
- def search (self , products = None , const_id = None , sat_id = None , date = 'acquired' , place = None ,
283
+ def search (self , products = None , sat_id = None , date = 'acquired' , place = None ,
319
284
geom = None , start_time = None , end_time = None , cloud_fraction = None ,
320
285
cloud_fraction_0 = None , fill_fraction = None , q = None , limit = 100 , offset = 0 ,
321
286
fields = None , dltile = None , sort_field = None , sort_order = "asc" , randomize = None ,
@@ -324,7 +289,6 @@ def search(self, products=None, const_id=None, sat_id=None, date='acquired', pla
324
289
optional. For accessing more than 10000 results, see :py:func:`features`.
325
290
326
291
:param list(str) products: Product Identifier(s).
327
- :param list(str) const_id: Constellation Identifier(s).
328
292
:param list(str) sat_id: Satellite identifier(s).
329
293
:param str date: The date field to use for search (e.g. `acquired`).
330
294
:param str place: A slug identifier to be used as a region of interest.
@@ -388,14 +352,6 @@ def search(self, products=None, const_id=None, sat_id=None, date='acquired', pla
388
352
389
353
kwargs ['products' ] = products
390
354
391
- if const_id :
392
- warn (CONST_ID_DEPRECATION_MESSAGE , DeprecationWarning )
393
-
394
- if isinstance (const_id , string_types ):
395
- const_id = [const_id ]
396
-
397
- kwargs ['const_id' ] = const_id
398
-
399
355
if geom :
400
356
kwargs ['geom' ] = geom
401
357
@@ -444,15 +400,14 @@ def search(self, products=None, const_id=None, sat_id=None, date='acquired', pla
444
400
445
401
return fc
446
402
447
- def ids (self , products = None , const_id = None , sat_id = None , date = 'acquired' , place = None ,
403
+ def ids (self , products = None , sat_id = None , date = 'acquired' , place = None ,
448
404
geom = None , start_time = None , end_time = None , cloud_fraction = None ,
449
405
cloud_fraction_0 = None , fill_fraction = None , q = None , limit = 100 , offset = None ,
450
406
dltile = None , sort_field = None , sort_order = None , randomize = None ):
451
407
"""Search metadata given a spatio-temporal query. All parameters are
452
408
optional.
453
409
454
410
:param list(str) products: Products identifier(s).
455
- :param list(str) const_id: Constellation identifier(s).
456
411
:param list(str) sat_id: Satellite identifier(s).
457
412
:param str date: The date field to use for search (e.g. `acquired`).
458
413
:param str place: A slug identifier to be used as a region of interest.
@@ -486,7 +441,7 @@ def ids(self, products=None, const_id=None, sat_id=None, date='acquired', place=
486
441
['landsat:LC08:PRE:TOAR:meta_LC80270312016188_v1']
487
442
488
443
"""
489
- result = self .search (sat_id = sat_id , products = products , const_id = const_id , date = date ,
444
+ result = self .search (sat_id = sat_id , products = products , date = date ,
490
445
place = place , geom = geom , start_time = start_time ,
491
446
end_time = end_time , cloud_fraction = cloud_fraction ,
492
447
cloud_fraction_0 = cloud_fraction_0 , fill_fraction = fill_fraction ,
@@ -495,15 +450,14 @@ def ids(self, products=None, const_id=None, sat_id=None, date='acquired', place=
495
450
496
451
return [feature ['id' ] for feature in result ['features' ]]
497
452
498
- def keys (self , products = None , const_id = None , sat_id = None , date = 'acquired' , place = None ,
453
+ def keys (self , products = None , sat_id = None , date = 'acquired' , place = None ,
499
454
geom = None , start_time = None , end_time = None , cloud_fraction = None ,
500
455
cloud_fraction_0 = None , fill_fraction = None , q = None , limit = 100 , offset = 0 ,
501
456
dltile = None , sort_field = None , sort_order = 'asc' , randomize = None ):
502
457
"""Search metadata given a spatio-temporal query. All parameters are
503
458
optional. Results are paged using limit/offset.
504
459
505
460
:param list(str) products: Products identifier(s).
506
- :param list(str) const_id: Constellation identifier(s).
507
461
:param list(str) sat_id: Satellite identifier(s).
508
462
:param str date: The date field to use for search (e.g. `acquired`).
509
463
:param str place: A slug identifier to be used as a region of interest.
@@ -537,7 +491,7 @@ def keys(self, products=None, const_id=None, sat_id=None, date='acquired', place
537
491
['meta_LC80270312016188_v1']
538
492
539
493
"""
540
- result = self .search (sat_id = sat_id , products = products , const_id = const_id , date = date ,
494
+ result = self .search (sat_id = sat_id , products = products , date = date ,
541
495
place = place , geom = geom , start_time = start_time ,
542
496
end_time = end_time , cloud_fraction = cloud_fraction ,
543
497
cloud_fraction_0 = cloud_fraction_0 , fill_fraction = fill_fraction ,
@@ -547,7 +501,7 @@ def keys(self, products=None, const_id=None, sat_id=None, date='acquired', place
547
501
548
502
return [feature ['key' ] for feature in result ['features' ]]
549
503
550
- def features (self , products = None , const_id = None , sat_id = None , date = 'acquired' , place = None ,
504
+ def features (self , products = None , sat_id = None , date = 'acquired' , place = None ,
551
505
geom = None , start_time = None , end_time = None , cloud_fraction = None ,
552
506
cloud_fraction_0 = None , fill_fraction = None , q = None , fields = None ,
553
507
batch_size = 1000 , dltile = None , sort_field = None , sort_order = 'asc' ,
@@ -575,7 +529,7 @@ def features(self, products=None, const_id=None, sat_id=None, date='acquired', p
575
529
continuation_token = None
576
530
577
531
while True :
578
- result = self .search (sat_id = sat_id , products = products , const_id = None ,
532
+ result = self .search (sat_id = sat_id , products = products ,
579
533
date = date , place = place , geom = geom ,
580
534
start_time = start_time , end_time = end_time ,
581
535
cloud_fraction = cloud_fraction ,
0 commit comments