################################################################ ### SOPHYA class library - piapp interactive analysis tool ### (C) LAL / Univ. Paris Sud, CNRS/IN2P3 1998-2012 ### (C) IRFU-SPP / CEA 1998-2012 ################################################################ ### polarplot.pic : SOPHYA/piapp demo script ### NTuple creation & filling through the interpreter ### to prepare data suitable for plot in polar coordinates ################################################################ # 1- default axe attributes setaxesatt 'font=helvetica,bold,16 fixedfontsize' # 2.a First NTuple creation and filling (angle-radius) del ntpol ntpole newnt ntpol angle reponse AMP = 12. # 2.b interpreter loop on angular values in degree for ang -90.:270.:0.5 x = fabs(3.*(ang-90.)*Pi/180.) if ( $x < 1.e-9 ) then rep = AMP else y = sin(x)/x rep = AMP*y*y*(1+x) endif line2nt ntpol $ang $rep end # 3.a second NTuple creation anf filling (angle-radius+errors) del ntpole newnt ntpole angle reponse err_ang err_rep # 3.b interpreter loop on angular values in degree for ang 0.:180.:3. x = fabs(3.*(ang-90.)*Pi/180.) if ( $x < 1.e-9 ) then rep = AMP else y = sin(x)/x rep = AMP*y*y*(1+x) endif errang = fabs(gaurand()*5.) errrep = fabs(gaurand()*2.) line2nt ntpole $ang $rep $errang $errrep end # 4.a Plot in cartesian coordinates print ntpol print ntpole zone 1 2 nt2d ntpol angle reponse - - - - 'cpts' nt2d ntpole angle reponse err_ang err_rep - - 'marker=circle,7' # 4.b Plot in polar coordinates in two windows newwin 2 1 800 400 nt2d ntpol angle reponse - - - - 'polarplot polarangledeg notit red line=solid,2 nsta cpts' nt2d ntpole angle reponse err_ang err_rep - - 'polarplot polarangledeg notit blue marker=circle,7 line=solid,1 nsta' # nt2d ntpol angle reponse - - - - 'notit red line=solid,2 nsta cpts polarangledeg polaraxes=9,8'