forked from vecoveco/gpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpcc_download_dpr.py
More file actions
73 lines (40 loc) · 1.65 KB
/
Copy pathpcc_download_dpr.py
File metadata and controls
73 lines (40 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""
-----------------------------------------------
Program zum Downloaden von GPM Daten vom Server
-----------------------------------------------
"""
from pcc import melde_dich
import ftplib
from datetime import date, timedelta as td
import pandas as pd
meinftp = ftplib.FTP("arthurhou.pps.eosdis.nasa.gov")
meinftp.login("bregovic@gmx.de","bregovic@gmx.de")
a = pd.read_csv('/automount/ags/velibor/text/overpass_dpr_radolan.csv', sep=',')
overpass_zeiten = a[[0]].values
#zum auslasten 0,500; 500,1000; 1000,1500
for i in range(len(overpass_zeiten)-1):
overpass_datum = overpass_zeiten[i][0][0:8]
dpr_overpass = '2A.GPM.DPR.V7-20170308.' +overpass_zeiten[i][0][:-7]+'5A.HDF5'
print overpass_zeiten[i][0][:-7]+'5A.HDF5'
print dpr_overpass
# DPR gibt es erst ab 2014/03/09
directory = '/gpmdata/'+ str(overpass_datum[0:4]) + '/' + str(overpass_datum[4:6]) + '/' + str(overpass_datum[6:8]) +'/radar/'
meinftp.cwd(directory)
# Mein Verzeichniss
directory_local = '/automount/ags/velibor/gpmdata/dprV7/'
#meinftp.retrlines('LIST')
daten=[] #Initialisierung einer Liste (leere Liste)
meinftp.dir(daten.append)
print
print 'Ort und Name der lokalen Datei: ' + directory_local + dpr_overpass
print
file = open(directory_local+dpr_overpass, 'wb')
print 'Download: ftp-Server: ' + directory +dpr_overpass
meinftp.retrbinary('RETR '+dpr_overpass, file.write)
print
print 'Die lokale Datei ' + directory_local+dpr_overpass +' wird geschlossen.'
file.close()
print meinftp.quit()
print
print 'Die FTP-Verbindung wurde von mir getrennt.'
melde_dich('Das Program ist fertig!')