-
Notifications
You must be signed in to change notification settings - Fork 0
/
isosumtest.py
88 lines (37 loc) · 2.02 KB
/
isosumtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# isotopics
from __future__ import division
import matplotlib.cm as cm
import csv
import matplotlib.pyplot as plt
import numpy as np
import copy
import time
import pickle
# new mod for simulations of spring 2013
def TestMapper(n,p,case):
"""
converts the XSsection number into a radial and azimuthal coordinate.
r=0 means inner part, r=2 ouurt and r=1 middle
a followes the logic pointed out at programmers guide p 25
for the decart high fidelity cases r gors down from 29 to 0
"""
if case==3:
r= -((n-1)//16-5)
a=[(n-1)%16]
if case==30:
r=-((n-1)//16-32)
a=[(n-1)%16]
return r,a
file1=['D:\\powertables\\new\\0\\iso_0_0500.isosum']
for i in range(len(file1)):
f=open(file1[i], 'rb')
f.next()
reader = csv.reader(f,delimiter=' ', quotechar='"',quoting=csv.QUOTE_NONE, skipinitialspace=True)
for row in reader:
if reader.line_num%3000==0:
print 'PLN, XSR, r, a, Line, IsoID,concentration, IsoID,concentration'
if len(row)==7:
p=int(row[1])-2 #plane. first value in the isosum file is 2, so i gauge to 0
r,a=TestMapper(int(row[3][:-1]),p,30)
print '{0:3},{1:4},{2:2},{3:9},{4:7},'.format(p,int(row[3][:-1]),r,a, reader.line_num)
print '\n\n\n\n'