You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I write to a new FITS file using a FITSHeader object extracted from a previously opened FITS file, the comment block
COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H
is duplicated. For example:
julia>using FITSIO
julia># Create a dummy file
julia> hdr =FITSHeader(["HELLO"], ["World"], [""]); data =rand(10,10);
julia>FITS("helloworld.fits", "w") do file
write(file, data, header=hdr)
end
shell> dfits helloworld.fits
====> file helloworld.fits (main) <====
SIMPLE = T / file does conform to FITS standard
BITPIX =-64/ number of bits per data pixel
NAXIS =2/ number of data axes
NAXIS1 =10/ length of data axis 1
NAXIS2 =10/ length of data axis 2
EXTEND = T / FITS dataset may contain extensions
COMMENT FITS (Flexible Image Transport System) format is defined in'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode:2001A&A...376..359H
HELLO ='World '
END
julia># Read in the header of the dummy file
julia> hdr2 =FITS("helloworld.fits", "r") do file
read_header(file[1])
end
SIMPLE = T / file does conform to FITS standard
BITPIX =-64/ number of bits per data pixel
NAXIS =2/ number of data axes
NAXIS1 =10/ length of data axis 1
NAXIS2 =10/ length of data axis 2
EXTEND = T / FITS dataset may contain extensions
COMMENT FITS (Flexible Image Transport System) format is defined in'AstronomCOMMENT and Astrophysics', volume 376, page 359; bibcode:2001A&A...376..359H
HELLO ='World'
julia># Write a new file with the old header
julia>FITS("helloagain.fits", "w") do file
write(file, data, header=hdr2)
end
shell> dfits helloagain.fits
====> file helloagain.fits (main) <====
SIMPLE = T / file does conform to FITS standard
BITPIX =-64/ number of bits per data pixel
NAXIS =2/ number of data axes
NAXIS1 =10/ length of data axis 1
NAXIS2 =10/ length of data axis 2
EXTEND = T / FITS dataset may contain extensions
COMMENT FITS (Flexible Image Transport System) format is defined in'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode:2001A&A...376..359H
COMMENT FITS (Flexible Image Transport System) format is defined in'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode:2001A&A...376..359H
HELLO ='World '
END
I also note that the string representation of the FITSHeader object cuts off the final "y" in the first COMMENT card.
The text was updated successfully, but these errors were encountered:
My understanding is that the problem is that the comment extends over multiple keywords. Libcfitsio.fits_write_comment calls ffpcom from CFITSIO, which, according to the documentation,
If the comment string is too long to fit on a single keyword (72 chars) then it will automatically be continued on multiple CONTINUE keywords.
When fits_write_header iterates over all keywords, it writes the multi-keyword comment multiple lines.
When I write to a new FITS file using a
FITSHeader
object extracted from a previously opened FITS file, the comment blockis duplicated. For example:
I also note that the string representation of the FITSHeader object cuts off the final "y" in the first COMMENT card.
The text was updated successfully, but these errors were encountered: