download_files

ndmapper.services.download_files(filenames, server, dirname='')[source] [edit on github]

Download a list of files from the specified server, skipping any that already exist in the target directory.

User authentication is not supported yet (ie. can’t get proprietary data).

Parameters:

filenames : list of (convertible to str) or str or calibration dict

The names of the files to request from the server. If a calibration dictionary (in the format produced by calibrations.init_cal_dict()) is supplied, all the raw calibration files listed in it will be downloaded.

server : str, function

Name of the service to be used for the look-up (which determines the back-end function selected from this library). The currently-available options are: ‘gemini’ (default). Alternatively, the user may supply a look-up function/object, which must accept a list of filename strings and a directory name as arguments (and should implement skipping existing files if needed).

dirname : str, optional

Writeable directory in which to place the files. This path may be absolute or relative to the current directory. If it doesn’t exist, it will be created.

Returns:

list of str

A list of the file(s) downloaded, for syntactical convenience, eg. allowing “DataFileList(download_files(some_list, server=’gemini’))”. This is just a copy of the input name string(s) that are derived from filenames, prefixed with dirname.