81 goes timelapse
Uncomment the following line to install geemap if needed.
This notebook is adapted from Justin Braaten's JavaScript example. Credits to Justin Braaten. See also his Medium post - GOES in Earth Engine.
In [1]:
Copied!
import os
import ee
import geemap
import os
import ee
import geemap
In [2]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [3]:
Copied!
m = geemap.ee_initialize()
m = geemap.ee_initialize()
In [4]:
Copied!
region = ee.Geometry.Polygon(
[
[
[-159.5954379282731, 60.40883060191719],
[-159.5954379282731, 24.517881970830725],
[-114.2438754282731, 24.517881970830725],
[-114.2438754282731, 60.40883060191719],
]
],
None,
False,
)
region = ee.Geometry.Polygon(
[
[
[-159.5954379282731, 60.40883060191719],
[-159.5954379282731, 24.517881970830725],
[-114.2438754282731, 24.517881970830725],
[-114.2438754282731, 60.40883060191719],
]
],
None,
False,
)
In [5]:
Copied!
start_date = "2021-10-24T14:00:00"
end_date = "2021-10-25T01:00:00"
data = "GOES-17"
scan = "full_disk"
start_date = "2021-10-24T14:00:00"
end_date = "2021-10-25T01:00:00"
data = "GOES-17"
scan = "full_disk"
In [6]:
Copied!
col = geemap.goes_timeseries(start_date, end_date, data, scan, region)
col = geemap.goes_timeseries(start_date, end_date, data, scan, region)
In [7]:
Copied!
visParams = {
'bands': ['CMI_C02', 'CMI_GREEN', 'CMI_C01'],
'min': 0,
'max': 0.8,
'dimensions': 700,
'framesPerSecond': 9,
'region': region,
'crs': col.first().projection(),
}
visParams = {
'bands': ['CMI_C02', 'CMI_GREEN', 'CMI_C01'],
'min': 0,
'max': 0.8,
'dimensions': 700,
'framesPerSecond': 9,
'region': region,
'crs': col.first().projection(),
}
In [8]:
Copied!
out_dir = os.path.expanduser("~/Downloads")
out_gif = os.path.join(out_dir, "goes_timelapse.gif")
if not os.path.exists(out_dir):
os.makedirs(out_dir)
out_dir = os.path.expanduser("~/Downloads")
out_gif = os.path.join(out_dir, "goes_timelapse.gif")
if not os.path.exists(out_dir):
os.makedirs(out_dir)
In [9]:
Copied!
geemap.download_ee_video(col, visParams, out_gif)
geemap.download_ee_video(col, visParams, out_gif)
Generating URL... Downloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/bd68339dfeed4e3f6a621b5055f99cb1-9b8b16761307a55b44fab3cf2ef68a8f:getPixels Please wait ... The GIF image has been saved to: /home/runner/Downloads/goes_timelapse.gif
In [10]:
Copied!
timestamps = geemap.image_dates(col, date_format='YYYY-MM-dd HH:mm').getInfo()
timestamps = geemap.image_dates(col, date_format='YYYY-MM-dd HH:mm').getInfo()
In [11]:
Copied!
geemap.add_text_to_gif(
out_gif,
out_gif,
xy=('3%', '3%'),
text_sequence=timestamps,
font_size=20,
font_color='#ffffff',
)
geemap.add_text_to_gif(
out_gif,
out_gif,
xy=('3%', '3%'),
text_sequence=timestamps,
font_size=20,
font_color='#ffffff',
)
All the above steps can be reduced to just one line of code using the goes_timelapse()
function.
In [12]:
Copied!
geemap.goes_timelapse(
out_gif, start_date, end_date, data, scan, region, framesPerSecond=10
)
geemap.goes_timelapse(
out_gif, start_date, end_date, data, scan, region, framesPerSecond=10
)
Generating URL... Downloading GIF image from https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/videoThumbnails/372f1dcf36a8c18ab3884da2d3e96f82-8ca2aab0843ee0ef7e10d659df08d952:getPixels Please wait ... The GIF image has been saved to: /home/runner/Downloads/goes_timelapse.gif ffmpeg is not installed on your computer.
Last update:
2022-03-14