DataMedSci / pymchelper

Python toolkit for SHIELD-HIT12A and FLUKA
http://datamedsci.github.io/pymchelper/
14 stars 7 forks source link

Number formatting in default converter #122

Open grzanka opened 7 years ago

grzanka commented 7 years ago

Default converter is saving numbers in Fortran style which is very inefficient for large files.

If we could break compatibility with old bdo2txt, then this style could be abandoned:

nbassler commented 7 years ago

Not sure I understand what you mean. Do you mean the ASCII output from convertmc, or the binary input? I assume the first as the latter is covered elsewhere, but how can you make it more efficient and still human readable?

grzanka commented 7 years ago

I mean ASCII output. Fluka and pymchelper can write numbers as following: PRIMARIES: 0.900D+06 (Fortran style)

To get the letter D I had to use following code: https://github.com/DataMedSci/pymchelper/blob/master/pymchelper/fortranformatter.py

nbassler commented 7 years ago

maybe only retain fortran format for fluka compability, user could request this with a --format=fluka like option. Default text/ascii output may be something more convenient.