JuliaAstro / FITSIO.jl

Flexible Image Transport System (FITS) file support for Julia
http://juliaastro.org/FITSIO.jl/
MIT License
55 stars 29 forks source link

Conversion between FITSHeader and String #115

Open aquatiko opened 5 years ago

aquatiko commented 5 years ago

How can we convert a FITSHeader in a String format and vice-versa? It would be great to modify a Header by making a WCSTransform object, making the changes and then saving that to original FITS file. Using to_header from WCS.jl, we can get the header in string format but how can I write that to a FITSHeader?

giordano commented 5 years ago

Rather than converting a FITSHeader to a String, I think it could be useful a function that constructs a WCSTransform from the relevant keys of a FITSHeader. This function would live in WCS.jl, which however doesn't currently depend on FITSIO.jl

aquatiko commented 5 years ago

Do you mean, supplying specific fields present in WCS Header to a function along with a FITSHeader object? I think that would be a easier workaround as we can use setproperty!() of WCS.jl and pass a symbol to set those fields to some empty initialised WCSTransform object.

giordano commented 5 years ago

The FITSHeader looks like a dictionary, I was thinking to

However, this is a high-level functionality that it's not even clear where it should live (see my message above), I think this is a very low-priority issue, even though an interesting one.