Tool to create timelapses from Mars rover images using the Mars Rover Photo API.
- Clone/Download the repository
- Install the requirements:
pip install -r requirements.txt
- Sign up for a NASA API Key
- Create a file named
.env
containingNASA_API_KEY=<YOUR API KEY>
OR When using the tool, pass the additional parameter--key <YOUR API KEY>
Note
You will need to have Python installed to run this. Don't have it? Download it.
python make_timelapse.py \
--rover perseverance \
--camera FRONT_HAZCAM_LEFT_A \
--sol_start 300 \
--sol_start 310
Argument / Flag | Possible Values | Description |
---|---|---|
--rover |
perseverance , curiosity |
REQUIRED Name of the rover from which to download images. |
--camera |
valid camera name ex: FRONT_HAZCAM_LEFT_A |
REQUIRED Name of the rover from which to download images. |
--sol_start |
SOL calculator ex: 305 |
REQUIRED First Mars SOL to include in the timelapse. |
--sol_end |
SOL calculator ex: 315 |
REQUIRED Last Mars SOL to include in the timelapse. Must be equal or greater than sol_start |
--img_perc_start |
integer between 0 and 100 |
Trim the start of the timelapse. Must be lower than img_perc_end . Defaults to 0 . |
--img_perc_end |
integer between 0 and 100 |
Trim the end of the timelapse. Must be greater than img_perc_start . Defaults to 100 . |
--fps |
integer > 0 |
Frames per second of exported video. Default: 2 |
--min_aspect_ratio |
float > 0.0 |
Minimum aspect ratio of pictures to include in the timelapse. Default: 0 |
--key |
Your NASA API Key | Pass your NASA API Key as an argument if you did not create a .env file. REQUIRED if no .env file |
--keep_temp |
N/A | Pass this flag to prevent the deletion of the temporary directory containing the raw and resized images upon completion. On the following runs, images will not be redownloaded unless --force_download is passed. |
--force_download |
N/A | Pass this flag to force downloading of images that already exist in the temp directory if it exists |
Note
The opportunity
and spirit
rover images are unavailable as NASA took down the images from their server. You can read more about it on this Github issue and this Reddit thread.
python make_timelapse.py \
--sol_start 0 \
--sol_end 5 \
--keep_temp \
--fps 5 \
--rover perseverance \
--camera EDL_DDCAM
python make_timelapse.py \
--sol_start 2 \
--sol_end 2 \
--img_perc_end 14 \
--keep_temp \
--fps 5 \
--rover perseverance \
--camera EDL_RDCAM
python make_timelapse.py \
--sol_start 1250 \
--sol_end 1350 \
--keep_temp \
--fps 5 \
--rover perseverance \
--camera REAR_HAZCAM_LEFT
python make_timelapse.py \
--sol_start 340 \
--sol_end 345 \
--keep_temp \
--fps 5 \
--rover perseverance \
--min_aspect_ratio 3 \
--camera NAVCAM_LEFT
python make_timelapse.py \
--sol_start 340 \
--sol_end 345 \
--keep_temp \
--fps 5 \
--rover curiosity \
--camera FHAZ
python make_timelapse.py \
--sol_start 340 \
--sol_end 340 \
--keep_temp \
--fps 15 \
--rover curiosity \
--camera NAVCAM