gnome.utilities.remote_data

Download data from remote server

Module Contents

Functions

get_datafile(filename)

Looks to see if filename exists in local directory. If it exists,

Attributes

data_server

CHUNKSIZE

gnome.utilities.remote_data.data_server = 'https://gnome.orr.noaa.gov/py_gnome_testdata/'
gnome.utilities.remote_data.CHUNKSIZE
gnome.utilities.remote_data.get_datafile(filename)

Looks to see if filename exists in local directory. If it exists, then it simply returns the ‘filename’ back as a string.

If ‘filename’ does not exist in the local filesystem, then it tries to download it from the gnome server (http://gnome.orr.noaa.gov/py_gnome_testdata). If it successfully downloads the file, it puts it in the user specified path given in filename and returns the ‘filename’ string.

If file is not found or server is down, it re-throws the HTTPError raised by urllib

Parameters:

filename (string) – path to the file including filename

Exception:

raises HTTPError if server is down or file not found on server

Returns:

returns the string ‘filename’ once it has been downloaded to user specified location