mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:17:08 +00:00
Add more QCs
This commit is contained in:
@@ -23,6 +23,24 @@
|
|||||||
name: "Missing gun data"
|
name: "Missing gun data"
|
||||||
check: |
|
check: |
|
||||||
!!currentItem._("raw_meta.smsrc.guns") || "Missing gun data"
|
!!currentItem._("raw_meta.smsrc.guns") || "Missing gun data"
|
||||||
|
|
||||||
|
-
|
||||||
|
name: "No fire"
|
||||||
|
check: |
|
||||||
|
const currentShot = currentItem;
|
||||||
|
const gunData = currentItem._("raw_meta.smsrc");
|
||||||
|
(gunData && gunData.num_nofire != 0)
|
||||||
|
? `Source ${gunData.src_number}: No fire (${gunData.num_nofire} guns)`
|
||||||
|
: true;
|
||||||
|
|
||||||
|
-
|
||||||
|
name: "Pressure errors"
|
||||||
|
check: |
|
||||||
|
const gunData = currentItem._("raw_meta.smsrc");
|
||||||
|
(gunData && Math.abs(gunData.manifold/parameters.gunPressureNominal - 1) > parameters.gunPressureToleranceRatio)
|
||||||
|
? `Source ${gunData.src_number}: Manifold pressure out of specification – ${gunData.manifold} / ${parameters.gunPressureNominal} = ${(Math.abs(gunData.manifold/parameters.gunPressureNominal - 1)*100).toFixed(1)}% > ${(parameters.gunPressureToleranceRatio*100).toFixed(1)}%`
|
||||||
|
: true;
|
||||||
|
|
||||||
-
|
-
|
||||||
name: "Single gun / cluster"
|
name: "Single gun / cluster"
|
||||||
children:
|
children:
|
||||||
@@ -45,6 +63,58 @@
|
|||||||
_result_ = `Depth error: ${bad_guns.join("; ")}`;
|
_result_ = `Depth error: ${bad_guns.join("; ")}`;
|
||||||
}
|
}
|
||||||
_result_
|
_result_
|
||||||
|
|
||||||
|
-
|
||||||
|
name: "Synchronisation (error)"
|
||||||
|
check: |
|
||||||
|
currentItem._ = (k) => k.split(".").reduce((a, b) => typeof a != "undefined" ? a[b] : a, currentItem);
|
||||||
|
const currentShot = currentItem;
|
||||||
|
const gunData = currentShot._("raw_meta.smsrc");
|
||||||
|
let result = [];
|
||||||
|
if (gunData && gunData.num_nofire == 0) {
|
||||||
|
|
||||||
|
// These are the indices into the gun array for the different
|
||||||
|
// values of interest.
|
||||||
|
const subarray = 0;
|
||||||
|
const aimpoint = 7;
|
||||||
|
const firetime = 8;
|
||||||
|
|
||||||
|
// We only care about the source which actually fired (or was supposed to)
|
||||||
|
const sourceFired = gunData.guns.filter(g => g[2] == gunData.src_number);
|
||||||
|
|
||||||
|
// Let us check if the average delta for each string is within spec
|
||||||
|
let subarrayAverages = [];
|
||||||
|
sourceFired.forEach(g => {
|
||||||
|
const idx = g[subarray]-1;
|
||||||
|
const delta = g[firetime]-g[aimpoint];
|
||||||
|
if (!subarrayAverages[idx]) {
|
||||||
|
subarrayAverages[idx] = [];
|
||||||
|
}
|
||||||
|
subarrayAverages[idx].push(delta);
|
||||||
|
});
|
||||||
|
subarrayAverages = subarrayAverages.map(s => s.reduce( (a, b) => a+b, 0 ) / s.length);
|
||||||
|
|
||||||
|
subarrayAverages.forEach((value, idx) => {
|
||||||
|
if (value > parameters.gunTimingSubarrayAverage) {
|
||||||
|
result.push(`Average delta error: string ${idx+1}: ${value.toFixed(2)} > ${parameters.gunTimingSubarrayAverage}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Let us see about individual guns
|
||||||
|
sourceFired
|
||||||
|
.filter(gun => Math.abs(gun[firetime]-gun[aimpoint]) > parameters.gunTiming)
|
||||||
|
.forEach(gun => {
|
||||||
|
const value = Math.abs(gun[firetime]-gun[aimpoint]);
|
||||||
|
result.push(`Delta error: source ${gun[2]}, string ${gun[0]}, gun ${gun[1]}: ${value.toFixed(2)} > ${parameters.gunTiming}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (result.length) {
|
||||||
|
result.join("; ");
|
||||||
|
} else {
|
||||||
|
// Either there were no error or gun data was missing, which we take care of elsewhere
|
||||||
|
true;
|
||||||
|
}
|
||||||
|
|
||||||
-
|
-
|
||||||
name: "Autofire"
|
name: "Autofire"
|
||||||
check: |
|
check: |
|
||||||
@@ -61,7 +131,7 @@
|
|||||||
const bad_guns = gunData.filter(gun => gun[_autofire]).map(gun => {
|
const bad_guns = gunData.filter(gun => gun[_autofire]).map(gun => {
|
||||||
return `source ${gun[2]}, string ${gun[0]}, gun ${gun[1]}, depth: ${gun[10]}`;
|
return `source ${gun[2]}, string ${gun[0]}, gun ${gun[1]}, depth: ${gun[10]}`;
|
||||||
});
|
});
|
||||||
_result_ = `Depth error: ${bad_guns.join("; ")}`;
|
_result_ = `Depth error: ${bad_guns.join(";\n")}`;
|
||||||
}
|
}
|
||||||
_result_
|
_result_
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
|
|
||||||
gunDepth: 6.0
|
gunDepth: 6.0
|
||||||
gunDepthTolerance: 0.5
|
gunDepthTolerance: 0.5
|
||||||
|
gunTiming: 1.5
|
||||||
|
gunTimingSubarrayAverage: 0.5
|
||||||
|
gunPressureNominal: 2000
|
||||||
|
gunPressureToleranceRatio: 0.025
|
||||||
|
|
||||||
crosslineError: 12
|
crosslineError: 12
|
||||||
crosslineErrorAverage: 9
|
crosslineErrorAverage: 9
|
||||||
inlineErrorRunningAverageValue: 2
|
inlineErrorRunningAverageValue: 2
|
||||||
|
|||||||
Reference in New Issue
Block a user