示例#1
0
 def calculateEto(self):
  '''Method that calculates
  the ETo given the arguments it requests
  '''
  print "You have selected Eto calculation"
  tmax = float(raw_input("Insert Tmax: "))
  
  tmin = float(raw_input("Insert Tmin: "))
  
  ea = float(raw_input("Insert Ea: "))
  
  speed= float(raw_input("Insert Air Speed: "))     
  
  monthNum= int(raw_input("Insert Month Number: "))
  
  latDeg= int(raw_input("Insert Latitude Degrees: "))
  
  latMin= int(raw_input("Insert Latitude Minutes: "))
  
  monthlyAv= float(raw_input("Insert Monthly Average Temperature: "))
  
  monthlyAvPrev= float(raw_input("Insert Previoud Monthly Average Temperature: "))
  
  alt= float(raw_input("Insert Altitude: "))
  
  sun= float(raw_input("Insert Sun Hours: "))
  
 
  p=penm(tmax,tmin,ea,speed,15,monthNum,latDeg,latMin,monthlyAv,monthlyAvPrev,alt,sun)
  print str(p.calculate())
示例#2
0
文件: etoTest.py 项目: nickapos/eto
 def testEto(self):
     """Test eto
     """
     p = penm(
         self.tMin,
         self.tMax,
         self.ea,
         self.speed,
         15,
         self.monthNum,
         self.latDeg,
         self.latMin,
         self.monthlyAv,
         self.monthlyAvPrev,
         self.alt,
         self.sun,
     )
     print "eTo calculated value:" + str(p.calculate()) + " reference value 5.72"
     self.assertAlmostEqual(round(p.calculate(), 2), 5.72, 2)