#!/usr/bin/env python # coding: utf-8 # # Landsat-8 Level1 (GeoTIFF) # # Landst 8 is a unique resource for those who work in agriculture, geology, forestry, regional planning, education, mapping, and global change research. It is a multi-spectral imaging mission, capturing visible, infrared bands, and thermal bands since February 2013. This block is a L1 (TOA) data block that is AOI-clipped, which outputs a single GeoTIFF file and will store the AOI within the output feature geometry. # In[2]: import up42 # In[3]: # Authenticate and initialize project up42.authenticate(project_id="1234", project_api_key="abcd") project = up42.initialize_project() # In[4]: # Define the aoi namib_desert_aoi = {"type": "FeatureCollection","features": [{"type": "Feature","properties": {}, "geometry": {"type": "Polygon","coordinates": [[[14.610298,-24.516841], [14.622478,-24.516841], [14.622478,-24.50833], [14.610298,-24.50833], [14.610298,-24.516841]]]}}]} # In[5]: # Construct the workflow workflow = project.create_workflow(name="Landsat8-Geotiff-example", use_existing=True) input_tasks = ["sentinelhub-landsat8-aoiclipped"] workflow.add_workflow_tasks(input_tasks) # In[7]: # Define the aoi and input parameters of the workflow to run it input_parameters = workflow.construct_parameters(geometry=namib_desert_aoi, geometry_operation='bbox', start_date="2018-11-07", end_date="2020-12-31") input_parameters["sentinelhub-landsat8-aoiclipped:1"].update({"max_cloud_cover":100}) # In[8]: # Estimate parameters workflow.estimate_job(input_parameters) # In[9]: # Run a test job to query data availability and check the configuration. test_job = workflow.test_job(input_parameters, track_status=True) # In[10]: # Run the actual live job job = workflow.run_job(input_parameters, track_status=True) # In[ ]: # Download results job.download_results() # #### B04, B03, B02 are equivalent to RGB, for visualisation, we chose these bands for better aesthetics # In[12]: # Plot the results job.plot_results(figsize=(6,6), bands=[4,3,2])