Closed bjet007 closed 4 years ago
Hi,
I'm trying to generate a fits file float64 value in the header. Since most of my values are small number with a lot of precision, decimal get truncated because of the way the float64 get printed in the document using %20f.
%20f
Looking at the specification (https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf), the limitation is on the number of bytes used, so I was expecting that I get the same value that I've specified in my go program.
Is it possible that the writer should use %20g instead of %20f so that value don't lose precision if value fit within the length of the spec.
%20g
I've create a small sample here to show the behaviour https://play.golang.org/p/oqFmTQBeNOD
hi,
thanks for the report (and your interest in astrogo). your suggestion sounds good to me.
do you want to send a PR fixing this oversight?
fixed w #57.
Hi,
I'm trying to generate a fits file float64 value in the header. Since most of my values are small number with a lot of precision, decimal get truncated because of the way the float64 get printed in the document using
%20f
.Looking at the specification (https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf), the limitation is on the number of bytes used, so I was expecting that I get the same value that I've specified in my go program.
Is it possible that the writer should use
%20g
instead of%20f
so that value don't lose precision if value fit within the length of the spec.I've create a small sample here to show the behaviour https://play.golang.org/p/oqFmTQBeNOD