def __init__(self, root_url: str, auth: AuthBase = None, session: requests.Session = None): self._root_url = root_url self.session = session or requests.Session() self.auth = auth or NullAuth() self.default_headers = { "User-Agent": "openeo-python-client/{v}".format(v=openeo.client_version()) }
def __init__(self, root_url: str, auth: AuthBase = None, session: requests.Session = None, default_timeout: int = None): self._root_url = root_url self.auth = auth or NullAuth() self.session = session or requests.Session() self.default_timeout = default_timeout self.default_headers = { "User-Agent": "openeo-python-client/{cv} {py}/{pv} {pl}".format( cv=openeo.client_version(), py=sys.implementation.name, pv=".".join(map(str, sys.version_info[:3])), pl=sys.platform ) }
def queue(self, path: str): if path.startswith(self.PATH + '?'): super().queue(path) # TODO: auto-close browser tab/window? # TODO: make it a nicer page and bit more of metadata? status = 200 content = "<h1>OIDC Redirect URL request received.</h1><p>You can close this browser tab now.</p>" else: status = 404 content = "<p>Not found.</p>" body = self.TEMPLATE.format(content=content, version=openeo.client_version()) return status, body, {"Content-Type": "text/html; charset=UTF-8"}
import openeo connection = openeo.connect("https://openeo.vito.be/openeo/1.0") connection.authenticate_basic() sentinel2_data_cube = connection.load_collection( "TERRASCOPE_S2_TOC_V2", temporal_extent=["2018-05-06", "2018-05-06"], bands=["B02", "B04", "B08"]) sentinel2_data_cube = sentinel2_data_cube.filter_bbox( west=5.15183687210083, east=5.153381824493408, south=51.18192559252128, north=51.18469636040683, ) B02 = sentinel2_data_cube.band('B02') B04 = sentinel2_data_cube.band('B04') B08 = sentinel2_data_cube.band('B08') evi_cube = (2.5 * (B08 - B04)) / ((B08 + 6.0 * B04 - 7.5 * B02) + 1.0) evi_cube.download("bandmath_example.tiff", format="GTIFF") openeo.client_version()
# The master toctree document. master_doc = 'index' # General information about the project. project = 'openEO' copyright = '2017 - {d}, Jeroen Dries'.format( d=datetime.datetime.utcnow().strftime("%Y")) author = 'Jeroen Dries' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The full version, including alpha/beta/rc tags. release = openeo.client_version() # The short X.Y version. version = '.'.join(release.split('.')[:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']