uvex_transients.surveys.footprints.utils.download_file_cached#

uvex_transients.surveys.footprints.utils.download_file_cached(url: str, cache: bool = True, show_progress: bool = True) → Path[source]#

Download a file, reusing astropy’s on-disk cache when possible.

This is the same cache uvex_transients.dust.dust_map uses. The cached path does not keep the URL’s filename or extension.

Astropy verifies TLS against certifi’s CA bundle when it is installed. If that fails certificate verification (e.g. a root that a newer certifi has dropped but the operating system still trusts, as with the Stanford host serving the Rubin scheduler data), the download is retried once against the system CA store. Verification is never disabled.

Parameters:
  • url (str) – HTTP/HTTPS URL of the file.

  • cache (bool, optional) – Whether to read from and write to astropy’s download cache. Default True.

  • show_progress (bool, optional) – Whether to show a progress bar while downloading. Default True.

Returns:

Local path to the (cached) file.

Return type:

pathlib.Path