krakrjak / fits-parse

Parse FITS files for Astronomy data analysis.
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

Data.Fits.Array - multidimensional array parsing with massiv #4

Closed seanhess closed 3 months ago

seanhess commented 6 months ago

Parsing Images into multidimensional arrays with Massiv. This improves on the example I sent earlier by improving the interface, and parsing directly to an Array, rather than to a List first.

I can add some more documentation, but I wanted to see if we are on the same page first. Also, can you add me as a collaborator to your repo again? I let the link expire :) Thanks

seanhess commented 6 months ago

Hey @krakrjak any thoughts on this approach?

krakrjak commented 6 months ago

First thoughts are really positive. I haven't been able to give this a thorough look yet, but I will this evening.

seanhess commented 6 months ago

Hey @krakrjak, I've been thinking. There are many more things I need to add and refactor to satisfy the needs of my project, some of which are only tangentially related to fits parsing. This PR, adding massiv, is an opinionated choice. It's industrial strength, but harder to use for the casual haskell astronomer. I have other PRs (I'm halfway through code to write files) in the queue to submit after we get through this one. I'll need to write code to support ASDF files and WCS. There are multiple refactors I would deem necessary to support everything.

What if I start a new astronomy package that has fits-parse as a dependency instead of majorly altering what you've created here? Then we could link each package to the other in the README. I think my PRs and refactors will soon become exhausting. I would still submit any changes to the parser itself here.

What do you think?

seanhess commented 6 months ago

In other words, I'm eventually going to need to create another package to support ASDF and WCS. The question is: where is the best place to draw the line between them? Keeping fits-parse focused on parsing fits files, and adding opinionated stuff likemassiv support to another library seems like a great choice.

krakrjak commented 5 months ago

In other words, I'm eventually going to need to create another package to support ASDF and WCS. The question is: where is the best place to draw the line between them? Keeping fits-parse focused on parsing fits files, and adding opinionated stuff likemassiv support to another library seems like a great choice.

I wrote on the issue #3 that I'm not entirely sure what the "right" approach is. I do think finding a way to head in the direction of more packages, like fits-parse-massiv for instance, may just be the ticket. We can still keep it in a monorepo, but publish more packages so user can opt-in to the libraries or interfaces they want and we can keep the low-level file reading bits isolated.

That's where my head is at the moment.

seanhess commented 5 months ago

Closing this PR, let's move the discussion to #3