File .bnn conversion to ASCII

Dear Marta,

thank you for your welcome. One question for you, should you happen to know; when you hit “To ASCII” in flair - does it internally translate .bnn to .dat OR it calls some external program to do that?

-s

It calls bin/usbrea to do that, as you can read in the Flair’s Output tab

First of all, I apologize for hijacking previous thread with the follow-up question, could have open a new myself. Secondly, let me clarify my confusion - it seems there are two types of formatted output. One is given with Flairs “To ASCII” button that utilizes usbrea and output looks like this:

1
R - Z binning n. 1 "1-DOSE " , generalized particle n. 228
R coordinate: from 0.0000E+00 to 1.5000E+00 cm, 1 bins ( 1.5000E+00 cm wide)
Z coordinate: from 0.0000E+00 to 4.0000E+01 cm, 800 bins ( 5.0000E-02 cm wide)
axis coordinates: X = 0.0000E+00, Y = 0.0000E+00 cm
Data follow in a matrix A(ir,iz), format (1(5x,1p,10(1x,e11.4)))

  accurate deposition along the tracks requested
  this is a track-length binning
   6.0000E-04  6.0182E-04  6.0316E-04  6.0472E-04  6.0532E-04  6.0605E-04  6.0682E-04  6.0703E-04  6.0796E-04  6.2160E-04
   etc...

Second type of formatted output is created after plotting with flair, it usually has name .dat extension and it looks like this:

# Detector n: 1D Projection
0.0000000000E+00 5.0000000000E-02 5.99998E-04 4.24710E-02
5.0000000000E-02 1.0000000000E-01 6.01821E-04 6.25217E-02
1.0000000000E-01 1.5000000000E-01 6.03160E-04 5.53367E-02
1.5000000000E-01 2.0000000000E-01 6.04723E-04 4.44643E-02
2.0000000000E-01 2.5000000000E-01 6.05324E-04 8.41242E-02
2.5000000000E-01 3.0000000000E-01 6.06045E-04 2.50633E-02

I have inspected output and it seems that programs gnuplot or gplevbin could be creators of second formatted output. Could someone shed some light on that?

The first type of file, i.e.:

1
R - Z binning n. 1 "1-DOSE " , generalized particle n. 228
R coordinate: from 0.0000E+00 to 1.5000E+00 cm, 1 bins ( 1.5000E+00 cm wide)
Z coordinate: from 0.0000E+00 to 4.0000E+01 cm, 800 bins ( 5.0000E-02 cm wide)
axis coordinates: X = 0.0000E+00, Y = 0.0000E+00 cm
Data follow in a matrix A(ir,iz), format (1(5x,1p,10(1x,e11.4)))

Is generated either:
1-when in the USRBIN card you select ASCII as output
or
2-when you convert the binary output into ASCII

The binary to ASCII conversion is done by the usbrea Fortran program which is distributed alongside Fluka (have a look in the Fluka installation directory in the subfolder src/tools/ ).
usbrea is invoked by Flair via the “To ASCII” button.
usbrea can also be run manually from the command line.

The second typo of file, i.e.:

   # Detector n: 1D Projection
   0.0000000000E+00 5.0000000000E-02 5.99998E-04 4.24710E-02
   5.0000000000E-02 1.0000000000E-01 6.01821E-04 6.25217E-02
   1.0000000000E-01 1.5000000000E-01 6.03160E-04 5.53367E-02
   1.5000000000E-01 2.0000000000E-01 6.04723E-04 4.44643E-02

is generated by flair starting from the binary file and has this format so that it can be read by gnuplot when making plots.
Depending on the details you choose for your plot (e.g. bin range, 1-D Max, projection, etc.), the content of the .dat file might be different from the other file.

and indeed the second formatted output is generated by Flair by invoking the gplevbin utility, as you can always read in the Flair’s Output tab

@ceruttif @amario Crystal clear. Thanks for putting up with newbie questions.