-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsizeopt.py
More file actions
55 lines (43 loc) · 1.36 KB
/
sizeopt.py
File metadata and controls
55 lines (43 loc) · 1.36 KB
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
from telopt import *
#
# Radius=1/2 FWZ ~ FWHM
#
ts=TelSources()
rmax=40.08
nsources=6
ntrials=10
nsizesmax=14
saverandom=numpy.zeros(nsizesmax)
saveboolardy=numpy.zeros(nsizesmax)
sizes=numpy.zeros(nsizesmax)
tuv=TelUV()
for isize in range(nsizesmax):
size=20.0+5.0*isize
rmax=50*35.0/size
sizes[isize]=size
lowrand=TelArray()
lowrand.circles('LOW_CIRCLE_diameter=%d' % size, nstations=46, nhalo=46, rhalo=40.0)
lowrand.shakehalo(rshake=5.0)
lowrand.plot(rmax=40.0)
lowboolardy=TelArray()
lowboolardy.readKML('Boolardy_diameter=%d' % size, 'boolardyhandedit.kml')
lowboolardy.plot(rmax=40.0)
tp=TelPiercings()
random.seed(781490893)
ts.construct(nsources=int(nsources*(35.0/size)*(35.0/size)), radius=3.0/size)
for trial in range(ntrials):
tp.construct(ts,lowrand,hiono=300,rmin=2.0)
if trial==0:
tp.plot(rmax=rmax)
saverandom[isize]=max(saverandom[isize],tp.assess(nnoll=100, rmax=rmax, doplot=(trial==0)))
tp.construct(ts,lowboolardy,hiono=300,rmin=2.0)
if trial==0:
tp.plot(rmax=rmax)
saveboolardy[isize]=max(saveboolardy[isize],tp.assess(nnoll=100, rmax=rmax, doplot=(trial==0)))
plt.clf()
plt.plot(sizes, saverandom, color='r')
plt.plot(sizes, saveboolardy, color='g')
plt.title('S Average for fixed source density, r:random array, g:Boolardy array')
plt.xlabel('Size of station (m)')
plt.ylabel('S average')
plt.savefig('savesizes.pdf')