source: Sophya/trunk/SophyaPI/DemoPIApp/polarplot.pic@ 4086

Last change on this file since 4086 was 4073, checked in by ansari, 13 years ago

Ajout script polarplot.pic (trace en coord. polaires) et modifs cosmetiques/copyright, Reza 10/05/2012

File size: 1.9 KB
Line 
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
11setaxesatt 'font=helvetica,bold,16 fixedfontsize'
12# 2.a First NTuple creation and filling (angle-radius)
13del ntpol ntpole
14newnt ntpol angle reponse
15AMP = 12.
16# 2.b interpreter loop on angular values in degree
17for 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
26end
27# 3.a second NTuple creation anf filling (angle-radius+errors)
28del ntpole
29newnt ntpole angle reponse err_ang err_rep
30# 3.b interpreter loop on angular values in degree
31for 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
42end
43# 4.a Plot in cartesian coordinates
44print ntpol
45print ntpole
46zone 1 2
47nt2d ntpol angle reponse - - - - 'cpts'
48nt2d ntpole angle reponse err_ang err_rep - - 'marker=circle,7'
49# 4.b Plot in polar coordinates in two windows
50newwin 2 1 800 400
51nt2d ntpol angle reponse - - - - 'polarplot polarangledeg notit red line=solid,2 nsta cpts'
52nt2d 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'
Note: See TracBrowser for help on using the repository browser.