Script for calculating multiple DUV values from many X and Y data (Opple Light Master helper)

My usual workflow when using opple light meter is to create a spreadsheet with all flashlight modes:

The page Calculate Duv from CIE 1931 xy coordinates | Waveform Lighting allows to calculate DUV value for single pair of X and Y data. I used the algorithm from that page and wrote a simple script.

Thanks to that script I can just copy 2 columns:

and paste it as the script input:

Instructions how to run it with podman/docker in case you don’t have java installed locally are at the top of the script.

Link to the script: CalcDuv.java

I do the calculation in Excel. The calculation is not complicated and can be done directly in Excel.
Put x value in A2 and y in B2.
Put the following duv formula in C2
=SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)-(-0.00616793ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^6+0.0893944ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^5-0.5179722ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^4+1.5317403ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^3-2.4243787ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^2+1.925865ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))-0.471106)
I know the formula looks ugly and not elegant,but it works well.
Once you verify the calculation, you can copy and paste the formula to next to the columns of cie x and y.
The formula is direct conversion of the code from waveformlighting.com website.
Calculate Duv from CIE 1931 xy coordinates | Waveform Lighting
u = (4x) / (-2x + 12y + 3);
v = (6
y) / (-2x + 12y + 3);
k6 =-0.00616793;
k5 =0.0893944;
k4 =-0.5179722;
k3 =1.5317403;
k2 =-2.4243787;
k1 =1.925865;
k0 =-0.471106;
Lfp = Math.sqrt(Math.pow((u - 0.292),2)+Math.pow((v-0.24),2));
a = Math.acos((u-0.292)/Lfp);
Lbb = k6Math.pow(a,6) + k5Math.pow(a,5) + k4Math.pow(a,4) + k3Math.pow(a,3) + k2Math.pow(a,2) + k1a+k0;
Duv = Lfp - Lbb;
Here are my measurements with Opple 3 and calculated DUV using the Excel formula.
!https://i.imgur.com/JvdHonC.png!
Edit: Text format alters the formula, so I change the format to plain text.

Thanks for sharing that excel formula. I tried to put it in C2 (A2 and B2 filled with X and y values) but excel gave an error. Would you be able to share the excel file?

=SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)-(-0.00616793ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^6+0.0893944ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^5-0.5179722ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^4+1.5317403ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^3-2.4243787ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))^2+1.925865ACOS((((4A2)/(-2A2+12B2+3)-0.292))/(SQRT(((4A2)/(-2A2+12B2+3)-0.292)^2+((6B2)/(-2A2+12B2+3)-0.24)^2)))-0.471106)
Can you try this? There must be an error when copy and pasting.

Try it, but give me an error.
thank you for sharing

Here is the link to the excel file. You can download the file using the following menu: “File > Download > Microsoft Excel” from the google page.

Please let me know when you downloaded the file, so I can move the file from the shared folder.

Sorry man,

there is an error

Try this again?

Thank you man,
now it works perfect!

I made a change to your excel file by inserting lux, CD, distance, throw.
Thank you again Sir.

Thank you, I have downloaded it.