Skip to content

Commit

Permalink
fix: label of e and c + calculation mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed May 1, 2024
1 parent 23293fe commit 7f8e3c3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/from/utils/spectrumCallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ function parseReflectance(variables) {
variables.k = {
data: variables.r.data.map((reflectance) => {
const absolute = reflectance / 100;
return (1 - absolute ** 2) / (2 * absolute);
return ((1 - absolute) ** 2) / (2 * absolute);
}),

symbol: 'k',
label: 'Kubelka-Munk Function',
label: ' F(R)',
units: '',
};

Expand All @@ -46,8 +45,8 @@ function parseReflectance(variables) {

variables.c = {
symbol: 'c',
label: 'Tauc',
units: '',
label: '(F(R) * h * v)^1/2', // factor 2 is a specific case
units: '√J',
data: [],
};
for (let i = 0; i < variables.k.data.length; i++) {
Expand Down Expand Up @@ -76,7 +75,7 @@ function parseAbsorbance(variables) {
} else {
const factor =
yVariable.label.includes('%') ||
yVariable.label.toLowerCase().includes('percent')
yVariable.label.toLowerCase().includes('percent')
? 100
: 1;

Expand Down

0 comments on commit 7f8e3c3

Please sign in to comment.