drms.ExportRequest.download

method

ExportRequest.download(self, directory, index=None, fname_from_rec=None, verbose=None)

Download data files.

By default, the server-side filenames are used as local filenames, except for export method ‘url_quick’, where the local filenames are generated from record names (see parameter fname_from_rec). In case a file with the same name already exists in the download directory, an ascending number is appended to the filename.

Note: Downloading data segments that are directories, e.g. data segments from series like “hmi.rdVflows_fd15_frame”, is currently not supported. In order to download data from series like this, you need to use the export methods ‘url-tar’ or ‘ftp-tar’ when submitting the data export request.

Parameters:
directory : string

Download directory (must already exist).

index : int, list of ints or None

Index (or indices) of the file(s) to be downloaded. If set to None (the default), all files of the export request are downloaded. Note that this parameter is ignored for export methods ‘url-tar’ and ‘ftp-tar’, where only a single tar file is available for download.

fname_from_rec : bool or None

If True, local filenames are generated from record names. If set to False, the original filenames are used. If set to None (default), local filenames are generated only for export method ‘url_quick’. Exceptions: For exports with methods ‘url-tar’ and ‘ftp-tar’, no filename will be generated. This also applies to movie files from exports with protocols ‘mpg’ or ‘mp4’, where the original filename is used locally.

verbose : bool or None

Set to True if status messages should be printed to stdout. If set to None (default), the Client.verbose flag of the associated client instance is used instead.

Returns:
result : pandas.DataFrame

DataFrame containing the record string, download URL and local location of each downloaded file (DataFrame columns: ‘record’, ‘url’ and ‘download’).