Ray tracing - BRDF using Cornell measured spectral data I wrote a ray tracer that implements various BRDF models (Oren Nayar, Lamber, Torrance Sparrow and so on). 
Now I'm trying to implement a BRDF from measured data.
I choose the Cornell database data available here:

http://www.graphics.cornell.edu/online/measurements/reflectance/spraypaints/index.html

I want to use them because there's a representation of the data as spectrum with 31 sample (my ray tracer use spectral data for light calculation and then convert them to CIE XYZ and then RGB values for the final image rendering).


Which is the correct way to use this data?
Which sample technique must be used? 
Why phi_out has all negative value?
Can I calculate phi_out using the same approximation as the one I used in Oren Nayar, so ||View - Normal * (View.dot(normal)||
The MATLab data file has 3 arrays


Input vector - aka, the light source (In Cartesian coordinates)
Output vector - aka, the eye (Also in Cartesian coordinates)
Spectral data (spectral data is discretized into 31 bins)


So input[n], with output[n] results in spectral[n]

The ASTM file is a flattened version of the MATLab data file, with one major difference: the input and output vectors are in spherical coordinates, specifically the traditional physics notation:



The data is defined in the following range:

For input vector, $\theta$ (theta) varies from $0$ to $\frac{\pi}{2}$, and $\phi$ (phi) is always a constant $0$.

The output vectors are uniformally distributed across the hemisphere. Since $\phi$ is periodic on $2\pi$, mathematically you can define the bounds of $\phi$  in an infinite number of ways. In this data set they chose:
$$\phi = [-\pi, \pi]$$
but it would be perfectly fine to choose
$$\phi = [0, 2\pi]$$

Now, in order to use the data:


Since the input vectors only vary over a quarter circle ($\theta = [0, \frac{\pi}{2}]$ and $\phi = 0$), not the whole hemisphere, you will need to find the matrix transform that transforms your input vector to the quarter circle.
Apply the same transform to the output vector.
Using the transformed input and output vectors, look up the spectral response of the BRDF.


I'm not sure of the best way to do this. I defer to others' opinions. I'm sure there is some kind of data structure / algorithm to do the search.
The naive way would be to do a O(n) search of all the input and output directions to find the two or three that are closest, then LERP between them.

Use the spectral values as the BRDF in the rendering equation