Hi Alex,
Ah, so you’re one of our “lurkers.” You had me wondering how you acquired such expertise out the gate!
Thanks for posting your converted files. I’m not sure I understand the input format exactly, but I am looking at their “BRDF_2.bsdf” file, and it seems to be a header describing the steps of each axis in a 4-D (theta_i, phi_i, theta_s, phi_s) array of BSDF values. Your code broke this into separate files for each incident pair and correctly labeled the data as “#theta phi BSDF”, so you shouldn’t need to perform any conversions on the values themselves unless I’m missing something.
Under these assumptions, the first value in your first incident file “meas_00.dat” should start something like:
#incident_angle 0.000000 0.000000
#intheta 0.000000
#inphi 0.000000
#format: theta phi BSDF
0.000000 0.000000 3.95E+00
1.000000 0.000000 3.25E+00
2.000000 0.000000 2.45E+00
…
Instead, your first file starts out:
#incident_angle 0.000000 0.000000
#intheta 0.000000
#inphi 0.000000
#format: theta phi BSDF
0.000000 0.000000 7.4701517983e-01
0.000000 1.000000 7.4701517983e-01
0.000000 2.000000 7.4701517983e-01
…
I’m also assuming that the later angles in the input file are the inner-loops on the array, which is why the scatter angles are different above. Even if the order were reversed, the first value should still be “3.95” rather than “0.747” – a value that doesn’t appear in the input.
It makes sense that you would exclude all-zero values from the input, which I guess is anything over 75° theta_s or so, but the value count still doesn’t square with that, so there may be something else going on. I didn’t go through your whole output file.
Finally, there are “TIS” values inserted in the input, which I assume is total integrated scattering at each incidence. These will be handy for checking the data once we get the conversion right, but don’t need to go in the files given to pabopto2bsdf.
Does any of this track?
Cheers,
-Greg