CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
68 stars 68 forks source link

Real notation for numbers in the output #332

Closed authule closed 3 years ago

authule commented 3 years ago

Dear developers,

After asking the support staff to install the latest release (version 3.1.7), I realized that all the numbers are output in the scientific form, i.e. 8.29707E+18, etc. Previously I used the 3.1 version and got the output in real notation, which is preferrable for my task. Let me cite the reply from the helpdesk describing the installation process:

it may be connected to python3 or downloaded data in dir /net/software/local/crpropa/3.1.7/share/crpropa which is all in scientific notation now (in version 3.1 the data was in real notation if possible). I've tried to install version 3.1 for python3 or version 3.1.7 for python2, but it all fails. I also install version 3.1.7 on local python 3.9 and it also print numbers in scientific notation.

Are we missing something? Could you please suggest the way to get the output in real numbers, avoiding the scientific notation?

Thanks in advance, Alex

adundovi commented 3 years ago

Hi Alex,

to be honest, I never check the format of numbers as long as they are correct. I don't recall that we lately change something regarding the output notation, but maybe I'm wrong. Nevertheless, I don't know how can you store a really big or a really small number in a file without the exponent, e.g. 1e-28? In the decimal notation, you would waste more than 20 characters. It could be that you used different units before (for example joules instead of eV, or pc instead of metres). If you use Python for reading the output, there is always a possibility to convert numbers in any format you desire (i.e. float() and format), but if rounding is involved, you could lose valuable information.

Cheers,

Andrej

authule commented 3 years ago

Hi Andrej,

Thanks for your quick response.

It could be that you used different units before (for example joules instead of eV, or pc instead of metres).

I am afraid this is not the case, because I used the same steering card (changing only the deprecated modules for Turbulent field and Observer surface for the correspondent ones), and compared the results for 3.1 and 3.1.7 versions.

if rounding is involved, you could lose valuable information. This is the very problem I am trying to avoid.

Cheers, Alex

lukasmerten commented 3 years ago

Hi Oleksandr @authule I am not sure how we can help with your issue at the moment. We will not switch to a non-scientific output for the reasons Andrej (@adundovi) brought up. When you need more significant digits to be stored you can update, e.g., your TextOutput.txt. Please reopen this or open a new issue if there is anything specific you want to add.