TNO Intern

Commit 055afca1 authored by Arjo Segers's avatar Arjo Segers
Browse files

Fixed definition of bounding box for global selection. Added delays to avoid...

Fixed definition of bounding box for global selection. Added delays to avoid rate limit errors from STAC catalogue inquiry.
parent a7d70a25
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@
#   Files are downloaded from S3 buckets.
#   Save credentials needed to download from S3 bucket to file in home directory.
#
# 2026-04, Arjo Segers
#   Fixed definition of bounding box for global selection.
#   Added delays to avoid rate limit errors from STAC catalogue inquiry.
#


########################################################################
@@ -259,9 +263,6 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
        # init base object:
        utopya.UtopyaRc.__init__(self, rcfile=rcfile, rcbase=rcbase, env=env)

        # number of seconds to wait in retry loop:
        nsec_wait = 10

        # url of API:
        api_url = self.GetSetting("url")
        # info ...
@@ -299,7 +300,7 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
            # info ...
            logging.info(f"{indent}area         : no")
            # box parameter:
            box = None
            bbox = None
        # endif

        # target file, might include time templates:
@@ -405,6 +406,10 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
                            )

                        #endfor # items

                        # this helps to reduce the "Rate limit exceeded" errors ...
                        time.sleep(0.5)

                        ## testing ...
                        #break
                    #endfor # pages
@@ -429,6 +434,8 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):

            #endwhile # retry loop

            # this helps to reduce the "Rate limit exceeded" errors ...
            time.sleep(0.1)
            # next:
            tx = tx2