load¶
-
heliopy.data.util.
load
(filename, local_dir, remote_url, try_download=True, remote_error=False)¶ Try to load a file from local_dir.
If file doesn’t exist locally, try to download from remtote_url instead.
- Parameters
filename (string) – Name of file
local_dir (string) – Local location of file
remote_url (string) – Remote location of file
try_download (bool) – If a file isn’t available locally, try to downloaded it. Default is True.
remote_error (bool) – If
True
, raise an error if the requested file isn’t present locally or remotely. IfFalse
, the method returnsNone
if the file can’t be found.
- Returns
file – If filename ends in .cdf the CDF file will be opened and returned.
Otherwise it is assumed that the file is an ascii file, and filename will be opened using python’s
open()
method.If the file can’t be found locally or remotely, and remote_errror is
False
,None
is returned.- Return type
CDF, open file, None