[Issues] floating point format again...

Hans Vaith hav at mpe.mpg.de
Tue Jul 17 15:08:02 CEST 2007

Dear All,

this is a followup to the floating point format issue. It turns out that the 
LBCBLUE MEF FITS files actually store the CDi_j values in correct notation. 
For example:

CD1_2   =          -0.00000007 / Matrix distortion element

But the final per-chip FITS files created during the ingestion show this 

CD1_2   =                -7e-8

That is, the dot that is required as part of the FITS floating point number 
specification is missing. The problem seems to arise in the very last stage 
when eclipse.image.image.save() is called, which in turn uses 
qfits_header_dump() to write the FITS header. While the header variable on 
the python level stores the values actually as floating point numbers, the 
header structure passed to the C routine qfits_header_dump stores the values 
of the FITS header entries as character strings, so there must be some 
conversion somewhere (possibly implicit?).

In fact, using python's str() function to convert the floating point 
number -0.00000007 to string representation, one gets '-7e-8', which is 
excatly what is shown in the resulting FITS files and causes the problems 
with preastrom due to the missing dot.

What is the best way to fix this?


More information about the Issues mailing list