# Path: wfcommon/meteo.py
# def StationToSensorPressure(pressureHPa, sensorElevationM,  stationElevationM, currentTempC): 
# def StationToAltimeter(PressureHPa, elevationM, algorithm = DefaultAltimeterAlgorithm):
# def StationToSeaLevelPressure(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm):
# def SensorToStationPressure(pressureHPa, sensorElevationM, stationElevationM, currentTempC):
# def SeaLevelToStationPressure(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm): 
# def PressureReductionRatio(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm): 
# def ActualVaporPressure(tempC, humidity, algorithm = DefaultVapAlgorithm):
# def SaturationVaporPressure(tempC, algorithm = DefaultVapAlgorithm): 
# def MixingRatio(pressureHPa, tempC, humidity): 
# def VirtualTempK(pressureHPa, tempC, humidity):
# def HumidityCorrection(tempC, elevationM, humidity, algorithm = DefaultVapAlgorithm):
# def DewPoint(tempC, humidity, algorithm = DefaultVapAlgorithm):
# def WindChill(tempC, windSpeedKmph):
# def HeatIndex(tempC, humidity):
# def Humidex(tempC, humidity): 
# def GeopotentialAltitude(geometricAltitudeM): 
# def FToC(value): 
# def CToF(value): 
# def CToK(value): 
# def KToC(value): 
# def FToR(value): 
# def RToF(value):
# def InToHPa(value):
# def HPaToIn(value):
# def FtToM(value):
# def MToFt(value):
# def InToMm(value): 
# def MmToIn(value): 
# def MToKm(value): # Miles !
# def KmToM(value): # Miles !
# def msToKmh(value):
# def WindX(v,d):
# def WindY(v,d):
# def WindSpeed(x,y):
# def WindDir(x,y):
# def WindDirTxt(d):
# def WindPredominantDirection(l):
# def convert_illuminance_wm2(lux):
# WIND_DIRECTIONS = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N']


import sys
from wfcommon import meteo
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation, either version 3 of the License, or
##  (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with this program.  If not, see <http://www.gnu.org/licenses/>.



class WindChillMinFormula(object):
    '''
    Minimum WindChill temperature. Requires temperature and wind speed in Km/h.
    '''

    def __init__(self, index):
        self.index = index

    index = None
    min_windchill = None

    def append(self, sample):
        value_temp = sample[self.index[0]]
        value_wind = sample[self.index[1]]

        if value_temp is not None and value_wind is not None :

# Path: wfcommon/meteo.py
# def StationToSensorPressure(pressureHPa, sensorElevationM,  stationElevationM, currentTempC): 
# def StationToAltimeter(PressureHPa, elevationM, algorithm = DefaultAltimeterAlgorithm):
# def StationToSeaLevelPressure(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm):
# def SensorToStationPressure(pressureHPa, sensorElevationM, stationElevationM, currentTempC):
# def SeaLevelToStationPressure(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm): 
# def PressureReductionRatio(pressureHPa, elevationM, currentTempC, meanTempC, humidity, algorithm = DefaultSLPAlgorithm): 
# def ActualVaporPressure(tempC, humidity, algorithm = DefaultVapAlgorithm):
# def SaturationVaporPressure(tempC, algorithm = DefaultVapAlgorithm): 
# def MixingRatio(pressureHPa, tempC, humidity): 
# def VirtualTempK(pressureHPa, tempC, humidity):
# def HumidityCorrection(tempC, elevationM, humidity, algorithm = DefaultVapAlgorithm):
# def DewPoint(tempC, humidity, algorithm = DefaultVapAlgorithm):
# def WindChill(tempC, windSpeedKmph):
# def HeatIndex(tempC, humidity):
# def Humidex(tempC, humidity): 
# def GeopotentialAltitude(geometricAltitudeM): 
# def FToC(value): 
# def CToF(value): 
# def CToK(value): 
# def KToC(value): 
# def FToR(value): 
# def RToF(value):
# def InToHPa(value):
# def HPaToIn(value):
# def FtToM(value):
# def MToFt(value):
# def InToMm(value): 
# def MmToIn(value): 
# def MToKm(value): # Miles !
# def KmToM(value): # Miles !
# def msToKmh(value):
# def WindX(v,d):
# def WindY(v,d):
# def WindSpeed(x,y):
# def WindDir(x,y):
# def WindDirTxt(d):
# def WindPredominantDirection(l):
# def convert_illuminance_wm2(lux):
# WIND_DIRECTIONS = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N']


# Path: wfcommon/formula/temp.py
import sys
from wfcommon import meteo

##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation, either version 3 of the License, or
##  (at your option) any later version.
##
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU General Public License for more details.
##
##  You should have received a copy of the GNU General Public License
##  along with this program.  If not, see <http://www.gnu.org/licenses/>.



class WindChillMinFormula(object):
    '''
    Minimum WindChill temperature. Requires temperature and wind speed in Km/h.
    '''

    def __init__(self, index):
        self.index = index

    index = None
    min_windchill = None

    def append(self, sample):
        value_temp = sample[self.index[0]]
        value_wind = sample[self.index[1]]

        if value_temp is not None and value_wind is not None :

            sample_windchill = meteo.WindChill(value_temp, meteo.msToKmh(value_wind))