basfunds.blogg.se

The notebook script download
The notebook script download










  1. #THE NOTEBOOK SCRIPT DOWNLOAD INSTALL#
  2. #THE NOTEBOOK SCRIPT DOWNLOAD CODE#
  3. #THE NOTEBOOK SCRIPT DOWNLOAD DOWNLOAD#

Which one to download? We can use the plot method with sentinelsat to see where the image boundaries lie. The particular query will return 4 records. Use print(products) to inspect the ordered dictionary if unsure. Based on the results you may wish to adjust the values in your query, or even add other parameters to the query. products = api.query(footprint,īasically we parse a query to the api to search for products between a date, platform, the processing level and a cloud cover %. Sentinelsat is looking for a boundary in wkt (well known text) format, so the penultimate line here coverts our boundary in geojson to wkt.

#THE NOTEBOOK SCRIPT DOWNLOAD CODE#

You’ll need a username and password to the scihub, but once you have these just paste them into the code below: user = 'user' # change this!įootprint = geojson_to_wkt( read_geojson(boundsdata)) Now that we know our geojson file is the location we are expecting, lets use it with sentinelsat to discover if there is any imagery available. I really like folium, I have written a little about in the past, if you are interested it is here.

the notebook script download

Then I have added my bounds_IOW.geojson to the map (‘m’) and finally called m in the last line to plot it. I’ve centered it roughly on the Isle of Wight and zoomed in (zoom_start=10). I am using the folium example from the documentation, so the variable ‘m’ is my map. Using the code below in a Jupyter Notebook: m = folium.Map(, zoom_start= 10)īoundsdata = r'D:\sentinelsat\bounds_IOW.geojson' We can use GeoPandas to plot this file but in this example I am going to use folium to plot the bounding box over OpenStreetMap. In this example I have created a geojson file that covers the Isle of Wight – I’ve called it bounds_IOW.geojson. For any installation issues information have a look at the docs here.

#THE NOTEBOOK SCRIPT DOWNLOAD INSTALL#

Open the anaconda prompt and type pip install sentinelsat If you run your Python environment via Anaconda (as I do), then install sentinelsat using pip install. I assume you can use other vector formats for a boundary, but if you cannot then use ogr2ogr to convert to geojson (or QGIS – its pretty good!). I am using a geojson file for my boundary as that follows the example in the documentation.

the notebook script download

The only thing to note is that the boundary file you will search on needs to be projected in WGS 84 or which is EPSG code 4326.

#THE NOTEBOOK SCRIPT DOWNLOAD DOWNLOAD#

In this post and accompanying notebook I’ll show you how with a scihub account you can build a script to search, download and unzip Sentinel2 level 2A data using Python. I haven’t used this before and having talked about it on #scenefromabove podcast a couple of weeks ago, I thought I would give it a go. One of these was recently updated – sentinelsat. Sometimes though it is preferable to access via the command line or a script and again there are tools that allow you to do this. I am not going to list them all here, but most involve an interaction with a website that contains a map. There are so many ways to download Sentinel 2 data.












The notebook script download