Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, numpy, pylab

Expand Down Expand Up @@ -176,9 +176,9 @@ def figures ():
blackbody_patch_plot (T_list_cool, 'Cool Blackbody Colors', 'Blackbody-CoolPatch')

# color vs temperature
blackbody_color_vs_temperature_plot (range (1200, 16000, 50), 'Blackbody Colors', 'Blackbody-Colors')
blackbody_color_vs_temperature_plot (range (10000, 40000, 100), 'Hot Blackbody Colors', 'Blackbody-HotColors')
blackbody_color_vs_temperature_plot (range (950, 1200, 1), 'Cool Blackbody Colors', 'Blackbody-CoolColors')
blackbody_color_vs_temperature_plot (list(range(1200, 16000, 50)), 'Blackbody Colors', 'Blackbody-Colors')
blackbody_color_vs_temperature_plot (list(range(10000, 40000, 100)), 'Hot Blackbody Colors', 'Blackbody-HotColors')
blackbody_color_vs_temperature_plot (list(range(950, 1200, 1)), 'Cool Blackbody Colors', 'Blackbody-CoolColors')

# spectrum of specific temperatures
blackbody_spectrum_plot (2000.0)
Expand Down
6 changes: 3 additions & 3 deletions ciexyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_normalized_spectral_line_colors (
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, numpy

Expand Down Expand Up @@ -690,7 +690,7 @@ def empty_spectrum ():

The result can be passed to xyz_from_spectrum() to convert to an xyz color.
'''
wl_nm_range = range (start_wl_nm, end_wl_nm + 1)
wl_nm_range = list(range(start_wl_nm, end_wl_nm + 1))
num_wl = len (wl_nm_range)
spectrum = numpy.zeros ((num_wl, 2))
for i in range (0, num_wl):
Expand Down Expand Up @@ -742,7 +742,7 @@ def get_normalized_spectral_line_colors (
dwl_angstroms - Wavelength separation, in angstroms (0.1 nm). Default 10 A. (1 nm spacing)
'''
# get range of wavelengths, in angstroms, so that we can have finer resolution than 1 nm
wl_angstrom_range = range (10*start_wl_nm, 10*(end_wl_nm + 1), dwl_angstroms)
wl_angstrom_range = list(range(10*start_wl_nm, 10*(end_wl_nm + 1), dwl_angstroms))
# get total point count
num_spectral = len (wl_angstrom_range)
num_points = num_spectral + num_purples
Expand Down
2 changes: 1 addition & 1 deletion colormodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, numpy

Expand Down
2 changes: 1 addition & 1 deletion figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


from . import (colormodels, ciexyz, illuminants, plots, blackbody,
rayleigh, thinfilm, misc)
Expand Down
2 changes: 1 addition & 1 deletion illuminants.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, numpy

Expand Down
2 changes: 1 addition & 1 deletion misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, numpy, pylab

Expand Down
2 changes: 1 addition & 1 deletion plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, random
import numpy, pylab
Expand Down
4 changes: 2 additions & 2 deletions rayleigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math
import numpy, pylab
Expand Down Expand Up @@ -160,7 +160,7 @@ def figures ():
'Rayleigh Scattering by Various Illuminants', 'Rayleigh-PatchVarious')

# color vs illuminant temperature
T_list = range (1200, 16000, 50) # must be integers for range()
T_list = list(range(1200, 16000, 50)) # must be integers for range()
rayleigh_color_vs_illuminant_temperature_plot (T_list, 'Rayleigh Scattering Sky Colors', 'Rayleigh-SkyColors')

# spectra for several illuminants
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


from . import (test_colormodels, test_ciexyz, test_illuminants,
test_blackbody, test_rayleigh, test_thinfilm)
Expand Down
2 changes: 1 addition & 1 deletion test_blackbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, random, numpy

Expand Down
2 changes: 1 addition & 1 deletion test_ciexyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import random

Expand Down
2 changes: 1 addition & 1 deletion test_colormodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, random, numpy
from . import colormodels, ciexyz
Expand Down
2 changes: 1 addition & 1 deletion test_illuminants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


from . import illuminants

Expand Down
2 changes: 1 addition & 1 deletion test_rayleigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import random

Expand Down
2 changes: 1 addition & 1 deletion test_thinfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import random

Expand Down
6 changes: 3 additions & 3 deletions thinfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class thin_film (n1, n2, n3, thickness_nm) -
You should have received a copy of the GNU Lesser General Public License
along with ColorPy. If not, see <http://www.gnu.org/licenses/>.
'''
from __future__ import division, absolute_import, print_function


import math, cmath, numpy
import pylab
Expand Down Expand Up @@ -209,15 +209,15 @@ def thinfilm_spectrum_plot (n1, n2, n3, thickness_nm, illuminant, title, filenam
def figures ():
'''Draw some thin film plots.'''
# simple patch plot
thickness_nm_list = range (0, 1000, 10)
thickness_nm_list = list(range(0, 1000, 10))
illuminant = illuminants.get_illuminant_D65()
illuminants.scale_illuminant (illuminant, 9.50)
thinfilm_patch_plot (1.500, 1.003, 1.500, thickness_nm_list, illuminant, 'ThinFilm Patch Plot', 'ThinFilm-Patch')

# plot the colors of films vs thickness.
# we scale the illuminant to get a better range of color.
#thickness_nm_list = range (0, 1000, 2) # faster
thickness_nm_list = range (0, 1000, 1) # nicer
thickness_nm_list = list(range(0, 1000, 1)) # nicer
# gap in glass/plastic
illuminant = illuminants.get_illuminant_D65()
illuminants.scale_illuminant (illuminant, 4.50)
Expand Down