-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
15 lines (14 loc) · 1.14 KB
/
README
File metadata and controls
15 lines (14 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Contains 3 routines: makexyz, xyz2rgb, and spec2rgb. The latter is a wrapper for the first two.
You can pass an arbitrary spectrum (specify what the wavelengths are) with wavelengths in either
nanometers or meters (it'll figure it out), and it will convolve the spectrum by the CIE
color-matching functions to first produce the xyY color coordinates, and then can convert those
to rgb coordinates for outputting to a display. The color-matching functions are described
discretely in cmf.csv (drop in your own if you want) and are linearly interpolated to the
wavelengths of the input spectrum. You can also drop in your own xyz-rgb conversion matrix; it's
described in the python source.
orthoprojection.py is a simple routine for computing the orthographic projection of a
latitude-longitude grid where each cell is a color computed by colormatch. Together with
colormatch.py, you can take a simulated reflected light spectrum for each grid cell in a GCM,
compute its color, and then compute the orthographic projection to create a photo-realistic
image of your GCM output. Note that you'll have to simulate the reflected light spectrum yourself
with another package.