Decoding .Precpoints File

Report all good and bad behavior here
Post Reply
terryphi
Posts: 28
Joined: Sun Feb 05, 2017 5:44 am
Security question 1: No
Security question 2: 64

Decoding .Precpoints File

Post by terryphi » Thu May 24, 2018 10:56 pm

Hello,

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?

Ville Valtavirta
Posts: 418
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Decoding .Precpoints File

Post by Ville Valtavirta » Fri May 25, 2018 11:39 am

More or less,

position 8 is actually the statistical weight of the precursor.

I added a description to the wiki: http://serpent.vtt.fi/mediawiki/index.p ... oints-file

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

-Ville

terryphi
Posts: 28
Joined: Sun Feb 05, 2017 5:44 am
Security question 1: No
Security question 2: 64

Re: Decoding .Precpoints File

Post by terryphi » Sat Jun 09, 2018 1:57 am

Hi,

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. http://ttuki.vtt.fi/serpent/viewtopic.p ... ad99#p7156

Code: Select all

import struct
import csv

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

#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)
        writer.writerows(DD)


Ville Valtavirta
Posts: 418
Joined: Fri Sep 07, 2012 1:43 pm
Security question 1: No
Security question 2: 92

Re: Decoding .Precpoints File

Post by Ville Valtavirta » Tue Jun 12, 2018 10:28 am

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.

-Ville

Post Reply