Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OmgClimateDataProcessor Class Reference
[Library]

#include <omgclimatedataprocessor.h>

Collaboration diagram for OmgClimateDataProcessor:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class contains various functions that can be used to post process raw climate data sets such as obtained from the IPCC.

*Methods that take ArrayLengths as parameters should be passed as the number of elements, *not the vector size. e.g. an vector of 12 months is int[11] but should be passed as 12. *

Author:
Tim Sutton

Definition at line 32 of file omgclimatedataprocessor.h.

Public Member Functions

 OmgClimateDataProcessor (float mNoData=-9999.0)
 ~OmgClimateDataProcessor ()
float meanOverLowestQ (QVector< float > theClimateVector)
float meanOverHighestQ (QVector< float > theClimateVector)
int firstMonthOfHighestQ (QVector< float > theClimateVector)
int firstMonthOfLowestQ (QVector< float > theClimateVector)
float meanOverQuarter (QVector< float > theClimateVector, int theStartMonth)
float lowestValue (QVector< float > theClimateVector)
float highestValue (QVector< float > theClimateVector)
float greatestTotalRange (QVector< float > theClimateVector1, QVector< float > theClimateVector2)
float greatestMonthlyRange (QVector< float > theClimateVector, QVector< float > theClimateVector2)
float stddevOverYear (QVector< float > theClimateVector)
bool threshold (QVector< float > &theClimateVector, float theThreshold)
float threshold (float theFloat, float theThreshold)
float sum (QVector< float > theClimateVector)
float mean (QVector< float > theClimateVector)
float valueGivenMonth (QVector< float > theClimateVector, int theMonth)
int monthWithHighestValue (QVector< float > theClimateVector)
int monthWithLowestValue (QVector< float > theClimateVector)
int numberOfMonthsAboveZero (QVector< float > theClimateVector)
float meanValueOverFrostFreeMonths (QVector< float > theFrostVector, QVector< float > theClimateVector)

Private Attributes

float mNoData


Constructor & Destructor Documentation

OmgClimateDataProcessor::OmgClimateDataProcessor float  mNoData = -9999.0  ) 
 

Default constructor

Definition at line 27 of file omgclimatedataprocessor.cpp.

References mNoData.

OmgClimateDataProcessor::~OmgClimateDataProcessor  ) 
 

Destructor

Definition at line 32 of file omgclimatedataprocessor.cpp.


Member Function Documentation

int OmgClimateDataProcessor::firstMonthOfHighestQ QVector< float >  theClimateVector  ) 
 

This method returns the month that starts the quarter with the highest average values.

Definition at line 321 of file omgclimatedataprocessor.cpp.

References mNoData, and QUARTER.

Referenced by OmgClimateDataProcessorController::run().

int OmgClimateDataProcessor::firstMonthOfLowestQ QVector< float >  theClimateVector  ) 
 

This method returns the month that starts the quarter with the lowest average values. For example, if 12 months were :

1 2 3 4 5 6 7 8 9 10 11 12 ----------------------------------------------- 21 18 19 15 12 5 6 8 12 15 16 20

Then the return from this method would be 6 because 5,6 and 8 combined form the lowest quarter.

Definition at line 220 of file omgclimatedataprocessor.cpp.

References mNoData, and QUARTER.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::greatestMonthlyRange QVector< float >  theClimateVector,
QVector< float >  theClimateVector2
 

Given two arrays (e.g. min temp and max temp) range will determine the smallest and largest values that occur and return the difference. The value of the max-min difference for a given month that is the greatest is returned.

See also:
greatestTotalRange

Definition at line 654 of file omgclimatedataprocessor.cpp.

float OmgClimateDataProcessor::greatestTotalRange QVector< float >  theClimateVector1,
QVector< float >  theClimateVector2
 

Given two arrays (e.g. min temp and max temp) range will determine the smallest and largest values that occur and return the difference. The function is indescriminate as to whether the values are in the same month or not.

See also:
greatestMonthlyRange

Definition at line 592 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::highestValue QVector< float >  theClimateVector  ) 
 

Given an vector, this function will return the value of the largest element in the vector.

Definition at line 533 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::lowestValue QVector< float >  theClimateVector  ) 
 

Given an vector, this method will return the value of the smallest element in the vector.

