CSV Compare
This commit is contained in:
88
Scripts/bio-rad.js
Normal file
88
Scripts/bio-rad.js
Normal file
@ -0,0 +1,88 @@
|
||||
"use strict";
|
||||
|
||||
getValue($('gv.thicknessPoints', ''), $('dcp.BIORAD2/csv/Index', '0'));
|
||||
|
||||
function getCollectionParseFloat(collection) {
|
||||
let result = [];
|
||||
let value;
|
||||
for (let i = 0; i < collection.length; i++) {
|
||||
value = parseFloat(collection[i]);
|
||||
result.push(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getSum(collection) {
|
||||
let result = 0;
|
||||
if (!collection || collection.length === 0) {
|
||||
result = 0;
|
||||
}
|
||||
else {
|
||||
for (let i = 0; i < collection.length; i++) {
|
||||
result += collection[i];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getAverage(collection) {
|
||||
let result = null;
|
||||
if (collection == null || collection.length === 0)
|
||||
result = 0;
|
||||
else {
|
||||
let sum = getSum(collection);
|
||||
result = sum / collection.length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getValue(thicknessPoints, index) {
|
||||
let result = null;
|
||||
if (index === 13) {
|
||||
if (thicknessPoints != undefined && thicknessPoints.length > 1) {
|
||||
let collection = thicknessPoints[0] === '|' ? thicknessPoints.substring(1).split('|') : thicknessPoints.split('|');
|
||||
let collectionParseFloat = getCollectionParseFloat(collection);
|
||||
let thicknessFourteen3mmEdgeMean = getAverage([[collectionParseFloat[10], collectionParseFloat[11], collectionParseFloat[12], collectionParseFloat[13]]]);
|
||||
let thicknessFourteenMeanFrom = getAverage([[collectionParseFloat[1], collectionParseFloat[2], collectionParseFloat[6], collectionParseFloat[7]]]);
|
||||
result = (thicknessFourteen3mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function getVariance(collection) {
|
||||
let result = null;
|
||||
if (collection == null || collection.length === 0)
|
||||
result = null;
|
||||
else {
|
||||
let variance = 0;
|
||||
let t = collection[0];
|
||||
for (let i = 1; i < collection.length; i++) {
|
||||
t += collection[i];
|
||||
const diff = ((i + 1) * collection[i]) - t;
|
||||
variance += diff * diff / ((i + 1.0) * i);
|
||||
}
|
||||
result = variance / (collection.length - 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD2/csv/Thickness', '')
|
||||
// $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD3/csv/Thickness', '')
|
||||
// $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD4/csv/Thickness', '')
|
||||
// $('gv.thicknessPoints', '') + '|' + $('dcp.BIORAD5/b-csv/Thickness', '')
|
||||
|
||||
// \\mesfs.infineon.com\EC_Characterization_Si\Archive\BIORAD2\2025_Week_08\2025-02-20\64-659712-4626_2025-02-20_11;50_AM_5144331401\638756490128318288
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
||||
const thicknessPoints = getCollectionParseFloat('|4.022|3.952|3.936|3.971|3.954|3.976|3.949|3.906|3.967|3.995|3.997|3.932|3.766|3.890'.substring(1).split('|'));
|
||||
const thicknessTenPoints = thicknessPoints.slice(0, 10);
|
||||
const thicknessFourteenCriticalPointsAverage = getAverage(thicknessTenPoints); // 15 // *3.962799999999999
|
||||
const thicknessFourteenCriticalPointsStdDev = Math.sqrt(getVariance(thicknessTenPoints)); // 16 // *0.0318496467798311
|
||||
const thicknessFourteenCenterMean = thicknessPoints[4]; // 17 // 3.954
|
||||
const thicknessFourteenMeanFrom = getAverage([thicknessPoints[1], thicknessPoints[2], thicknessPoints[6], thicknessPoints[7]]); // 18 // *3.954
|
||||
const thicknessFourteen5mmEdgeMean = getAverage([thicknessPoints[0], thicknessPoints[9]]); // 19 // *4.0085
|
||||
const thicknessFourteen3mmEdgeMean = getAverage([thicknessPoints[10], thicknessPoints[11], thicknessPoints[12], thicknessPoints[13]]); // 20 // *3.89625
|
||||
const thicknessFourteen5mmEdgePercent = (thicknessFourteen5mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100; // 21 // *1.848440576764267
|
||||
const thicknessFourteen3mmEdgePercent = (thicknessFourteen3mmEdgeMean - thicknessFourteenMeanFrom) / thicknessFourteenMeanFrom * 100; // 22 // *-1.0036206567998442
|
||||
console.log(thicknessFourteenCriticalPointsAverage);
|
Reference in New Issue
Block a user