vrruiz / xisfits

Convert images from XISF to FITS
MIT License
8 stars 0 forks source link

Optimized header reading #18

Closed Razican closed 4 years ago

Razican commented 4 years ago

This uses quick_xml for a much faster reading of the XML header. There is still room for improvement, and that's why I'm placing this as a draft PR.

This also changes the following:

Improvements to be done:

Note that there seems to be an ignored test with LZ4 compression.

vrruiz commented 4 years ago

Awesome! I'll take a look ASAP. Your list of improvents looks like a TODO list to me :)

I'll also take a look to the missing files.

vrruiz commented 4 years ago

The files are no longer missing. But there is a conflict now with src/xisfreader.rs

Razican commented 4 years ago

The conflict was due to "geometry" parsing being done in a different function. For now, I have just rebased the code, which should pass the tests. I will be reviewing how to simplify the code next.

Razican commented 4 years ago

I added some more optimizations. Most relevant is the inclusion of the XISFile structure, that contains the data, header and keywords in the same place, and the substitution of the type strings by an enumeration (#6).

I do have one question, though. When reading the geometry, it's prepared to read something like xxx:yyy:zzz. Is there a case where something like this could exist? uuu:vvv:xxx:yyy:zzz?

vrruiz commented 4 years ago

FITS, and thus XISF, is dynamic, so it can store basically anything. Specifically, XISF attribute is multidimensional: «geometry="dim1:...:dimN:channel-count"». However, PixInsight (the program) only works with regular images, so I cared most about common use and not corner cases.