Giter Club home page Giter Club logo

mars-rover-gif-maker's Introduction

Mars-Rover-Gif-Maker

Spirit's Navcam

This script will create a gif from a range of dates (sols) for a given rover.

mars_pics = []
#Change thse parameters
camera = 'fhaz'
sol_start = 550 
sol_end = 600
rover = 'curiosity'
verbose_output = 1 # 0 for off, or 1 for on


for i in range(sol_start,sol_end):
    mars_pics.append(get_images_from_mars_rover_apis(i,API_KEY,camera,verbose_output,rover))
print("Done with grabbing pics...")
print("flattening array")

mars_pics = flatten(mars_pics)

print("size of Mars Pics list: ",len(mars_pics))
input("Do you want to continue? Interrupt the Kernel if you don't")

print("starting image dump to disk (this may take a while...)")
counter = 0
for el in mars_pics:
    counter += 1
    urllib.request.urlretrieve(el, f'{counter}.png')
print("Done with saving...")


fp_in = r"your_input_dir(where images were saved)*.png"
fp_out = rf"your_output_dir!\{rover}_gif_{camera}.gif"
#https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#gif


print("starting gif creation (this may also take a while...)")
img, *imgs = [Image.open(f) for f in sorted(glob.glob(fp_in))]
img.save(fp=fp_out, format='GIF', append_images=imgs,
    save_all=True, duration=200, loop=0)

print('Done!')

mars-rover-gif-maker's People

Contributors

trinitui avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.