votable providing null string value, zeros getting chopped off
See original GitHub issueHi,
My colleague (@rjavila) has run into what might be a bug with the votable package… I’ve tried to track it down but I kind of ended up going in circles…
He’s setting up a votable column (actually multiple, but all have the same problem) and adding the values info as follows:
f160w_mag = tree.Field(myvotable,name='F160W',datatype='double',ucd='phot.mag;em.IR.H',unit='mag',width='6',precision='3')
f160w_mag.values = tree.Values(myvotable, f160w_mag,null='-99.000')
The problem is when he then writes out the votable to an xml file the .000 get’s chopped off to .0:
<FIELD ID="f160w_mag" datatype="double" name="f160w_mag" precision="3" ucd="phot.mag;em.IR.H" unit="mag" width="6"> <VALUES null="-99.0"/>
It seems like it might be an issue of python rounding, assuming it gets converted from string->double->string (not sure if that’s happening here)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Offline discussions came to the conclusion that Astropy is not the cause of the bug.
Just for the record, the data type is set as double, so null is converted to double. It is deliberately done in the code and does not appear to be a bug. @rjavila is going to investigate how the comparison is being done on his side.