#!/usr/bin/python
# -*- coding: cp1252 -*-
from numpy import *
from math import *
f=open("teste.dat")
posicao=f.readline().split()
print posicao
lat=posicao[0]
lon=posicao[1]
u=[];v=[];ano=[];mes=[];dia=[];hora=[];vel=[];dir=[]
for linha in f.readlines():
    ano.append(int(linha.split()[0].replace(".","")))
    mes.append(int(linha.split()[1].replace(".","")))
    dia.append(int(linha.split()[2].replace(".","")))
    hora.append(int(linha.split()[3].replace(".","")))
    u.append(float(linha.split()[4]))
    v.append(float(linha.split()[5]))

u=array(u)
v=array(v)
vel=(u**2+v**2)**1/2
dir=arctan2(-u,-v)*(180/pi)



fileout=open("vento.txt",'w')

for i in range(0,size(vel)):
    if dir[i] < 0 : dir[i] = dir[i] + 360
    fileout.write("Velocidade: %4.1fnós - Direcao: %3.0f°\n" %(vel[i],dir[i]))

fileout.close()

