decompress#

iris.data.decompress(archives, directory=None, overwrite=False)[source]#

Decompress a list of .tar.gz files.

Each .tar.gz file is decompressed and the .fits files within the archive are appended to the returned list.

Parameters:
  • archives (Sequence[Path]) – A list of .tar.gz files to decompress.

  • directory (None | Path) – A filesystem directory to place the decompressed results. If None, the directory of the .tar.gz archive will be used.

  • overwrite (bool) – If the file already exists, it will be overwritten.

Return type:

list[Path]

Examples

Download the most last “A1: QS monitoring” spectrograph file in 2023 and decompress it into a list of .fits files.

import astropy.time
import iris

# Find the URL of the .tar.gz archive
urls = iris.data.urls_hek(
    time_start=astropy.time.Time("2023-01-01T00:00"),
    time_stop=astropy.time.Time("2024-01-01T00:00"),
    description="A1: QS monitoring",
    limit=1,
    sji=False,
)

# Download the .tar.gz archive
archives = iris.data.download(urls)

# Decompress the .tar.gz archive into a list of fits files
iris.data.decompress(archives)
[PosixPath('/home/docs/.iris/cache/iris_l2_20231231_070352_3882010194_raster/iris_l2_20231231_070352_3882010194_raster_t000_r00000.fits')]