Skip to content

Instantly share code, notes, and snippets.

@kr-stn
Created April 8, 2019 09:21
Show Gist options
  • Save kr-stn/3d90bf2ca4ecc4c6ff754742e138c1a1 to your computer and use it in GitHub Desktop.
Save kr-stn/3d90bf2ca4ecc4c6ff754742e138c1a1 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already up-to-date: sentinelsat in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (0.13)\n",
"Requirement already satisfied, skipping upgrade: requests in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (2.21.0)\n",
"Requirement already satisfied, skipping upgrade: tqdm in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (4.31.1)\n",
"Requirement already satisfied, skipping upgrade: html2text in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (2018.1.9)\n",
"Requirement already satisfied, skipping upgrade: geojson>=2 in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (2.4.1)\n",
"Requirement already satisfied, skipping upgrade: six in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (1.12.0)\n",
"Requirement already satisfied, skipping upgrade: click in /home/kersten/.local/lib/python3.6/site-packages (from sentinelsat) (7.0)\n",
"Requirement already satisfied, skipping upgrade: geomet in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from sentinelsat) (0.2.0.post2)\n",
"Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from requests->sentinelsat) (2.8)\n",
"Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from requests->sentinelsat) (1.24.1)\n",
"Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from requests->sentinelsat) (3.0.4)\n",
"Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /home/kersten/miniconda3/envs/sensat/lib/python3.6/site-packages (from requests->sentinelsat) (2019.3.9)\n"
]
}
],
"source": [
"!pip install -U sentinelsat"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from sentinelsat import SentinelAPI"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"api = SentinelAPI(\"s5pguest\", \"s5pguest\", \"https://s5phub.copernicus.eu/dhus/\")"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"munich_point = \"POINT (11.571003 48.142746)\""
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"start_date = \"2019-04-01T12:25:00.000Z\"\n",
"end_date = \"2019-04-01T12:30:00.000Z\""
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
"products = api.query(area=munich_point, date=(start_date, end_date), platformname=\"Sentinel-5 Precursor\")"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"18"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(products)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment