Skip to content

Commit

Permalink
Add light sources examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Oct 27, 2014
1 parent 393ed6d commit cd5df06
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions colour/examples/colorimetry/examples_light_sources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Showcases light sources dataset.
"""

from __future__ import division, unicode_literals

from pprint import pprint

import colour
from colour.utilities.verbose import message_box

message_box('Light Sources Dataset')

message_box('Light sources relative spectral power distributions dataset.')
pprint(sorted(colour.LIGHT_SOURCES_RELATIVE_SPDS.keys()))

print('\n')

message_box('Light sources chromaticity coordinates dataset.')
# Filtering aliases.
observers = dict(((observer, dataset)
for observer, dataset in sorted(colour.LIGHT_SOURCES.items())
if ' ' in observer))
for observer, light_source in observers.items():
print('"{0}".'.format(observer))
for illuminant, xy in sorted(light_source.items()):
print('\t"{0}": {1}'.format(illuminant, xy))
print('\n')

0 comments on commit cd5df06

Please sign in to comment.