@@ -58,9 +58,10 @@ def sources(self):
5858 r = self .session .get ('/sources' )
5959 return r .json ()
6060
61- def bands (self , limit = None , products = None , offset = None , wavelength = None , resolution = None , tags = None ):
62- """Seach for imagery data bands that you have access to.
61+ def bands (self , products = None , limit = None , offset = None , wavelength = None , resolution = None , tags = None ):
62+ """Search for imagery data bands that you have access to.
6363
64+ :param list(str) products: A list of product(s) to return bands for.
6465 :param int limit: Number of results to return.
6566 :param int offset: Index to start at when returning results.
6667 :param float wavelenth: A wavelength in nm e.g 700 that the band sensor must measure.
@@ -81,6 +82,26 @@ def bands(self, limit=None, products=None, offset=None, wavelength=None, resolut
8182 r = self .session .post ('/bands/search' , json = kwargs )
8283 return r .json ()
8384
85+ def derived_bands (self , bands = None , limit = None , offset = None ):
86+ """Search for predefined derived bands that you have access to.
87+
88+ :param list(str) bands: A list of source bands that must be part of
89+ the derived band i.e ["nir"]
90+ :param int limit: Number of results to return.
91+ :param int offset: Index to start at when returning results.
92+ """
93+ params = ['bands' , 'limit' , 'offset' ]
94+
95+ args = locals ()
96+ kwargs = {
97+ param : args [param ]
98+ for param in params
99+ if args [param ] is not None
100+ }
101+
102+ r = self .session .post ('/bands/derived/search' , json = kwargs )
103+ return r .json ()
104+
84105 def products (self , bands = None , limit = None , offset = None ):
85106 """Search products that are available on the platform.
86107
@@ -118,6 +139,17 @@ def available_products(self):
118139
119140 return r .json ()
120141
142+ def translate (self , const_id ):
143+ """Translate a deprecated constellation identifier
144+ into a new-style product identifier.
145+
146+ :param string const_id: The constellation identifier to translate.
147+ """
148+
149+ r = self .session .get ('/products/translate/{}' .format (const_id ))
150+
151+ return r .json ()
152+
121153 def summary (self , products = None , const_id = None , sat_id = None , date = 'acquired' , part = None ,
122154 place = None , geom = None , start_time = None , end_time = None , cloud_fraction = None ,
123155 cloud_fraction_0 = None , fill_fraction = None , pixels = None , params = None ,
@@ -513,3 +545,12 @@ def get_band(self, band_id):
513545 """
514546 r = self .session .get ('/bands/%s' % band_id )
515547 return r .json ()
548+
549+ def get_derived_band (self , derived_band_id ):
550+ """Get information about a single product.
551+
552+ :param str derived_band_id: Derived band identifier.
553+
554+ """
555+ r = self .session .get ('/bands/derived/%s' % derived_band_id )
556+ return r .json ()
0 commit comments