1 | ################################################################
|
---|
2 | ### SOPHYA class library - piapp interactive analysis tool
|
---|
3 | ### (C) LAL / Univ. Paris Sud, CNRS/IN2P3 1998-2012
|
---|
4 | ### (C) IRFU-SPP / CEA 1998-2012
|
---|
5 | ################################################################
|
---|
6 | ### polarplot.pic : SOPHYA/piapp demo script
|
---|
7 | ### NTuple creation & filling through the interpreter
|
---|
8 | ### to prepare data suitable for plot in polar coordinates
|
---|
9 | ################################################################
|
---|
10 | # 1- default axe attributes
|
---|
11 | setaxesatt 'font=helvetica,bold,16 fixedfontsize'
|
---|
12 | # 2.a First NTuple creation and filling (angle-radius)
|
---|
13 | del ntpol ntpole
|
---|
14 | newnt ntpol angle reponse
|
---|
15 | AMP = 12.
|
---|
16 | # 2.b interpreter loop on angular values in degree
|
---|
17 | for ang -90.:270.:0.5
|
---|
18 | x = fabs(3.*(ang-90.)*Pi/180.)
|
---|
19 | if ( $x < 1.e-9 ) then
|
---|
20 | rep = AMP
|
---|
21 | else
|
---|
22 | y = sin(x)/x
|
---|
23 | rep = AMP*y*y*(1+x)
|
---|
24 | endif
|
---|
25 | line2nt ntpol $ang $rep
|
---|
26 | end
|
---|
27 | # 3.a second NTuple creation anf filling (angle-radius+errors)
|
---|
28 | del ntpole
|
---|
29 | newnt ntpole angle reponse err_ang err_rep
|
---|
30 | # 3.b interpreter loop on angular values in degree
|
---|
31 | for ang 0.:180.:3.
|
---|
32 | x = fabs(3.*(ang-90.)*Pi/180.)
|
---|
33 | if ( $x < 1.e-9 ) then
|
---|
34 | rep = AMP
|
---|
35 | else
|
---|
36 | y = sin(x)/x
|
---|
37 | rep = AMP*y*y*(1+x)
|
---|
38 | endif
|
---|
39 | errang = fabs(gaurand()*5.)
|
---|
40 | errrep = fabs(gaurand()*2.)
|
---|
41 | line2nt ntpole $ang $rep $errang $errrep
|
---|
42 | end
|
---|
43 | # 4.a Plot in cartesian coordinates
|
---|
44 | print ntpol
|
---|
45 | print ntpole
|
---|
46 | zone 1 2
|
---|
47 | nt2d ntpol angle reponse - - - - 'cpts'
|
---|
48 | nt2d ntpole angle reponse err_ang err_rep - - 'marker=circle,7'
|
---|
49 | # 4.b Plot in polar coordinates in two windows
|
---|
50 | newwin 2 1 800 400
|
---|
51 | nt2d ntpol angle reponse - - - - 'polarplot polarangledeg notit red line=solid,2 nsta cpts'
|
---|
52 | nt2d ntpole angle reponse err_ang err_rep - - 'polarplot polarangledeg notit blue marker=circle,7 line=solid,1 nsta'
|
---|
53 | # nt2d ntpol angle reponse - - - - 'notit red line=solid,2 nsta cpts polarangledeg polaraxes=9,8'
|
---|