Changeset 631
- Timestamp:
- Jan 13, 2012, 12:18:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BAORadio/AmasNancay/trunk/plotRawDiffOnOff.pic
r626 r631 1 1 #source should be in minuscule letters 2 # gain = 1 if on,off have been divided by gain 3 2 4 set source $1 3 5 set ncycles $2 6 set gain $3 4 7 5 8 #c++compile meanSigSum … … 15 18 setaxesatt "$axedefatt" 16 19 17 18 set f1420low 1420.2 19 set f1420high 1420.6 20 nbins1420 = floor((${f1420high}-${f1420low})/250*8192) 21 20 set path "/sps/baoradio/AmasNancay/AST" 21 if ( $gain == "0" ) then 22 openppf ${path}/rawOnOffDiffNoGain_${source}-${ncycles}Cycles.ppf 23 echo "Opening file ${path}/rawOnOffDiffNoGain_${source}-${ncycles}Cycles.ppf" 24 else 25 openppf ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf 26 echo "Opening file ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf" 27 endif 28 29 # Abell 85, 500 cycles 30 if ( ${source} == "abell85" ) then 31 set f1420low 1420.2 32 set f1420high 1420.6 33 set packVal "1 10 25 50 100" 34 endif 35 36 <<<<<<< .mine 37 # Abell 1205, 600, 750 cycles 38 if ( ${source} == "abell1205" ) then 39 set f1420low 1420.1 40 set f1420high 1420.6 41 if ( $ncycles == 600 ) then 42 set packVal "1 10 25 50 100 120" 43 else 44 set packVal "1 10 15 50 75 125 150" 45 endif 46 endif 47 ======= 22 48 set path "/sps/baoradio/AmasNancay/JEC" 23 49 openppf ${path}/rawOnOffDiff_${source}-${ncycles}Cycles.ppf 24 50 >>>>>>> .r630 51 52 # Abell 2440, 210 cycles 53 if ( ${source} == "abell2440" ) then 54 set f1420low 1420.4 55 set f1420high 1420.7 56 set packVal "1 10 25 42" 57 endif 58 59 # All clusters, 1549 cycles 60 if ( ${source} == "abell85-abell2440-abell1205" ) then 61 set f1420low 1420.1 62 set f1420high 1420.7 63 set packVal "1 10 25 50 100 260" 64 endif 65 66 echo "f1420low=${f1420low}, f1420high=${f1420high}" 67 echo "Packing values="${packVal} 68 69 nbins1420 = floor((${f1420high}-${f1420low})/250*8192) 70 #echo $nbins1420 25 71 26 72 clearscript evolAt1420Freq … … 29 75 clearscript sigmaRaw1420Side 30 76 clearscript sigmaRaw1410a1415 77 clearscript sigmaRawBand 31 78 clearscript IntAt1420 32 79 clearscript diffOnOff … … 64 111 c++compile rebining 65 112 c++link rebining.so dorebin 66 67 113 68 114 #col 3 = onoffRaw01420side Ch 0 … … 81 127 set sigmaCh1 "" 82 128 set errsigCh1 "" 83 84 129 85 130 foreach ipack ( $packVal ) … … 210 255 endscript 211 256 ########################################### 257 # Old function sigmaRaw1400a1420 258 defscript sigmaRawBand 259 # flow,fhigh = frequency limits for integration band 260 # offFilt = 1 we divide on-off by filtered Off 261 262 set flow $1 263 set fhigh $2 264 set offFilt $3 265 set nclusters $4 266 graphicatt "" 267 268 if ( $nclusters == 1 ) then 269 ## Individual clusters (update of mergeAnaFiles.cc on 09/01/2012) 270 ## mergeAnaFiles.cc -> meanRawDiffOnOffCycles -> rawOnOffDiff_[source]-[n]Cycles.ppf 271 ## Frequency bands [1405,1415], [1405,1410], [1410,1415] MHz 272 ## [1405,1415]: col 11,12 = onoffRaw[0,1]f14051415 Ch[0,1] (ON-OFF)/OFF_filt 273 ## [1405,1410]: col 13,14 = onoffRaw[0,1]f14051410 Ch[0,1] 274 ## [1410,1415]: col 5, 6 = onoffRaw[0,1]f14101415 Ch[0,1] 275 ## [1405,1415]: col 15,16 = diffonoffRaw[0,1]f14051415 Ch[0,1] (ON-OFF) 276 ## [1405,1410]: col 17,18 = diffonoffRaw[0,1]f14051410 Ch[0,1] 277 ## [1410,1415]: col 19,20 = diffonoffRaw[0,1]f14101415 Ch[0,1] 278 if ( $flow == 1405 ) then 279 if ( $fhigh == 1415 ) then 280 if ( $offFilt == 1 ) then 281 set col0 11 282 set col1 12 283 else 284 set col0 15 285 set col1 16 286 endif 287 endif 288 if ( $fhigh == 1410 ) then 289 if ( $offFilt == 1 ) then 290 set col0 13 291 set col1 14 292 else 293 set col0 17 294 set col1 18 295 endif 296 endif 297 endif 298 if ( $flow == 1410 ) then 299 if ( $fhigh == 1415 ) then 300 if ( $offFilt == 1 ) then 301 set col0 5 302 set col1 6 303 else 304 set col0 19 305 set col1 20 306 endif 307 endif 308 endif 309 310 ntcol2var onoffevol $col0 linCh0All 311 line2vec vecCh0All $linCh0All 312 ntcol2var onoffevol $col1 linCh1All 313 line2vec vecCh1All $linCh1All 314 else 315 ## Execute if analysing All Clusters abell85-abell2440-abell1205 316 ## mergeAnaFiles.cc -> MeanRawDiffOnOffAllClusters -> rawOnOffDiff_[sources]-[n]Cycles.ppf 317 ## Shifts the distribution of each cluster to mean~0, to avoid 318 ## offset problems when regrouping values 319 ## col 5,6 = onoffRaw0f14101415 Ch 0,1 [1410,1415]MHz 320 ## col 7,8 = onoffRaw1f141014125 Ch 0,1 [1410,1412.5]MHz 321 ## col 9,10 = onoffRaw1f14101411 Ch 0,1 [1410,1411]MHz 322 323 if ( $flow == 1410 ) then 324 if ( $fhigh == 1415 ) then 325 set col0 5 326 set col1 6 327 endif 328 if ( $fhigh == 14125 ) then 329 set col0 7 330 set col1 8 331 endif 332 if ( $fhigh == 1411 ) then 333 set col0 9 334 set col1 10 335 endif 336 endif 337 echo Analysing ntuple columns $col0, $col1 338 339 ntcol2var onoffevol $col0 linCh0All 340 line2vec invecCh0All $linCh0All 341 ntcol2var onoffevol $col1 linCh1All 342 line2vec invecCh1All $linCh1All 343 344 del v85 v2440 v1205 345 exptovec v85 onoffevol cycletot-1 srcID==85 346 set v85_first ${v85.min} 347 set v85_last ${v85.max} 348 exptovec v2440 onoffevol cycletot-1 srcID==2440 349 set v2440_first ${v2440.min} 350 set v2440_last ${v2440.max} 351 exptovec v1205 onoffevol cycletot-1 srcID==1205 352 set v1205_first ${v1205.min} 353 set v1205_last ${v1205.max} 354 355 del vecCh085 vecCh02440 vecCh01205 vecCh185 vecCh12440 vecCh11205 vecCh0All vecCh1All 356 h/copy invecCh0All vecCh085 ${v85_first}:${v85_last} 357 h/copy invecCh0All vecCh02440 $v2440_first:$v2440_last 358 h/copy invecCh0All vecCh01205 $v1205_first:$v1205_last 359 h/copy invecCh1All vecCh185 $v85_first:$v85_last 360 h/copy invecCh1All vecCh12440 $v2440_first:$v2440_last 361 h/copy invecCh1All vecCh11205 $v1205_first:$v1205_last 362 363 c++exec double m,s; int l=-1; \ 364 MeanSigma(vecCh085,m,s) ; vecCh085 -= m;\ 365 MeanSigma(vecCh02440,m,s); vecCh02440 -= m;\ 366 MeanSigma(vecCh01205,m,s); vecCh01205 -= m;\ 367 MeanSigma(vecCh185,m,s) ; vecCh185 -= m;\ 368 MeanSigma(vecCh12440,m,s); vecCh12440 -= m;\ 369 MeanSigma(vecCh11205,m,s); vecCh11205 -= m;\ 370 TVector<r_8> vecCh0All(invecCh0All.NElts()); KeepObj(vecCh0All); \ 371 TVector<r_8> vecCh1All(invecCh1All.NElts()); KeepObj(vecCh1All); \ 372 for (int i=0;i<vecCh085.NElts();i++){l++;vecCh0All(l)=vecCh085(i);vecCh1All(l)=vecCh185(i);}\ 373 for (int j=0;j<vecCh02440.NElts();j++){l++;vecCh0All(l)=vecCh02440(j);vecCh1All(l)=vecCh12440(j);}\ 374 for (int k=0;k<vecCh01205.NElts();k++){l++;vecCh0All(l)=vecCh01205(k);vecCh1All(l)=vecCh11205(k);} 375 ## End All Clusters 376 endif 377 378 set sigmaCh0 "" 379 set errsigCh0 "" 380 set sigmaCh1 "" 381 set errsigCh1 "" 382 383 c++compile rebining 384 c++link rebining.so dorebin 385 386 foreach ipack ( $packVal ) 387 388 #Packing per ipack 389 del invec 390 del outvec 391 cp vecCh0All invec 392 call dorebin $ipack 393 mean0 = ${outvec.sum}/${outvec.size} 394 sigma0 = sqrt(${outvec.sumsq}/${outvec.size}-${mean0}*${mean0}) 395 errsig0 = ${sigma0}/sqrt(2*${outvec.size}) 396 set sigmaCh0 "${sigmaCh0} ${sigma0}" 397 set errsigCh0 "${errsigCh0} ${errsig0}" 398 # 399 del invec 400 del outvec 401 cp vecCh1All invec 402 call dorebin $ipack 403 mean1 = ${outvec.sum}/${outvec.size} 404 sigma1 = sqrt(${outvec.sumsq}/${outvec.size}-${mean1}*${mean1}) 405 errsig1 = ${sigma1}/sqrt(2*${outvec.size}) 406 set sigmaCh1 "${sigmaCh1} ${sigma1}" 407 set errsigCh1 "${errsigCh1} ${errsig1}" 408 end 409 410 newnt nt0 x y ey 411 newnt nt1 x y ey 412 413 set x0 ( $packVal ) 414 set y0 ( $sigmaCh0 ) 415 set ey0 ( $errsigCh0 ) 416 417 set x1 ( $packVal ) 418 set y1 ( $sigmaCh1 ) 419 set ey1 ( $errsigCh1 ) 420 421 for i 0:$#x0 422 line2nt nt0 $x0[i] $y0[i] $ey0[i] 423 line2nt nt1 $x1[i] $y1[i] $ey1[i] 424 end 425 426 newwin 1 1 427 plot2de nt0 x y 0 ey 1 "blue marker=fcircle,9 notit nsta" 428 plot2de nt1 x y 0 ey 1 "same red marker=fcircle,9 notit nsta" 429 n = ${#x0}-1 430 func $y0[0]/sqrt(x) $x0[0] $x0[n] 100 "same" 431 settitle "Sigma [$flow,$fhigh]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt 432 setaxelabels "num of cycles" "Sigma (a.u)" $axedefatt 433 434 del h0 h1 435 set xmin -0.01 436 set xmax 0.01 437 newh1d h0 $xmin $xmax 200 438 newh1d h1 $xmin $xmax 200 439 if ( $offFilt == 0 ) then 440 if ( $gain == 0 ) then 441 del h0 h1 442 newh1d h0 -0.0001 0.0001 200 443 newh1d h1 -0.0001 0.0001 200 444 endif 445 newwin 1 1 446 n/proj h0 onoffevol.diffonoffRaw0f$flow$fhigh ! ! ! "blue notit" 447 n/proj h1 onoffevol.diffonoffRaw1f$flow$fhigh ! ! ! "same red notit" 448 settitle "diffonoffRaw [$flow,$fhigh]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt 449 newwin 1 1 450 n/pl onoffevol.diffonoffRaw1f$flow$fhigh%cycle ! ! "cpts red notit" 451 n/pl onoffevol.diffonoffRaw0f$flow$fhigh%cycle ! ! "cpts same blue notit" 452 settitle "diffonoffRaw [$flow,$fhigh]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt 453 else 454 newwin 1 1 455 n/proj h0 onoffevol.onoffRaw0f$flow$fhigh ! ! ! "cpts blue notit" 456 n/proj h1 onoffevol.onoffRaw1f$flow$fhigh ! ! ! "cpts same red notit" 457 settitle "onoffRaw [$flow,$fhigh]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt 458 newwin 1 1 459 n/pl onoffevol.onoffRaw0f$flow$fhigh%cycle ! ! "cpts blue notit" 460 n/pl onoffevol.onoffRaw1f$flow$fhigh%cycle ! ! "cpts same red notit" 461 settitle "onoffRaw [$flow,$fhigh]MHz ${source} Ch 0 (blue) Ch 1 (red)" ' ' $defatt 462 endif 463 464 endscript 465 ########################################## 466 defscript evolAt1400a1415OffOn 467 468 graphicatt "xylimits=0,${ncycles},0.99,1.02" 469 470 newwin 1 1 471 n/pl onoffevol.offRaw0f14001415%cycle ! ! "blue cpts notit nsta" 472 n/pl onoffevol.offRaw1f14001415%cycle ! ! "same red cpts notit nsta" 473 n/pl onoffevol.onRaw0f14001415%cycle ! ! "same cyan cpts notit nsta" 474 n/pl onoffevol.onRaw1f14001415%cycle ! ! "same orange cpts notit nsta" 475 settitle "Raw OFF and ON ${source} Ch 0 (blue/cyan) Ch 1 (red/orange) ${ncycles}cycles " ' ' $defatt 476 setaxelabels "cycle" "I[1400,1415]MHz Raw (a.u)" $axedefatt 477 478 endscript 479 ########################################## 212 480 defscript evolAt1410a1415OffOn 213 481
Note: See TracChangeset
for help on using the changeset viewer.