-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldScan
More file actions
29 lines (23 loc) · 744 Bytes
/
FieldScan
File metadata and controls
29 lines (23 loc) · 744 Bytes
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
from numpy import *
from matplotlib.pyplot import *
from os import *
def createarrays(scanfile):
#Read data in from file, columns are xpos, ypos, and centroid
data = genfromtxt(scanfile)
data = transpose(data)
xpos = data[0]
ypos = data[1]
cent = data[2]
#Create 2D arrays for the contour plot
xuniq = unique(data[0])
yuniq = unique(data[1])
xarr = zeros(size(xuniq),size(yuniq))
yarr = zeros(size(xuniq),size(yuniq))
carr = zeros(size(xuniq),size(yuniq))
#Populate arrays
for i in size(xpos):
xind = where(xuniq == xpos[i])
yind = where(yuniq == ypos[i])
xarr[xind,yind] = xpos[i]
yarr[xind,yind] = ypos[i]
carr[xind,yind] = cent[i]