项目作者: ookuyan

项目描述 :
Sky Brightness Model (Rayleigh and Mie Scattering) [Experimental!]
高级语言: Python
项目地址: git://github.com/ookuyan/py_sky.git
创建时间: 2019-06-12T22:00:50Z
项目社区:https://github.com/ookuyan/py_sky

开源协议:Apache License 2.0

下载


  1. %matplotlib inline
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import imageio
  4. from IPython.display import Image
  1. from py_sky import set_scene, render, show
  1. scene = set_scene(zenith=45, azimuth=180, width=32, height=32)
  1. rgb = render(scene)
  1. show(rgb)

png

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