Re: [fluka-discuss]: Post processing USRBIN file (*.bnn format)

From: <>
Date: Thu, 23 Oct 2014 12:51:13 -0700 (PDT)

Dear Rafiq,

bnn is binary. If you'd like to do it the brute-force way, use MATLAB fread.

The easy way is to convert bnn to ascii, under FLAIR>Run>Files>data then
right-click on the bnn file and select 'To ascii'. Thereafter, use MATLAB
fscanf, fgets, fgetl or ...

An alternative to the 'To ascii' function would be just to take the dat file,
assuming you plotted with FLAIR.

The lazyman's way is: manually edit the ascii file by removing the header lines.
Thereafter, use MATLAB load. This way, you won't even need to worry about bytes
and fields. You won't even need to open and close the file.

MATLAB or PYTHON or PERL the algorithm would be similar (with the exception that
MATLAB's load condenses all the steps in to one):
open the file
read each line, split according to the spaces or fields or bytes
arrange the numbers into an array
close the file

:) mary

> On 23 October 2014 at 11:32 Mohammad Islam <> wrote:
> Dear Users,
> Does anybody know how to read the *.bnn file that comes from USRBIN
> using MATLAB or any other language. I tried to read it through MATLAB
> but it did not give me the data I was looking for. I need to do some
> post processing of the deposited energy which is in number of binary
> files. FLAIR can read and plot it and also save it as *.dat file but I
> have so many files that a little bit coding would be helpful. I
> appreciate any help.
> Thanks
> Rafiq
Received on Thu Oct 23 2014 - 23:12:32 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 23 2014 - 23:12:33 CEST