Definition at line 481 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::mean QVector< float >  theClimateVector  ) 
 

This function will return the sum of theClimateVector divided by the number of elements in theClimateVector.

Definition at line 751 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::meanOverHighestQ QVector< float >  theClimateVector  ) 
 

This method calculates the mean value over the quarter with the highest values (i.e. the three consecutive months with the maximum combined total).

Definition at line 126 of file omgclimatedataprocessor.cpp.

References mNoData, and QUARTER.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::meanOverLowestQ QVector< float >  theClimateVector  ) 
 

This method calculates the mean value over the quarter with the lowest values (i.e. the three consecutive months with the minimum combined total).

Definition at line 35 of file omgclimatedataprocessor.cpp.

References mNoData, and QUARTER.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::meanOverQuarter QVector< float >  theClimateVector,
int  theStartMonth
 

This method will return the mean over three months in theClimateVector, starting at theStartMonth.

Definition at line 415 of file omgclimatedataprocessor.cpp.

References mNoData, and QUARTER.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::meanValueOverFrostFreeMonths QVector< float >  theFrostVector,
QVector< float >  theClimateVector
 

This value will return the mean value of months in theClimateVector where the corresponding months in theFrostArray have no frost free days.

Definition at line 934 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

int OmgClimateDataProcessor::monthWithHighestValue QVector< float >  theClimateVector  ) 
 

This function will return an integer between 1 and 12 corresponding to the month with the highest value.

Definition at line 877 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

int OmgClimateDataProcessor::monthWithLowestValue QVector< float >  theClimateVector  ) 
 

This function will return an integer between 1 and 12 corresponding to the month with the lowest value.

Definition at line 843 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

int OmgClimateDataProcessor::numberOfMonthsAboveZero QVector< float >  theClimateVector  ) 
 

This function will return an integer in the range 0-12 representing the number of months in theClimateVector where the value for that month is above zero. Typically used to calculate how many months in the year there are where the average temp is above freezing.

Definition at line 989 of file omgclimatedataprocessor.cpp.

References FREEZING_POINT, and mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::stddevOverYear QVector< float >  theClimateVector  ) 
 

This function will return the standard deviation of the climate vector.

Definition at line 790 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().

float OmgClimateDataProcessor::sum QVector< float >  theClimateVector  ) 
 

Determine the sum of a vector of values

Parameters:
QVector <float> values to be summed
Returns:
float sum of values provided in input.

Definition at line 725 of file omgclimatedataprocessor.cpp.

References mNoData.

float OmgClimateDataProcessor::threshold float  theFloat,
float  theThreshold
 

Overloaded version of the above function. If the input value is greater or equal to threshold will be true. Values below threshold will be assigned false.

Parameters:
float A vector of float values
float the desired threshold
Returns:
bool True on success otherwise something went wrong.

Definition at line 698 of file omgclimatedataprocessor.cpp.

References mNoData.

bool OmgClimateDataProcessor::threshold QVector< float > &  theClimateVector,
float  theThreshold
 

A new vector the same length as original will be returned when each element of the input vector that is greater or equal to threshold will be true. Values below threshold will be assigned false.

Parameters:
&QVector <float> A vector of float values
float the desired threshold
Returns:
bool True on success otherwise something went wrong.

Definition at line 665 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgRasterThreshold::accept().

float OmgClimateDataProcessor::valueGivenMonth QVector< float >  theClimateVector,
int  theMonth
 

This function will return the value of the element in theClimateVector that corresponds to theMonth.

Definition at line 911 of file omgclimatedataprocessor.cpp.

References mNoData.

Referenced by OmgClimateDataProcessorController::run().


Member Data Documentation

float OmgClimateDataProcessor::mNoData [private]
 

Definition at line 147 of file omgclimatedataprocessor.h.

Referenced by firstMonthOfHighestQ(), firstMonthOfLowestQ(), greatestTotalRange(), highestValue(), lowestValue(), mean(), meanOverHighestQ(), meanOverLowestQ(), meanOverQuarter(), meanValueOverFrostFreeMonths(), monthWithHighestValue(), monthWithLowestValue(), numberOfMonthsAboveZero(), OmgClimateDataProcessor(), stddevOverYear(), sum(), threshold(), and valueGivenMonth().


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:12:34 2008 for openModellerDesktop by  doxygen 1.4.1-20050210