-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanda.py
93 lines (91 loc) · 3.27 KB
/
manda.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
89
90
91
92
93
#!/usr/bin/env python3
def myexp(site):
try:
import lpgen.par_gen as par_gen
except:
import par_gen
print('Doing experiment files for site='+site)
###### Setup section
dspexp='manda' #Experiment version
exp_name=dspexp+'-'+site#Name of experiment
cal_samp=10 #Number of calibration and bakground samples
loops=128 #Number of loops in a complete cycle
code_len=64 #Number of Bauds in each code
nr_codes=128 #Number of codes
code_tx=64 #Number of Bauds to send
nr_loop=25 #Number of loops to get wanted integration time
plasma_pulses=0 #Number of pulses to correlate
plasma_frac=5 #Plasma frac
nr_pulses=2 #Number of pulses to correlate
ion_frac=2
mthread=20
dshort=nr_codes-1
dlong=15
if site=='p':
ipp=1250 #IPP length in us
baud_len=4 #Baud length in us
start_tx=10 #When to start transmitting in us
trx_frq=233.1 #Transmit frequency used
start_samp=int(baud_len*(code_tx+1./ion_frac))+6 #When to start sampling
nr_pulses=2 #Number of pulses to correlate
ndgat=180 #Number of Dregion gates
cal_samp=0 #Number of calibration and bakground samples
calstop=ipp-2
elif site=='l':
ipp=1250 #IPP length in us
baud_len=4 #Baud length in us
start_tx=50 #When to start transmitting in us
trx_frq=500.3 #Transmit frequency used
start_samp=int(baud_len*(code_tx+1./ion_frac))+149 #When to start sampling
start_samp-=2 #Bug in py2 version
#plasma_ch=[1,5] #Plasma line channels
#plasma_pulses=1 #Number of pulses to correlate
ndgat=150 #Number of Dregion gates
calstop=ipp-4
else:
baud_len=2.4 #Baud length in us
start_tx=73 #When to start transmitting in us
code_tx=61 #Number of Bauds to send
ipp=1500 #IPP length in us
start_samp=int(baud_len*(code_tx+1./ion_frac))+124 #When to start sampling
start_samp-=1 #Bug in py2 version
ndgat=250 #Number of Dregion gates
nr_pulses=1 #Number of pulses to correlate
calstop=ipp-3
if site=='v':
trx_frq=5 #Transmit frequency used
else:
trx_frq=12 #Transmit frequency used
if site=='r':
guard=72-9 #Guard time in us
start_samp=baud_len-guard # When to start sampling in us
cal_samp=300 #Number of calibration and bakground samples
nr_pulses=1 #Number of pulses to correlate
ion_frac=1
tails=0
toptail=0
trx_frq=5 #Transmit frequency used
nr_fullgates=int(2*guard/baud_len+1)
else:
tails=code_tx-2
toptail=tails
samp_speed=baud_len/ion_frac
start_samp+=start_tx # When to start sampling in us
######
nr_fullgates=int((calstop-start_samp)/baud_len-(4+cal_samp)/ion_frac)-(code_tx-1)
lowtail=tails
if site=='l':
clutts=min(269,(nr_fullgates+code_tx-1)*ion_frac)
elif site=='r':
nr_fullgates=int(2*guard/baud_len+1)
ndgat=nr_fullgates
clutts=0
else:
nr_fullgates=int((calstop-start_samp)/baud_len-(8+cal_samp)/ion_frac)-(code_tx-1)
clutts=min(150,(nr_fullgates+code_tx-1)*ion_frac)
if cal_samp==0:
nr_fullgates=int((calstop-start_samp)/baud_len)-(code_tx-1)
print(nr_fullgates)
ac_code=par_gen.acgen(code_len,code_tx,nr_codes)
isamp=par_gen.plwingen(nr_pulses,plasma_pulses,plasma_frac,code_tx,nr_fullgates,dspexp,site,ion_frac,tails,mthread,nr_codes,nr_loop,dshort,dlong,ndgat,clutts,toptail,lowtail,loops,ac_code)
par_gen.t2ps(cal_samp,samp_speed,loops,baud_len,ac_code,code_len,code_tx,start_tx,ipp,trx_frq,site,dspexp,start_samp,isamp,calstop)