download#

hinode.xrt.download(urls, directory=None, overwrite=False, num_retry=5)[source]#

Download the given URLs to a directory, unless they have been downloaded already.

The files are placed under directory with the same paths as on the server, and each one is checked against the length the server promised, since the archive sometimes ends a download early, and checked to be a FITS file.

Parameters:
  • urls (AbstractScalarArray) – The URLs to download.

  • directory (None | Path) – The directory to place the downloaded files in. If None (the default), hinode.directory_default is used.

  • overwrite (bool) – Boolean flag controlling whether to download files which are already in directory.

  • num_retry (int) – The number of times to try to connect to the server.

Return type:

ScalarArray

Examples

Download one of the Al_poly images captured while ESIS was observing the Sun.

import hinode

urls = hinode.xrt.urls(
    time_start="2019-09-30T18:08:30",
    time_stop="2019-09-30T18:08:40",
)

hinode.xrt.download(urls)
ScalarArray(
    ndarray=['/home/docs/.hinode/cache/hinode/xrt/level1/2019/09/30/H1800/L1_XRT20190930_180837.5.fits'],
    shape={'time': 1},
)