Skip to content

ENH: add lzma (.xz) support to io.fits  #9714

Closed

Description

@dhomeier

Description

Loosely related to #9652 and #9685, is there a specific reason why io.fits does not support lzma compression? From the way .xz files are handled in data.py it looks like it could be implemented quite analogously in the FITS file handlers, but of course it would involve somewhat more significant modifications.

Activity

  1. saimn commented on Dec 10, 2019

    @saimn
    Contributor

    Not specific reason I think, it is probably just less frequently used and nobody needed it.

  2. ivvv commented on May 22, 2024

    @ivvv

    One attractive feature is that the xz allows multi-threading compression/decompression, which is useful with huge FITS files.

  3. dhomeier commented on May 22, 2024

    @dhomeier
    ContributorAuthor

    Right. Though in most such cases the tiled compression capacity of CompImageHDU would probably be the better choice now, linking this to #15474.

  4. saimn commented on May 28, 2024

    @saimn
    Contributor

    xz/lzma is available through python's stdlib (https://docs.python.org/3/library/lzma.html) so adding support should be straightforward.

  5. pllim commented on May 28, 2024

    @pllim
    Member

    Is this one of those libs that not always there? Might complicate logic a little but not a blocker.

  6. neutrinoceros commented on May 28, 2024

    @neutrinoceros
    Contributor

    Correct. We have a couple use cases for HAS_LZMA already

  7. dhomeier commented on May 28, 2024

    @dhomeier
    ContributorAuthor

    And we already have an equivalent setup for HAS_BZ2

  8. kYwzor commented on Apr 1, 2025

    @kYwzor
    Member

    Came across this while working on #17960. Not sure how common these actually are, but the code necessary for this is so simple I just created a PR. I could find at least one instance of "fits.xz" files in the wild, so there are real use-cases (if rare).

    EDIT: Found another example file here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions