Skip to content
/ py_sky Public

Sky Brightness Model (Rayleigh and Mie Scattering) [Experimental!]

License

Notifications You must be signed in to change notification settings

ookuyan/py_sky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

import imageio
from IPython.display import Image
from py_sky import set_scene, render, show
scene = set_scene(zenith=45, azimuth=180, width=32, height=32)
rgb = render(scene)
show(rgb)

png

width = 32
height = 32

images = list()

for i, zenith in enumerate(np.arange(0, 101, 5)):
    scene = set_scene(zenith=zenith, azimuth=180, width=width, height=height)
    
    rgb = render(scene)
    
    filename = 'sky_' + str(i).zfill(2) + '.png'
    imageio.imwrite(filename, rgb)
    
    images.append(imageio.imread(filename))
tmp = images.copy()
tmp.reverse()
imageio.mimsave('movie.gif', images + tmp, fps=60, duration=0.1)
Image(filename='movie.gif', width=1024, height=1024)