Skip to content

Instantly share code, notes, and snippets.

@giswqs
Last active October 15, 2024 23:42
Show Gist options
  • Save giswqs/4dff7165c830b8aa82f02f5ccc744eea to your computer and use it in GitHub Desktop.
Save giswqs/4dff7165c830b8aa82f02f5ccc744eea to your computer and use it in GitHub Desktop.
Hurricane Francine
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Create satellite timelapse animations of Hurricane Francine using Earth Engine and geemap"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import ee\n",
"import geemap"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4466b4cd99f14bb2a816c0721ccda244",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[40, -100], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(ch…"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = geemap.Map(center=[40, -100], zoom=4)\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Draw a rectange on the map above. "
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"roi = m.user_roi\n",
"if roi is None:\n",
" roi = ee.Geometry.BBox(-99.3832, 19.877, -82.1084, 33.7122)\n",
"start_date = \"2024-10-10T12:00:00\"\n",
"end_date = \"2024-10-10T21:00:00\"\n",
"data = \"GOES-16\"\n",
"scan = \"full_disk\""
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <style>\n",
" .geemap-dark {\n",
" --jp-widgets-color: white;\n",
" --jp-widgets-label-color: white;\n",
" --jp-ui-font-color1: white;\n",
" --jp-layout-color2: #454545;\n",
" background-color: #383838;\n",
" }\n",
"\n",
" .geemap-dark .jupyter-button {\n",
" --jp-layout-color3: #383838;\n",
" }\n",
"\n",
" .geemap-colab {\n",
" background-color: var(--colab-primary-surface-color, white);\n",
" }\n",
"\n",
" .geemap-colab .jupyter-button {\n",
" --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
" }\n",
" </style>\n",
" "
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generating URL...\n",
"Downloading GIF image from https://earthengine.googleapis.com/v1/projects/earthengine-legacy/videoThumbnails/728ef1e924936320bf598066a3e59173-1ccedb288b64e8472339efb690d35d36:getPixels\n",
"Please wait ...\n",
"[Errno 13] Permission denied: '/goes.gif'\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "41aec2a4d107446a9cbc29fc1badc0d4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"timelapse = geemap.goes_timelapse(\n",
" roi, \"goes.gif\", start_date, end_date, data, scan, framesPerSecond=5, overlay_data=\"us_states\"\n",
")\n",
"geemap.show_image(timelapse)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![goes](https://github.com/user-attachments/assets/7735ece7-c1d2-4304-b349-64a298f81d9b)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "geo",
"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.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
@JamilLC
Copy link

JamilLC commented Oct 15, 2024

La entrada 5 no funciona

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment