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

New functions: calculate monthly min/max values

Calculate the minimum and maximum of observation values for a monthly
interval
parent f38903e5
......@@ -55,6 +55,28 @@ const calculateAverageOfObservationValuesWithinDatesInterval = function (
);
};
/**
* Calculate the minimum of observation values that fall within a time interval delimited by the first day and last day of a calendar month
* @param {Array} obsValuesForMonthIntervalArr An array of observation values that fall within one calendar month
* @returns {Number} A floating-point number representing the minimum of observation values within one calendar month
*/
const calculateMinimumObservationValuesWithinMonthInterval = function (
obsValuesForMonthIntervalArr
) {
return Math.min(...obsValuesForMonthIntervalArr);
};
/**
* Calculate the maximum of observation values that fall within a time interval delimited by the first day and last day of a calendar month
* @param {Array} obsValuesForMonthIntervalArr An array of observation values that fall within one calendar month
* @returns {Number} A floating-point number representing the maximum of observation values within one calendar month
*/
const calculateMaximumObservationValuesWithinMonthInterval = function (
obsValuesForMonthIntervalArr
) {
return Math.max(...obsValuesForMonthIntervalArr);
};
/**
* Calculate the sum of observation values that fall within a time interval delimited by the first day and last day of a calendar month
* @param {Array} obsValuesForMonthIntervalArr An array of observation values that fall within one calendar month
......
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