Page 1 of 1

Decoding .Precpoints File

Posted: Thu May 24, 2018 10:56 pm
by terryphi

I'm decoding the .Precpoints file.

I see from the documentation, each precusor is 72 bytes.
The 72 bytes are comprised of 9 doubles.

It looks like the first 3 are the XYZ coordinates.

position 4 is either a 1 or 0.

position 5 and 6 are always 0.

position 7 is always 1

position 8 is always 0

position 9 is an integer in [0,7]

The 'iGroup' in the .prec file is in [0,7], so I assume position 9 is the precursor group.

Is this right?

Re: Decoding .Precpoints File

Posted: Fri May 25, 2018 11:39 am
by Ville Valtavirta
More or less,

position 8 is actually the statistical weight of the precursor.

I added a description to the wiki: ... oints-file

With this information you should be able to write your own .precpoints files if you want to.


Re: Decoding .Precpoints File

Posted: Sat Jun 09, 2018 1:57 am
by terryphi

I did this again, and Now I'm getting non-1 values in position 7.
Looks like now it's a float between ~2.3E-8 and 8.65.

It looks like the same thing happened last time I was working on this. ... ad99#p7156

Code: Select all

import struct
import csv

with open('./source.precpoints','rb') as f:
    rawData =

#each chunk is 72 bytes long
chunks = [rawData[x:x+72] for x in range(0,len(rawData),72)]

#each chunk is comprised of 9 doubles
## DD -> decoded data.
DD = [struct.unpack('d'*9,c) for c in chunks]

with open('precData.csv','w') as csvF:
        writer = csv.writer(csvF)

Re: Decoding .Precpoints File

Posted: Tue Jun 12, 2018 10:28 am
by Ville Valtavirta
Let's see,

on a further inspection. Criticality source simulations uses position 7 to write the energy of the neutron that produced the precursor, while transient simulations simply put 1.0. Does that concur with your findings?

Even so, incoming energies of -2.3E-8 MeV sound a bit suspicious.

In any case, the only values that are actually used from the data are the position (x,y,z), the statistical weight and the precursor group.