Commit a2cbd098 authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

New function: remove missing observations

Currently, this function is only available in the scope of the
function that formats observations for the scatter plot chart.

Remove the missing observations from the first (larger) array.
parent a9db75af
......@@ -869,6 +869,29 @@ const formatSTAResponseForScatterPlot = function (obsArrayOne, obsArrayTwo) {
missingTimestamp,
obsArrayOneTimestamp
);
/**
*
* @param {*} missingIndexesArr An array of the indexes of the observations missing from the second set of observations
* @param {*} obsOneArr An array of the first set of observations (timestamp + value)
* @returns {undefined}
*/
const removeMissingObservationFromFirstArray = function (
missingIndexesArr,
obsOneArr
) {
missingIndexesArr.forEach((index) => {
if (index > -1) {
obsOneArr.splice(index, 1);
}
});
};
removeMissingObservationFromFirstArray(
indexesMissingObsArr,
obsArrayOneChecked
);
console.log(obsArrayOneChecked.length);
};
(async () => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment