Skip to content

Commit

Permalink
teste atualização estações
Browse files Browse the repository at this point in the history
  • Loading branch information
KarinaPassos committed Oct 27, 2023
1 parent e3d068c commit cb89b2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
download,
tratar_dados,
salvar_dados,
tratar_dados_estacao,
)
from pipelines.rj_cor.meteorologia.meteorologia_redemet.schedules import hour_schedule
from pipelines.utils.decorators import Flow
Expand Down
15 changes: 7 additions & 8 deletions pipelines/rj_cor/meteorologia/meteorologia_redemet/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,16 @@ def tratar_dados_estacao(data_inicio: str, data_fim: str) -> pd.DataFrame:
# Função para converter longitude de graus, minutos, segundos para decimal
res_data["latitude"] = res_data["lat"].apply(converter_lat_lon)
res_data["longitude"] = res_data["lon"].apply(converter_lat_lon)
return dados



return res_data


def converter_lat_lon(longitude_str):
longitude_str = longitude_str.replace("º", "/").replace("''", "/").replace("'", "/")

# Divida a string com base nos espaços em branco
partes = longitude_str.split("/")
# print(partes)

# Extraia os graus, minutos e segundos da lista de partes
graus = int(partes[0])
minutos = int(partes[1])
Expand All @@ -262,5 +261,5 @@ def converter_lat_lon(longitude_str):
# Verifique se a direção é Norte (N) e retorne o valor decimal
if ("W" in partes[3].upper()) | ("S" in partes[3].upper()):
decimal = -decimal
return decimal

return decimal

0 comments on commit cb89b2c

Please sign in to comment.