Store history in tmpfile at startup when retrieving profile directory location
[oscopy.git] / test / demo.oscopy
blob2f0d1951ee1ffd3a597704aa849504b83c614b5d
1 # First read data from IRF540 simulation
2 print "*** Reading files and setting plots"
3 oread demo/irf540.dat
4 oadd vgs
5 ocreate
6 oadd iRD
7 oadd vgs
8 oadd vgs
9 oadd vds
10 print "*** Fig 2 layout to quad"
11 olayout quad
12 print "*** Done"
13 # Oops, forgot a signal in figure 2 graph 3
14 oselect 2-3
15 oinsert vds
16 # Plot filter response
17 oread demo/ac.dat
18 ocreate
19 oadd vout
20 oscale loglog
21 # Plot square signal, its FFT and a math signal
22 oread demo/tran.dat
23 ocreate
24 oadd vsqu
25 vsqufft=fft(vsqu)
26 oimport vsqufft
27 oadd vsqufft
28 orange 0 15 -.002 .010
29 ounit V
30 v1=vsqu*3+10
31 oimport v1
32 oadd v1
33 ounit V
34 print "*** Insert and remove a signal"
35 oselect 4-1
36 oinsert v1
37 oremove v1
38 # Create from reference signal. Note with Signal unit can be defined
39 vs=sin(vsqu.ref*1e6)
40 vs.ref = vsqu.ref
41 vs2=Signal(sin(vsqu.ref*1e6), 'V')
42 vs2.ref = vsqu.ref
43 oimport vs
44 oimport vs2
45 ocreate vs
46 ounit V
47 print "*** List of figures"
48 ofiglist
49 # Create a copy of vout and freeze it
50 vo=vout
51 oimport vo
52 ofreeze vo
53 oselect 3-1
54 oinsert vo
55 osiglist
56 # Updating
57 print "*** Now change C value in schematic and rerun gnetlist + gnucap"
58 #pause...
59 print "*** Updating"
60 #oupdate
61 print "*** Now look at figure 3"
62 #plot
63 # Saving results
64 owrite gnucap (ow:1) demo/res.dat v1,vsqu