Package to streamline operations with GOES satellite imagery
Project description
GoesVideo
This package is a Satpy wrapper that facilitates and streamlines the downloading, compositing and animating of imagery from the GOES-East and GOES-West satellites. Basic annotation tools are also included to simplify the preparation of images and videos for presentations.
Note, that the current version has only been tested using Level 2 CMI data. Results may be unexpected with other GOES products.
Installation
GoesVideo can be installed from PyPI with pip:
pip install goesvideo
Usage
There are three main classes that can be invoked depending on the needs
of the user. To download GOES data files from AWS, use the
GoesDownloader
class:
import goesvideo
dl = goesvideo.GoesDownloader('goes-east', 'full', 'ABI-L2-CMIP', base_dir=mypath)
dl.download_all('2023-05-01 10:30:00', '2023-05-10 12:17:00', interval=1440)
This example will download all full-disk images from the GOES-East product ABI-L2-CMIP between May 5th and May 10th, 2023 at an interval of 1440 minutes.
Compositing of imagery to produce Satpy scenes can be accomplished using the GoesCompositor
class:
import goesvideo
compositor = goesvideo.GoesCompositor('goes-west', 'conus', 'ABI-L2-CMIP', base_dir=mypath)
compositor.create_composites('true_color', '2023-05-01 10:30:00', '2023-05-10', interval=30)
compositor.create_composites('color_infrared', '2023-07-01 08:00:00', '2023-07-03 13:00:00',
interval=180,
bbox=(-117.3, 30.1, -93.0, 43.5),
coastlines=True,
resampling=('finest', 'native'),
folder_name='July-cropped')
The compositor will invoke the downloader as needed to retrieve the remote datasets necessary to produce the desired
Satpy scene. For the ABI instrument, Satpy includes a configuration file named abi.yaml
that defines all of the
available scenes. Note that the goesvideo
package also has a configuration file
abibands.yaml
that is intended to mirror the band requirements in the Satpy file. It is advisable to update
this file anytime updates are made to the Satpy file.
Videos can be produced using the GoesAnimator
class:
import goesvideo
animator = goesvideo.GoesAnimator('goes-west', 'conus', 'ABI-L2-CMIP', base_dir=mypath)
animator.create_video('true_color', start_time='2023-07-10 12:34:00',
end_time='2023-07-13 10:10:00',
interval=15,
timestamps=True,
coastlines=True,
res=(1920, 1080),
fps=20)
animator.create_video('C01', start_time='2023-07-10 12:34:00',
end_time='2023-07-13 10:10:00',
interval=15,
cmap='Spectral')
animator.create_video('color_infrared', from_existing_imgs=True)
The animator will invoke the compositor and downloader as necessary to produce the desired video. In the last example, the animator will search for matching composites that have previously been generated and saved in the base directory.
Since compositing and animating GOES imagery can be a lengthy process, a preview function has been provided to ensure the video will turn out as expected:
import goesvideo
animator = goesvideo.GoesAnimator('goes-west', 'conus', 'ABI-L2-CMIP', base_dir=mypath)
animator.preview('true_color', use_cached=True, **kwargs)
In this example, a preview will be generated for the true color composite. The kwargs can contain any of the compositor
keywords and/or annotation-related keywords such as text
, circle
and arrow
.
If desired, output videos can be annotated post-production using the experimental
GoesClip
class.
Finally, a note on folder structure. The base_dir
is either set by the user or defaults to the current working directory.
The folder is then automatically setup as follows:
base_dir
|
|---goesdata [contains NC data files]
|
|---Images [contains composited images]
| |
| |---Image subfolder #1 (random or user-provided)
| | |
| | |---image1.png
| | |---image2.png
| | |---...
| | |---metadata.json
| | |---timestamps.csv
| |
| |---Image subfolder #2 (random or user-provided)
| | |
| | |---image1.png
| | |---image2.png
| | |---...
| | |---metadata.json
| | |---timestamps.csv
| |
| |--- ...
|
|---Videos [contains videos]
|
|---Video subfolder #1 (same name as Image subfolder)
| |
| |---video.mp4
|
|---Video subfolder #2 (same name as Image subfolder)
| |
| |---video.mp4
|
|---...
To ensure proper functioning of this package, this folder structure
should not be modified. Also, the metadata.json
and timestamps.csv
files
added to each image subfolder should not be deleted or moved.
For additional information, please see the docstrings in the source code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for goesvideo-2024.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b8f1f4ca8d5615a15a0c9821506621b25f3984688877983f18fe47a91d338c5 |
|
MD5 | 16ee4d83c2f1751584e05dc26eca7b80 |
|
BLAKE2b-256 | 988c205b4f6441cbd27672f3f8e903c704c4fa373733566e3ba4849edca52346 |