Translations:Dimensionner et faire un tracker solaire photovolatïque low tech/233/en

  1. dict_angle_rotation= sun_degre_azimut:motoractivationtime

dict_angle_verin={1:0,

               2:0,
               3:0,
               4:0,
               5:0,
               6:0,
               7:0,
               8:0,
               9:0,
               10:0,
               11:1,
               12:1,
               13:2,
               14:3,
               15:4,
               16:5,
               17:6,
               18:7,
               19:8,
               20:9,
               21:10,
               22:11,
               23:12,
               24:13,
               25:14,
               26:15,
               27:16,
               28:16,
               29:17,
               30:18,
               31:19,
               32:20,
               33:21,
               34:22,
               35:23,
               36:24,
               37:25,
               38:27,
               39:28,
               40:29,
               41:30,
               42:32,
               43:33,
               44:34,
               45:35,
               46:37,
               47:38,
               48:39,
               49:41,
               50:42,
               51:44,
               52:45,
               53:47,
               54:48,
               55:50,
               56:51,
               57:52,
               58:54,
               59:56,
               60:58,
               61:59,
               62:59,
               63:59,
               64:60,
               65:63,
               66:64,
               67:65,
               68:66,
               69:68,
               70:68,
               71:71,
               72:73,
               73:75,
               74:77,
               75:79,
               76:81,
               77:82,
               78:83,
               79:85,
               80:86,
               81:87,
               82:89,
               83:91,
               84:94,
               85:96,
               86:98,
               87:100}

dict_angle_rotation={

               0:41,
               1:42,
               2:43,
               3:44,
               4:45,
               5:46,
               6:47,
               7:48,
               8:49,
               9:50,
               10:52,
               11:53,
               12:54,
               13:55,
               14:56,
               15:57,
               16:58,
               17:59,
               18:60,
               19:61,
               20:63,
               21:64,
               22:65,
               23:66,
               24:67,
               25:68,
               26:69,
               27:70,
               28:71,
               29:72,
               30:73,
               31:75,
               32:76,
               33:77,
               34:78,
               35:79,
               36:82,
               37:82,
               38:82,
               39:82,
               40:82,
               41:82,
               42:82,
               43:82,
               44:82,
               45:82,
               46:82,
               47:82,
               -1:39,
               -2:37,
               -3:35,
               -4:33,
               -5:32,
               -6:30,
               -7:29,
               -8:27,
               -9:26,
               -10:25,
               -11:23,
               -12:22,
               -13:19,
               -14:18,
               -15:17,
               -16:16,
               -17:15,
               -18:14,
               -19:6,
               -20:2,
               -21:1,
               -22:0,
               }

def sun_position(time_now,lat,lon):

   now_here = ephem.Observer()
   now_here.lat = lat
   now_here.lon = lon
   #PyEphem only processes and returns dates that are in Universal Time (UT), which is simliar to Standard Time in Greenwich, England, on the Earth's Prime Meridian
   # Europe/Paris is GMT+2
   utc_now=datetime.datetime.utcnow()
   #is_dst=datetime.datetime(year=utc_now.year,month=utc_now.month,day=utc_now.day).dst()
   #time_diff=datetime.timedelta(hours=(1 if not is_dst else 2))
   now_here.date = time_now #+datetime.timedelta(hours=time_diff) #'2007/10/02 00:50:22'
   sun.compute(now_here)
   sun_degre_azimut=int(sun.az*180/3.141592653589793)
   sun_degre_horizontal=int(sun.alt*180/3.141592653589793)
   return(sun_degre_horizontal,sun_degre_azimut)