Skip to content

Commit

Permalink
fix: Added check for black input values to avoid divid-by-zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregungory committed May 8, 2024
1 parent fa1352a commit 47396e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cal/cal/sky2spectra.cal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ RCSid $Id: sky2spectra.cal,v 1.3 2024/03/01 00:21:54 greg Exp $ }
{ RCSid $Id: sky2spectra.cal,v 1.4 2024/05/08 18:43:12 greg Exp $ }
{
Convert RGB sky to spectral sky using, for example:

Expand Down Expand Up @@ -32,4 +32,4 @@ in_M2 = M2(in_x,in_y);

co_Multiplier = in_Y / (S0normf + in_M1*S1normf + in_M2*S2normf) / 179;

co(n) = co_Multiplier * select(n, 1, in_M1, in_M2);
co(n) = if(in_Y - 1e-4, co_Multiplier*select(n, 1, in_M1, in_M2), 0);

0 comments on commit 47396e8

Please sign in to comment.