diff --git a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h index 60bb8671a4e6c44f252e1c2db282c3096d677647..bb872541daa08f94159387a220a5861f427a1e4d 100644 --- a/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h +++ b/Code/Mantid/Framework/ICat/inc/MantidICat/CatalogDownloadDataFiles.h @@ -52,9 +52,8 @@ namespace Mantid ~CatalogDownloadDataFiles(){} /// Algorithm's name for identification overriding a virtual method virtual const std::string name() const { return "CatalogDownloadDataFiles"; } - ///Summary of algorithms purpose - virtual const std::string summary() const {return "Downloads the given data files from the data server";} - + /// Summary of algorithms purpose. + virtual const std::string summary() const { return "Downloads datafiles from the archives based on the ID of a datafile."; } /// Algorithm's version for identification overriding a virtual method virtual int version() const { return 1; } /// Algorithm's category for identification overriding a virtual method @@ -69,7 +68,6 @@ namespace Mantid std::string testDownload(const std::string& URL,const std::string& fileName); private: - /// Overwrites Algorithm method. void init(); /// Overwrites Algorithm method diff --git a/Code/Mantid/docs/source/algorithms/CatalogDownloadDataFiles-v1.rst b/Code/Mantid/docs/source/algorithms/CatalogDownloadDataFiles-v1.rst index 2ec4c0387cceb265d12021aabb6ddb994e899b76..d00809997b6ab555d213f51372c4d71ef2d77f4b 100644 --- a/Code/Mantid/docs/source/algorithms/CatalogDownloadDataFiles-v1.rst +++ b/Code/Mantid/docs/source/algorithms/CatalogDownloadDataFiles-v1.rst @@ -9,8 +9,52 @@ Description ----------- -This algorithm gets the location strings for the selected files from the -data archive; if the data archive is not accessible, it downloads the -files from the data server. +This algorithm downloads a datafile or multiple datafiles based on the given ID of a datafile in an investigation. It first checks if the file can be downloaded from the data archives (based on information in the config file Facilities.xml) and downloads the file from there. Otherwise, the file is downloaded over HTTPS. + +The datafile ID to use to download a datafile can be obtained from :ref:`CatalogGetDataFiles <algm-CatalogGetDataFiles>`. + +Usage +----- + +**Example - downloading a single datafile from ICAT.** + +.. code:: python + + # Assuming you have previously logged into the catalog + # and stored the session return value in the variable 'session' + CatalogDownloadDataFiles(FileIds = '33127010', # Which file to find? + FileNames = '33127010.nxs', # What to name it? + DownloadPath = '~/Desktop', # Where to save it? + Session = session.getPropertyValue("Session") # Which session to use? + ) + +Output: + +.. code:: python + + # Outputs a list locations of the datafiles downloaded. + # USERNAME will be your username on your system. + ['/home/USERNAME/Desktop/33127010.nxs'] + +**Example - downloading multiple datafiles from ICAT.** + +.. code:: python + + # The ids of the datafiles to download. + # These could be obtained from CatalogGetDataFiles or entered manually. + datafile_ids = [33127010, 33127011] + + # This option will not append any file extensions to the datafiles. + CatalogDownloadDataFiles(FileIds = datafile_ids, # We now pass our list of ids here + FileNames = datafile_ids, # and also here. + DownloadPath = '~/Desktop', + Session = session.getPropertyValue("Session") + ) + +Output: + +.. code:: python + + ['/home/USERNAME/Desktop/33127010.nxs', '/home/USERNAME/Desktop/33127011.nxs'] .. categories::