Dear FLUKA experts,
I have two bnn, one measuring LET*dose (bnn1) and one measuring dose(bnn2). Is it possible to do such a division in FLUKA, bnn1/bnn2 to get LETd?
Thank you!
Hi,
Yes, see this flair file where I do exactly that.
Run âTestAddUsrbinâ, process data, and plot âphotonâ and âneutronâ.
Then plot âAdd_photon_neutronâ.
Add_USRBIN.flair (2.9 KB)
I did that, but didnât get the result of dividing the two bnnâsďź
What I do:
1.Run âTestAddUsrbinâ, process data
2.plot âphotonâ and âneutronâ, get two file .dat
3.Then plot âAdd_photon_neutronâ
You modified my Add_photon_neutron
plot by inlcuding 1D projections. Remove those.
Once you have plotted neutron and photon, FLAIR creates two .dat files, in this case neutron.dat and photon.dat, in the directory. Now just click plot in the Add_photon_neutron
and you will see this plot.
The commands in the Add_photon_neutron
are all meant for gnuplot and can be executed from a gnuplot command line to get the same results, like this.
I chose to include it in the FLAIR file because FLAIR calls gnuplot and executes those commands for you, It is easier that way. Whatever commands are included in the lower window are all meant for gnuplot. You can use this space to inlcude text (see label command in gnuplot for example) in a normal flair plot, say in the neutron.dat The last line
splot '<paste photon.dat neutron.dat' us 1:2:($3/$7) notitle ,'neutron.geo.dat' ind 0 us 5:3:(0.) w l ls 1 notit
is where the division happens using the previously created neutron.dat and photon.dat. You must replot the Add_photon_neutron
if you change any parameters in those two initial plots.
You can manipulate the two plots in other ways. For example, you can multiply one with some number and the other with another number (for example different normalizations) and add, subtract, divide etc. And be careful to avoid division by zero. The same technique can also be used to propogate the errors to create a 2D error plot.
Thank you very much for your reply! But this only gives a 2D result. I want to get a 3D result after dividing two dose bnn.(x,y,z). And then can the result of this division be exported from FLUKA? Just like a .bnn file which contains the values.
If all you want to divide the data files and get an output data file, you need to write a script. It might be easier to convert the bnn files to ASCII using the âto asciiâ option in flair to get a lis file.
Then, a google search will give you several ways to do this, say using bash (awk is awesome), python or Fortran. If you open the .lis file you can see the fortran format to rerad the files
Data follow in a matrix A(ix,iy,iz), format (1(5x,1p,10(1x,e11.4)))
At this point, if you want to use the results as a sosurce file, the newly created file can be read using the new source.f file.
There may be other ways to do this part, but I will let the FLUKA team respond once they are back from the holidays.
Dear @zcao23,
You can perform USRBIN division via meshtk
tool located inside Flairâs geoviewer sub-package.
It allows basic arithmetic operations with two USRBIN files, including separate normalization for each.
Type meshtk -h
for more information and examples.
Be aware that this tool is still in development, I recommend downloading the latest beta version of the geoviewer (and Flair) as it may contain some important fixes.
Happy New Year,
Volodymyr
Thank you very much for your reply! I myself have converted two .bnn files to dicom format in FLUKA, and then written a python script to read the values in the two dicoms and divide them. I was wondering if there was an easy way do the division in FLUKA, so I posed the question here.
Thank you so much for your reply! I get it!