LuxPy: a package for lighting and color science¶
- Author: K.A.G. Smet (ksmet1977 at gmail.com)
- Version: 1.9.9
- Date: Aug 16, 2022
- License: GPLv3

License: GPLv3¶
Copyright (C) <2017><Kevin A.G. Smet> (ksmet1977 at gmail.com)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Installation¶
Install luxpy¶
- Install miniconda
- download the installer from: https://conda.io/miniconda.html or https://repo.continuum.io/miniconda/)
- e.g. https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe
- Make sure ‘conda.exe’ can be found on the windows system path, if necessary do a manual add.
Create a virtual environment with full anaconda distribution by typing the following at the commandline:
>> conda create --name py36 python=3.6 anaconda
Activate the virtual environment:
>> activate py36
- Install pip to virtual environment (just to ensure any packages to be
installed with pip to this virt. env. will be installed here and not globally):
>> conda install -n py36 pip
5a. Install luxpy package from pypi:
>> pip install luxpy
5b. Install luxpy package from anaconda:
>> conda install -c ksmet1977 luxpy
Note: | If any errors show up, try and do a manual install of the dependencies:
scipy, numpy, pandas, matplotlib and setuptools,
either using e.g.
>> conda install scipy
or
>> pip install scipy ,
and try and reinstall luxpy using pip. |
---|
Use of LuxPy package in Spyder IDE¶
Install spyder in py36 environment:
>> conda install -n py36 spyder
Run spyder
>> spyder
To import the luxpy package, on Spyder’s commandline for the IPython kernel (or in script) type:
import luxpy as lx
Use of LuxPy package in Jupyter notebook¶
Install jupyter in py36 environment:
>> conda install -n py36 jupyter
Start jupyter notebook:
>> jupyter notebook
- Open an existing or new notebook:
e.g. open “luxpy_basic_usage.ipynb” for an overview of how to use the LuxPy package.
To import LuxPy package type:
import luxpy as lx
Imported (required) packages¶
Core¶
- import os
- import warnings
- import pathlib
- import importlib
- from collections import OrderedDict as odict
- from mpl_toolkits.mplot3d import Axes3D
- import colorsys
- import itertools
- import copy
- import time
- import tkinter
- import ctypes
- import platform
- import subprocess
- import cProfile
- import pstats
- import io
3e party dependencies (automatic install)¶
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import scipy as sp
- import imageio
3e party dependencies (automatic install on import)¶
- import pyswarms (when importing particleswarms from math)
- import pymoo (when importing pymoo_nsga_ii from math)
- import harfang as hg (when importing toolbox.stereoscopicviewer)
3e party dependencies (requiring manual install)¶
- To control Ocean Optics spectrometers with spectro toolbox:
- import seabreeze (conda install -c poehlmann python-seabreeze)
- pip install pyusb (for use with ‘pyseabreeze’ backend of python-seabreeze)
Luxpy package structure¶
Utils sub-package¶
py:
- __init__.py
- utilities.py
- folder_tree.py
namespace: luxpy.utils
Math sub-package¶
py:
- __init__.py
- basics.py
- minimizebnd.py
- mupolymodel.py
- Pyswarms_particleswarm.py
- pymoo_nsga_ii.py
namespace: luxpy.math
vec3/¶
py:
- __init__.py
- vec3.py
namespace: luxpy.math
DEMO/¶
py:
- __init__.py
- DEMO.py
- demo_opt.py
namespace: luxpy.math
Spectrum sub-package¶
py:
- __init__.py
- spdx_ietm2714.py
- basics/
- __init__.py
- cmf.py
- spectral.py
- spectral_databases.py
namespace: luxpy
SPD class¶
py:
- SPD.py
namespace: luxpy
Color sub-package¶
py:
- __init__.py
namespace: luxpy
utils/¶
py:
- __init__.py
- plotters.py
namespace: luxpy
ctf/¶
py:
- __init__.py
- colortransformations.py
- colortf.py
namespace: luxpy
cct/¶
py:
- __init__.py
- cct.py
- cct_legacy.py
- cctduv_ohno_CORM2011.py
namespace: luxpy
cct/robertson1968¶
py:
- __init__.py
- robertson1968.py
namespace: luxpy.color.cct.robertson1968
cat/¶
py:
- __init__.py
- chromaticadaptation.py
namespace: luxpy.cat
cam/¶
py:
- __init__.py
- colorappearancemodels.py
- helpers.py
- utils.py
- ciecam02.py
- cam02ucs.py
- ciecam16.py
- cam16ucs.py
- cam15u
- sww2016.py
- cam18sl.py
- camjabz.py
- zcam.py
- cmf_translator_sww2021
namespace: luxpy.cam
deltaE/¶
py:
- __init__.py
- colordifferences.py
- discriminationellipses.py
- frieleellipses.py
- macadamellipses.py
namespace: luxpy.deltaE
whiteness/¶
py:
- __init__.py
- smet_white_loci.py
namespace: luxpy
cri/¶
py:
- __init__.py
- colorrendition.py
- /utils/
- __init__.py
- init_cri_defaults_database.py
- DE_scalers.py
- helpers.py
- graphics.py
- /indices/
- __init__.py
- indices.py
- cie_wrappers.py
- iestm30_wrappers.py
- cri2012.py
- mcri.py
- cqs.py
- fci.py
- thorntoncpi.py
- /iestm30/
- __init__.py
- metrics.py
- graphics.py
- metrics_fast.py
- /VFPX/
- __inint__.py
- vectorshiftmodel.py
- pixelshiftmodel.py
- VF_PX_models.py
namespace: luxpy.cri
cri/VFPX/¶
py:
- __init__.py
- VF_PX_models.py
- vectorshiftmodel.py
- pixelshiftmodel.py
namespace: luxpy.cri.VFPX
XYZ,LAB classes¶
py:
- CDATA.py
namespace: luxpy
Toolboxes¶
photbiochem/¶
py:
- __init__.py
- cie_tn003_2015.py
- ASNZS_1680_2_5_1997_COI.py
- circadian_CS_CLa_lrc.py
namespace: luxpy.photbiochem
indvcmf/¶
py:
- __init__.py
- individual_observer_cmf_model.py
namespace: luxpy.indvcmf
spdbuild/¶
py:
- __init__.py
- spdbuilder.py
- spdbuilder2020.py
- spdoptimzer2020.py
namespace: luxpy.spdbuild/
hypspcim/¶
py:
- __init__.py
- hyperspectral_img_simulator.py
namespace: luxpy.hypspcim
dispcal/¶
py:
- __init__.py
- displaycalibration.py
namespace: luxpy.dispcal
rgb2spec/¶
py:
- __init__.py
- smits_mitsuba.py
namespace: luxpy.rgb2spec
iolidfiles/¶
py:
- __init__.py
- io_lid_files.py
namespace: luxpy.iolidfiles
spectro/¶
py:
- __init__.py
- spectro.py
namespace: luxpy.spectro
sherbrooke_spectral_indices/¶
py:
- __init__.py
- sherbrooke_spectral_indices_2013.py
namespace: luxpy.sherbrooke_spectral_indices
spectral_mismatch_and_uncertainty/¶
py:
- __init__.py
- detector_spectral_mismatch.py
namespace: luxpy.spectral_mismatch_and_uncertainty
technoteamlmk/¶
py:
- __init__.py
- TechnoTeamLMK.py
namespace: luxpy.technoteamlmk
stereoscopicviewer/¶
py:
- __init__.py
- /harfang/
- harfang_viewer.py
namespace: luxpy.stereoscopicviewer