Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use opendata.dwd.de to read radolan and dx data #20

Open
kmuehlbauer opened this issue Aug 3, 2018 · 0 comments
Open

use opendata.dwd.de to read radolan and dx data #20

kmuehlbauer opened this issue Aug 3, 2018 · 0 comments

Comments

@kmuehlbauer
Copy link
Member

direct access of opendata.dwd.de:

from ftplib import FTP

def open_ftp():
    host = "opendata.dwd.de"
    user = "anonymous"
    password = "anonymous"
    ftp = FTP(host)
    ftp.login(user, password)
    return ftp

def get_dirs_ftp(ftp, folder=""):
    contents = ftp.nlst(folder)
    folders = []
    for item in contents:
        if "." not in item:
            folders.append(item)
    return folders

ftp = utils.open_ftp()
ftp_dirs = utils.get_dirs_ftp(ftp, "weather/radar/composit/rx/")
filelist = ['ftp://opendata.dwd.de/' + item for item in ftp_dirs]
data, meta = self.rfunc(urlopen(self.filelist[0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant