Compare commits

..

1 commit

Author SHA1 Message Date
fc6979ecb2 add fix for invalid temperatures 2024-03-28 14:54:40 +01:00
26 changed files with 8792 additions and 10817 deletions

8
.gitignore vendored
View file

@ -2,8 +2,6 @@
/data /data
/plots /plots
/histograms /histograms
/fitparameters
/dau
.venvBGO/ .venvBGO/
AHBGOC.py AHBGOC.py
Comparisation_BigBGO_2vs3.pdf Comparisation_BigBGO_2vs3.pdf
@ -12,12 +10,8 @@ compare_sums.py
landau_sum_eph.py landau_sum_eph.py
photos/ photos/
requirements.txt requirements.txt
leckstrom.py
leckstrom.pdf
leckstrom.txt
/T_calib
---> Python # ---> Python
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,85 @@
FI 1.02 18
X c393 9b06 1ff2 03e8 7ff1 0d5f bff1 125a bff0 8290 e395 987d fff2 10c1 7ff0 8063 c001 99c7 fff0 8024 1ff1 0d46 dff0 9173 bff0 8a73 fff1 102a fff1 1246 5ff4 949b bff1 0b66 20f3 3a87
EI 0 0x178fffff 0x02 41188:1507 5608 1 -1022 24570 1 2044 -31578 1 2044 -1850 0 -1022 18094 1 -2044 3345408 3 -10240 -50504 3 1848 10070 1 1022 16694 1 2044 32762 5 -2044 15237 1 1022 -4918 0 1022 24028 1 -2044 -22240 0 -2044 -1130 0 -1022 32964 1 -2776 21630 1 -2044 68848 1 -3232
EI 0 0x3ed3ffff 0x02 35280:4020 12900 1 -1022 -10083 3 1022 -34596 4 920 -6049 2 -1022 12042 1 -1022 -28098 3 2044 1128 1 -1022 -15304 1 1022 10648 5 1022 525504 3 -7808 -26446 5 2044 5797 1 1022 -21570 1 2044 -24438 3 -2044 39100 2 -1896 -23454 1 2044 -8322 2 1022 8527 0 1022
EI 0 0x7747ffff 0x01 11804:7633 -15257 1 -1022 3578112 3 -24576 3419 1 1022 -29892 1 2044 -18802 2 -2044 -15447 0 1022 8010 3 1022 -20816 1 2044 12371 0 1022 2561 1 1022 8928 1 -1022 34136 1 -2264 -4657 0 1022 -16998 1 2044 -34452 1 2360 40700 2 -3240 -27560 1 2044 40980 1 0
EI 0 0x40fbffff 0x02 78444:4158 3285 1 1022 8439 1 -1022 -19042 1 2044 -17714 1 2044 -30544 0 -2044 33696 1 -2360 15231 1 -1022 16498 4 -2044 -11482 1 1022 9934 1 -1022 17498 4 2044 6376 1 -1022 266432 3 3968 14437 3 1022 45416 2 -1432 24918 2 -2044 -4406 3 1022 -34844 0 -3240
EI 0 0x37d3ffff 0x02 262143:3572 34852 3 -504 28934 2 -2044 -16538 2 -2044 6872 0 1022 7303 2 1022 2157312 3 -4096 21072 1 -2044 28326 2 -2044 -9849 2 1022 -7031 0 -1022 -64752 5 -2264 52596 1 -2264 16120 2 1022 -55016 2 2312 -37780 5 1432 14627 1 -1022 -4149 0 1022 64052 5 -2776
EI 0 0x533fffff 0x02 42714:5327 45304 3 -968 6412 1 1022 -21074 3 2044 -20666 2 2044 -9831 0 -1022 706880 3 -10240 6622 3 1022 -21284 5 -2044 -22674 0 -2044 -37560 5 920 45232 3 -1432 -1340 0 -1022 11550 1 -1022 10915 0 1022 22078 3 2044 16438 1 -2044 65376 4 -1384 36976 1 920
EI 0 0x13efffff 0x02 151595:1275 12301 1 -1022 20452 1 -2044 42104 1 -1384 -55596 1 4088 22006 1 -2044 -10403 3 -1022 2681856 3 -13824 7143 1 -1022 37244 1 -4088 50364 2 -1896 2911 1 -1022 25888 1 -2044 13701 0 -1022 16946 2 -2044 12213 4 1022 22560 1 -2044 32190 1 -2044 4459 1 1022
EI 0 0x7c63ffff 0x02 262143:7960 342080 3 -4480 20536 1 -2044 -2080 1 -1022 -3595 0 1022 -6142 1 1022 34292 1 -2776 -5572 0 1022 47876 1 -3288 -15641 1 1022 -10536 0 -1022 24070 2 2044 -37796 4 920 21844 4 -2044 20610 1 -2044 10922 1 -1022 -16226 1 1022 22530 1 -2044 -44584 5 3240
EI 0 0x580bffff 0x02 95977:5634 -23718 1 -2044 27408 2 -2044 4299 1 -1022 1851 0 -1022 -25190 3 -2044 -39408 1 1848 28116 2 -2044 -28102 1 2044 -27126 1 2044 13732 0 1022 14675 1 -1022 2166 1 -1022 13035 1 -1022 -45040 3 -408 -12422 3 -1022 3258368 3 -34816 3331 1 -1022 11465 1 -1022
EI 0 0x3087ffff 0x02 63006:3105 1207424 3 -25088 7481 1 -1022 -3043 0 -1022 -23228 0 -2044 -6696 1 1022 8058 0 1022 -11105 2 1022 10787 1 -1022 -42032 3 96 4921 0 1022 -21474 2 -2044 4427 0 1022 47316 4 -504 -13842 4 -1022 -19188 0 2044 9678 1 -1022 24318 1 2044 36608 3 1288
EI 0 0x583fffff 0x01 190957:5647 -6474 3 -1022 46528 1 872 38580 1 -1848 -33280 2 456 -19480 3 2044 -31208 3 -2044 1494 1 1022 -42324 1 4088 -30168 5 2044 -28182 4 2044 26602 1 -2044 -5489 1 1022 -26714 3 2044 5896192 3 -39936 -17082 1 2044 6831 1 -1022 -10236 2 1022 32016 4 -2044
EI 0 0x39e7ffff 0x04 262143:3705 -22136 0 -2044 3563 5 1022 -5167 0 -1022 -15203 1 1022 -32278 2 -2044 25076 0 -2044 -32092 1 2044 13919 4 -1022 30388 1 -2044 11914 1 1022 5366 2 1022 29620 5 -2044 35828 1 -4088 9103 5 -1022 -2930 0 -1022 5140 1 -1022 1593344 3 -13568 26926 1 -2044
EI 0 0x7e93ffff 0x01 69930:8100 -16422 1 2044 -9498 1 1022 21890 1 2044 12763 1 -1022 -17022 0 -2044 9983 2 1022 -14782 1 1022 -16482 0 2044 21684 2 2044 -8798 0 -1022 12242 0 1022 36108 1 -3704 39484 1 0 1575808 3 -33792 -8937 5 1022 -7262 0 1022 21926 1 -2044 -39148 4 -1432
EI 0 0x2b07ffff 0x02 215836:2753 5630 0 1022 11101 0 -1022 562 0 1022 15523 1 1022 30190 2 2044 5770 3 1022 8559 0 1022 15789 1 -1022 8902 0 1022 1753344 3 -14592 17358 1 -2044 -9088 1 1022 -19544 4 -2044 24740 5 2044 -12612 3 1022 39652 4 -920 8190 0 -1022 26438 1 2044
EI 0 0x4bf7ffff 0x02 26683:4861 -2544 5 -1022 -50036 1 968 11257 0 -1022 -23784 3 2044 -4993 0 1022 31314 1 -2044 -29628 0 -2044 40556 1 360 -41260 1 2776 65504 5 -456 -14721 1 1022 2861568 3 -51200 4130 2 1022 20062 2 -2044 14073 0 1022 6910 0 1022 -12474 1 1022 19982 1 -2044
H 1701447177 0 65472 45952 14720 8064 128 34048 54016 15488 29760 57536 59840
EI 0 0x12ebffff 0x04 86460:1210 -45400 4 1432 2999 1 -1022 -31660 1 2044 6575 0 -1022 -9286 1 1022 -50808 4 872 5268 1 -1022 3283 1 -1022 15127 1 -1022 -8729 1 1022 7797 1 -1022 2963 1 1022 16434 1 -2044 -12989 1 1022 -578 0 -1022 -24584 1 -2044 29552 1 -2044 964928 3 -15872
EI 0 0x782bffff 0x04 170319:7690 -18970 3 -2044 -12559 0 1022 9089 1 -1022 5775 1 -1022 14985 4 1022 22174 1 2044 37048 4 -968 62148 5 -48 -51304 5 456 16946 1 -2044 783 1 1022 5069 1 -1022 48248 4 -920 -3356 0 1022 -29076 3 2044 -9388 1 1022 94024 2 400 2597888 3 -40960
EI 0 0x43cbffff 0x02 37607:4338 28632 5 -2044 18546 2 -2044 -18990 1 2044 23614 4 -2044 -26216 1 -2044 12295 1 1022 575424 3 -384 -46404 1 1896 28162 0 2044 -5989 0 1022 -2267 0 1022 -22224 3 2044 1279 0 1022 -29036 1 2044 -13216 5 1022 -12902 1 1022 -15145 1 1022 36232 1 -1432
EI 0 0x0e03ffff 0x02 45709:896 52688 1 -1384 4473 1 -1022 6434 0 1022 10195 0 1022 -2935 1 1022 28052 1 -2044 -27448 1 2044 31164 2 -2044 1530 1 -1022 -5626 0 1022 31610 1 -2044 1509760 3 -8960 48084 5 0 -33500 4 -1848 7923 3 1022 31640 0 2044 9991 0 1022 41680 3 -504
EI 0 0x16d7ffff 0x02 197172:1461 19378 1 -2044 -10928 0 1022 -25870 2 2044 35180 5 -456 11218 0 1022 9961 1 -1022 16261 1 1022 21004 5 2044 -11148 0 1022 637568 3 -7424 660 2 1022 12398 1 -1022 22440 1 -2044 1505 1 -1022 -4056 0 1022 42420 1 -920 2347 1 1022 85520 3 -1472
EI 0 0x096fffff 0x02 154789:603 -30724 5 -2044 -11967 1 1022 -25312 4 -2044 14161 0 -1022 -4810 0 1022 -7107 1 1022 -33524 1 -1848 29548 4 -2044 -30090 1 2044 -31410 1 2044 38452 1 -4088 210784 3 768 1498 1 -1022 -23832 1 2044 38176 1 -920 14715 1 -1022 24848 1 -2044 4056 1 -1022
EI 0 0x25d7ffff 0x02 18201:2421 23754 1 -2044 19180 0 2044 28822 1 -2044 48896 1 -920 7558 3 1022 18232 1 -2044 233600 3 -2912 -3501 1 1022 8473 0 -1022 -41200 1 2776 -12630 1 1022 41536 4 920 50792 1 -920 7585 1 -1022 7457 1 -1022 -14976 4 -1022 34816 4 1848 52924 5 -1896
EI 0 0x017fffff 0x02 169705:95 597632 3 -6016 -21498 5 2044 32364 1 -2044 6488 1 -1022 49712 2 -1896 -24120 3 -2044 -44596 2 1896 46548 1 -504 21708 5 -2044 -6847 3 1022 14113 1 -1022 -19816 1 2044 -9953 2 1022 -38356 4 1848 30442 5 -2044 -35960 1 3240 82240 4 864 -40 0 1022
EI 0 0x70d7ffff 0x02 262143:7221 12439 1 1022 24780 1 -2044 17058 4 -2044 -37604 4 920 -6023 0 -1022 -7930 3 -1022 -37844 1 1848 -11138 0 1022 -7605 0 -1022 -39232 1 1800 20024 1 2044 1526272 3 -33280 -26146 1 2044 5241 0 -1022 46372 2 -2776 26834 2 -2044 -2914 0 1022 1480 3 1022
EI 0 0x43a7ffff 0x02 226483:4329 358560 3 -14976 5578 5 1022 -2481 0 -1022 84608 1 -2352 30754 0 2044 6108 1 1022 14507 1 -1022 -32576 5 2044 -31814 3 2044 -27566 0 -2044 26058 1 2044 12144 1 -1022 30206 1 -2044 -7654 1 1022 16002 1 1022 -16013 1 1022 12693 2 -1022 12237 0 -1022
EI 0 0x146bffff 0x04 111664:1306 -20710 3 -2044 34124 1 -968 14519 1 -1022 48852 0 -456 -13181 0 -1022 3207 1 -1022 56092 1 0 17722 5 2044 -15208 4 -1022 15266 0 1022 -3313 1 -1022 -14084 1 1022 12469 1 1022 40844 1 -456 6150 1 -1022 3699 1 -1022 604672 3 -2176 464544 3 -768
EI 0 0x1553ffff 0x02 90169:1364 28232 1 -2044 -4827 1 1022 36724 2 -504 7407 2 1022 6961 0 1022 -45508 2 1384 -27612 5 2044 19576 0 2044 -4391 0 1022 -22930 3 2044 -15261 3 1022 32754 1 -2044 -28982 3 -2044 11951 5 1022 17006 4 -2044 203408 3 -4352 -16544 1 2044 -66864 1 3696
EI 0 0x6c3fffff 0x01 243130:6927 3885 1 1022 72184 1 -496 50064 2 -48 5400 1 -1022 1771136 3 -24064 17314 4 -2044 25126 3 2044 -5345 0 1022 14102 0 1022 -29998 1 2044 11279 2 1022 33948 1 456 29820 4 2044 -20290 2 2044 5510 0 1022 2211 1 1022 76872 2 -560 107816 4 1280
EI 0 0x467fffff 0x02 13967:4511 1826 1 1022 -55060 3 -1384 22930 2 -2044 41172 3 -504 -16114 2 -1022 42228 3 872 1007040 3 -17536 -1740 1 1022 -9059 1 1022 -10432 1 1022 21978 1 -2044 -6628 1 -1022 15493 2 1022 -23302 0 2044 40368 1 -1896 21860 0 2044 -19802 0 -2044 19426 0 -2044
EI 0 0x2be3ffff 0x02 104792:2808 -39364 1 968 -22624 1 2044 -13210 3 -1022 51848 3 -456 -23546 5 -2044 -13367 1 -1022 16161 1 -1022 -227 0 -1022 -20142 1 2044 12093 0 1022 -17358 0 -2044 -13486 1 1022 -14930 3 1022 3386 0 1022 -7969 1 -1022 227488 3 -4800 20220 1 -2044 16133 1 -1022
EI 0 0x4c63ffff 0x01 182303:4888 -18708 0 -2044 12439 2 1022 8032 1 -1022 6680 1 -1022 3542 1 1022 30526 1 -2044 -8028 0 -1022 12917 0 -1022 31740 1 -2044 13700 4 1022 -16349 1 1022 -9938 1 1022 -6323 1 1022 204992 3 -7904 37072 4 -968 23196 5 2044 8786 1 -1022 -19440 1 -2044
EI 0 0x5e03ffff 0x04 262143:6016 19972 1 -2044 -22962 1 2044 43032 2 -920 -1190 0 -1022 -44676 1 1384 31500 1 -2044 4050 4 -1022 -20514 1 2044 -23400 1 2044 -10020 2 1022 -13056 0 1022 35400 5 -1432 798 1 1022 21956 4 2044 -5890 1 1022 10982 1 1022 884672 3 -2816 921600 3 -3328
EI 0 0x5127ffff 0x02 15560:5193 -3451 0 -1022 -20068 2 -2044 10912 4 1022 1387 1 1022 -4311 0 1022 6967 0 -1022 25868 1 2044 -40532 1 1480 -21962 1 -2044 683968 3 -9344 -30866 4 -2044 16536 1 -2044 4636 0 -1022 -11201 4 -1022 -12987 0 1022 2962 1 -1022 -32198 3 2044 -4557 3 1022
EI 0 0x647fffff 0x02 124117:6431 -36656 0 456 17536 1 -2044 -3001 0 -1022 -16636 1 2044 10645 4 1022 638592 3 -6016 -9486 1 -1022 -20414 2 2044 9578 0 1022 -28170 0 -2044 2239 1 -1022 3242 2 1022 -32096 1 2044 -14745 1 1022 24912 5 -2044 -14664 0 -1022 -46876 3 1432 8763 1 -1022
H 1701447178 0 65472 46016 14400 7808 128 34048 54080 15296 29760 57536 59840
EI 0 0x7047ffff 0x04 262143:7185 -1428 1 1022 20548 2 -2044 3087 2 1022 -18570 2 2044 21296 3 -2044 -49512 2 456 3237 1 1022 17840 0 2044 -17010 3 2044 -31148 4 2044 -7106 0 -1022 15142 3 1022 -21606 0 2044 -10463 1 1022 -28426 0 -2044 -49552 1 1848 60752 5 -3288 1666304 3 -32000
EI 0 0x5407ffff 0x02 22767:5377 49088 4 -1432 -14933 5 1022 8006 3 -1022 20520 1 2044 -10728 1 1022 11016 1 -1022 19022 1 -2044 6679 1 -1022 -13932 2 1022 -21554 3 -2044 -4588 1 1022 636160 3 -10624 -19492 2 2044 -9720 0 1022 4001 1 -1022 27834 5 -2044 48356 2 408 -1642 0 1022
EI 0 0x2bd7ffff 0x01 87539:2805 17838 2 2044 22008 1 -2044 8620 0 -1022 20102 1 -2044 8792 1 -1022 -4943 0 -1022 15310 1 -1022 4884480 3 -45056 -52184 2 1432 17266 0 2044 40460 2 -3192 22342 1 -2044 19884 4 2044 28666 4 2044 10587 1 -1022 -28168 1 2044 48380 1 -2360 46280 0 1384
EI 0 0x674bffff 0x02 249564:6610 28078 4 -2044 -7091 1 -1022 30458 3 2044 -26962 5 2044 -50072 2 2312 45260 1 -1848 25858 2 -2044 -6874 1 1022 21408 1 -2044 170240 3 -2944 -23204 1 2044 -23634 1 2044 -9262 3 1022 -9954 1 1022 29682 5 -2044 -15921 2 1022 10464 3 1022 71968 1 -4624
EI 0 0x2ee3ffff 0x02 168421:3000 8727 1 -1022 -33264 1 -48 2384 0 1022 14583 2 -1022 -25688 2 -2044 729280 3 -14464 31336 2 -2044 -37380 4 -456 43188 2 -1848 14937 4 -1022 10617 2 1022 10024 1 -1022 39680 4 -1896 2992 1 -1022 -18270 4 2044 -39888 1 4088 -40580 1 920 48760 5 920
EI 0 0x41d7ffff 0x04 124092:4213 10058 1 1022 -17284 5 2044 5570 0 1022 9675 1 -1022 -15951 1 1022 -6541 1 1022 -6701 3 -1022 10282 1 1022 4382 1 1022 -6142 1 1022 27518 5 2044 0 0 1022 0 0 1022 2047 5 1022 28724 1 2044 -29416 3 2044 422976 2 -5824 259200 3 -2016
EI 0 0x529bffff 0x02 262143:5286 11482 1 -1022 -6854 0 -1022 41880 3 -504 -13838 0 -1022 -54088 1 1848 7083 1 1022 -5897 0 -1022 -41396 1 1848 618 0 -1022 27952 1 -2044 4197 1 -1022 14826 1 -1022 -11751 2 -1022 11249 1 1022 -13879 0 1022 579520 3 -13440 20578 1 -2044 28938 5 2044
EI 0 0x0ad3ffff 0x02 36365:692 31308 3 -2044 54916 3 408 -29454 1 -2044 9381 0 1022 7442 1 -1022 6102 4 1022 36184 2 -2312 35524 1 -968 12558 3 -1022 21256 1 -2044 20692 1 -2044 10397 4 1022 9517 2 -1022 30896 3 2044 56300 2 -2824 462176 3 64 -15479 0 1022 9191 0 -1022
EI 0 0x68e3ffff 0x02 251779:6712 -29486 1 -2044 34064 1 -920 3882 0 1022 9716 1 -1022 466 1 1022 -4082 0 1022 448 3 -1022 53504 1 456 52952 5 -1896 16261 3 1022 -17344 1 -2044 28708 1 -2044 2056576 3 -31744 -32442 1 2044 28086 1 -2044 1260 1 -1022 38424 4 -4088 -24866 1 2044
EI 0 0x0e1fffff 0x02 262143:903 1059456 3 -11520 342 1 -1022 19694 4 2044 13100 0 1022 -17496 0 -2044 57580 5 -920 5716 1 -1022 11811 1 -1022 -20806 5 -2044 -25316 1 2044 -8356 0 1022 9451 0 1022 -6414 5 -1022 -48180 3 1896 -26958 5 2044 -6136 1 1022 667 1 -1022 27992 1 -2044
H 1701447179 0 65472 45312 12160 5440 128 33984 53952 13696 29760 57664 59968
EI 0 0x7f93ffff 0x01 262143:8164 -32968 4 456 12887 4 -1022 -5671 0 -1022 3882 1 -1022 17526 5 -2044 14129 4 1022 -5705 0 1022 5111 1 -1022 -7532 0 -1022 10981 1 1022 10381 5 -1022 -6578 1 1022 -22300 2 -2044 -10928 0 -1022 1031488 3 -10880 9452 1 -1022 -50696 1 3240 21238 1 -2044
EI 0 0x4c1bffff 0x02 21281:4870 -2742 0 -1022 12670 2 1022 -3168 0 1022 -10583 1 1022 17946 3 2044 -3195 0 -1022 44612 4 408 -10788 5 1022 -13707 1 1022 13135 1 -1022 32198 5 -2044 30950 1 -2044 -10110 0 -1022 -11879 1 1022 2145 2 -1022 662528 3 -10752 966 2 -1022 -23342 0 -2044
EI 0 0x603fffff 0x02 58632:6159 10342 0 1022 14623 0 1022 -7628 2 1022 26510 1 2044 49124 2 408 8185 1 -1022 1666560 3 -18944 -11801 1 1022 41624 4 872 63492 1 -3704 14704 1 -1022 21660 1 -2044 31528 0 2044 -19870 2 2044 -20590 3 2044 50616 1 -3704 15420 3 1022 40296 1 -1848
EI 0 0x796fffff 0x02 132683:7771 -9316 2 1022 -32324 1 2044 -58828 1 1432 16090 5 -1022 8190 5 1022 -13279 2 1022 8837 0 1022 -11578 1 1022 -53576 1 -456 -2686 0 1022 11406 0 1022 51460 5 920 -6575 1 1022 -29596 4 -2044 -49708 1 3288 1372928 3 -6912 21874 1 2044 42268 1 968
EI 0 0x1e1fffff 0x01 51499:1927 -12473 4 1022 -6708 0 1022 15217 4 -1022 -14678 5 1022 9000 3 1022 34740 0 872 7350 2 1022 40796 3 -920 3108 0 1022 -2389 0 1022 -5814 3 -1022 49824 1 -2776 18518 0 2044 2177792 3 -19968 6914 0 1022 3445 1 -1022 2978816 2 -13312 2419968 2 -13824
EI 0 0x71ebffff 0x02 13554:7290 24852 3 -2044 -51020 5 -456 -27894 5 2044 -3208 0 1022 -13513 0 -1022 28992 1 -2044 -20890 1 2044 -35264 1 2312 6629 0 1022 -3996 3 1022 21820 1 2044 239424 3 -7488 23048 1 -2044 -17730 1 -2044 -19216 4 -2044 22376 4 -2044 -13578 0 1022 -14057 0 1022
EI 0 0x14cfffff 0x04 84152:1331 25514 5 -2044 -33152 4 -920 -8076 1 -1022 10373 1 -1022 15492 1 -1022 3641 0 1022 39648 1 -504 42468 1 -920 21318 1 2044 -6265 0 -1022 -11819 0 1022 8857 3 1022 -9011 1 1022 -5616 0 -1022 34844 1 -2776 34580 5 456 495744 3 -4928 -14145 1 -1022
EI 0 0x0dbbffff 0x02 179770:878 -333 0 1022 1597 4 -1022 22966 2 -2044 -18214 1 2044 6123 1 -1022 25094 2 -2044 9458 1 1022 16576 3 -2044 -10869 4 1022 865920 3 -4992 18730 4 -2044 -4845 1 1022 498 0 1022 -16047 0 1022 25202 1 2044 -14527 1 1022 -7557 1 -1022 -15381 3 1022
EI 0 0x59f7ffff 0x04 262143:5757 10243 0 1022 -16306 0 -1022 21034 0 2044 2047 0 1022 15070 4 1022 -1761 0 1022 7345 1 -1022 21582 1 -2044 6893 1 -1022 3175 1 -1022 33020 5 -2824 1415 0 1022 0 0 1022 -5018 0 -1022 38388 3 -48 32928 1 -2360 -1037 0 1022 214912 3 -1056
C64 3 110 30 13 0 26 142 210 24 23 182 13 116 80 28 27 209 151 148 184 1048 211 0 0 0 1439 3236572026
H 1701447180 0 65472 45120 11584 4096 128 33920 53888 12160 29760 57664 60032
EI 0 0x0f23ffff 0x02 262143:968 0 0 1022 0 0 1022 0 0 1022 7041 2 -1022 -71528 5 3280 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 2 1022 -16418 1 2044 0 0 1022 348640 3 -10112 0 0 1022 8553 4 1022 0 0 1022 0 0 1022 0 0 1022
EI 0 0x3467ffff 0x01 10576:3353 0 0 1022 0 0 1022 16976 1 -2044 91 5 1022 1438 0 1022 0 0 1022 0 0 1022 0 0 1022 533632 3 -10880 -1636 0 1022 66112 2 -1840 0 0 1022 0 0 1022 0 0 1022 9133 1 -1022 0 0 1022 0 0 1022 0 0 1022
EI 0 0x025bffff 0x02 119676:150 1084 1 -1022 -11501 2 1022 20892 1 -2044 50716 5 -1896 -18780 1 2044 22562 1 -2044 -9270 3 1022 22882 4 2044 3566 2 -1022 1125760 3 -9728 -8411 1 1022 2414 1 -1022 -4154 0 -1022 -2466 0 1022 9563 1 -1022 -27896 1 -2044 3483 5 -1022 43304 1 -1896
EI 0 0x5e47ffff 0x04 177914:6033 -23768 1 2044 3504 1 1022 -5589 2 1022 -3022 0 1022 5112 2 -1022 -32238 4 2044 3911 1 -1022 10014 0 1022 151 0 -1022 -11921 1 1022 -16020 1 -1022 -40768 1 -1336 -17 0 -1022 -16762 1 2044 -22008 1 -2044 -11396 0 -1022 499328 3 -24192 -51712 3 920
EI 0 0x1e6fffff 0x02 102409:1947 230272 3 -10752 12481 1 1022 -22812 0 -2044 18986 4 2044 -25834 0 -2044 -12267 0 1022 12162 1 -1022 -3124 1 1022 7111 0 -1022 15117 0 1022 12728 0 1022 -8669 1 1022 -36184 5 968 -25718 0 -2044 16325 1 -1022 -878 0 1022 -46980 4 1480 -27170 5 2044
EI 0 0x1877ffff 0x04 114305:1565 28326 1 2044 7525 1 -1022 11180 1 -1022 30194 1 -2044 -32366 1 2044 38976 5 -1896 -3747 2 1022 -4080 1 1022 27538 0 2044 -22564 3 2044 13809 0 1022 12728 1 -1022 -8523 1 1022 18624 0 2044 -33140 1 504 -50740 1 1480 676416 3 -15360 602496 3 -8704
EI 0 0x2e27ffff 0x02 58731:2953 -28080 1 -2044 -36668 5 968 33984 3 -1432 -27858 1 2044 14525 3 -1022 28078 3 2044 11333 1 -1022 -3395 0 1022 -8207 3 -1022 3658496 3 -72192 8638 1 -1022 2052 0 1022 1161 1 1022 36308 3 -1848 19552 1 -2044 46688 5 -4088 17058 1 2044 -38284 5 -408
EI 0 0x7563ffff 0x02 168398:7512 -22310 1 2044 -24686 0 2044 21376 5 2044 4437 1 -1022 -51372 4 2776 37116 1 -2776 41600 1 -3704 -11183 0 -1022 -22062 1 2044 -15495 3 -1022 17974 1 2044 31610 1 2044 -3190 0 1022 46696 3 -48 -15809 0 -1022 1909120 3 -29696 -29366 1 2044 22060 5 2044
EI 0 0x15afffff 0x02 59410:1387 187072 3 -1472 3064 1 -1022 -9858 2 -1022 11486 1 -1022 17122 4 2044 3131 1 1022 20806 1 -2044 27660 1 2044 -4770 1 1022 54612 4 -1896 34552 2 872 -31652 1 -2044 272 2 1022 -6908 0 1022 -6254 0 1022 -14518 1 1022 22700 2 -2044 -35924 1 48
EI 0 0x374bffff 0x02 231526:3538 11212 1 -1022 19698 1 -2044 -2697 1 -1022 20262 1 -2044 4463 1 -1022 453600 3 -1728 -15267 2 1022 65832 4 -1840 -36036 1 2312 7540 1 -1022 26732 1 -2044 28620 0 2044 31420 4 -2044 30152 1 -2044 26686 1 -2044 -3592 0 -1022 -21632 5 2044 10299 1 -1022
EI 0 0x237bffff 0x01 6923:2270 -14630 3 1022 24998 1 -2044 39008 1 0 5578 1 -1022 36968 1 -1848 -51304 4 456 6216 1 -1022 228096 3 -2016 15569 1 -1022 7820 3 1022 12113 1 1022 11179 2 -1022 4724 0 -1022 40980 1 0 37900 4 -1896 20484 1 -2044 12428 1 -1022 55544 1 -2408
EI 0 0x3b5bffff 0x02 17911:3798 24834 2 2044 32246 4 -2044 2361 0 1022 -8718 2 -1022 2535 1 -1022 -14453 0 -1022 10479 0 -1022 -18456 1 2044 191 4 -1022 675904 3 -4992 645 1 1022 -19676 1 2044 -31922 4 2044 20716 1 -2044 -8602 1 1022 21592 3 2044 26644 4 -2044 -4717 1 1022
EI 0 0x1dafffff 0x02 22676:1899 28078 2 2044 -20744 1 2044 -13305 1 1022 -23560 1 2044 -15473 5 1022 2459648 3 -31232 14538 3 -1022 -18984 1 2044 -21250 5 2044 -20988 0 -2044 -37160 1 4088 2032 0 -1022 -33776 2 3800 12721 1 -1022 -17446 4 2044 45524 4 -1848 -48760 1 4088 -14799 0 -1022
EI 0 0x647fffff 0x01 78259:6431 25046 5 -2044 4335 1 -1022 -53124 2 2776 -3838 0 1022 -45312 4 -872 50200 2 -1432 -10985 1 1022 11313 1 -1022 -148 0 1022 1923 0 -1022 12189 3 1022 11311 1 -1022 21036 4 2044 987392 3 -9088 1304 1 -1022 -5625 0 1022 -7650 0 -1022 -29254 1 -2044
EI 0 0x5d53ffff 0x02 97844:5972 -7197 3 1022 -699 0 -1022 -1506 0 1022 17112 0 -2044 3055 2 1022 -10534 0 1022 8680 1 -1022 -19208 1 2044 18422 1 -2044 15582 1 -1022 31454 2 2044 14768 2 -1022 314208 3 -8128 -3452 2 1022 26464 3 -2044 33460 4 -1384 69032 1 -48 98696 3 -1888
EI 0 0x20a3ffff 0x02 61651:2088 35232 2 1336 -1188 0 1022 9783 5 -1022 17066 4 -2044 55468 5 -1432 -5646 3 1022 1013 1 1022 22490 1 -2044 39548 2 -3240 18868 2 2044 12554 1 -1022 13172 1 -1022 2020992 3 -38400 32984 1 -1384 14303 2 -1022 -21886 0 2044 -77144 5 2816 38200 1 920
EI 0 0x2e2bffff 0x02 82785:2954 15084 4 -1022 70016 2 -1424 -32872 1 48 566 5 1022 -2384 0 -1022 6230 0 -1022 30600 0 -2044 -25510 1 2044 5951 0 1022 16434 1 -2044 -23772 1 -2044 19092 3 -2044 26594 1 2044 -17106 3 -2044 30404 5 -2044 176000 3 2656 14927 0 1022 48892 1 -504
EI 0 0x7d4fffff 0x04 218056:8019 -12703 1 1022 -17306 1 2044 7512 0 1022 -15082 1 1022 -22426 1 2044 18394 1 -2044 -23230 1 2044 -19912 2 2044 15158 0 1022 -20216 4 -2044 -8924 0 1022 12544 3 -1022 6251 1 -1022 -4466 0 1022 17820 2 2044 -18622 4 -2044 697600 3 -16128 37000 2 408
EI 0 0x7abfffff 0x01 48987:7855 -14820 2 1022 28140 2 -2044 774848 3 -1920 -11138 0 -1022 14550 1 -1022 8479 0 1022 32388 2 2044 26592 1 2044 -32064 4 2044 38068 4 -48 9545 1 -1022 -24522 1 2044 -14344 0 1022 47320 5 408 32264 1 2044 14328 1 -1022 49668 1 -3288 29572 5 2044
EI 0 0x71f3ffff 0x02 262143:7292 0 0 1022 0 0 1022 0 0 1022 -25620 1 2044 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 212560 3 0 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022
EI 0 0x2f8fffff 0x02 20326:3043 0 0 1022 0 0 1022 0 0 1022 -21918 1 2044 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022 1983744 3 -30464 0 0 1022 0 0 1022 0 0 1022 0 0 1022 0 0 1022
EI 0 0x2613ffff 0x02 262143:2436 813 0 1022 -22688 2 2044 -6057 1 -1022 25104 1 -2044 -20230 4 2044 -12954 0 -1022 3630336 3 -37888 22864 5 -2044 661 4 1022 27568 3 2044 -22150 4 -2044 23970 2 2044 -8746 2 -1022 34252 2 0 56468 4 0 -23434 1 2044 18688 0 2044 18880 0 2044
EI 0 0x12fbffff 0x01 31545:1214 5431 2 1022 43012 1 -3288 3940 1 -1022 -161 0 1022 4994048 3 -36864 -1765 0 1022 25364 0 2044 28662 1 2044 31246 1 -2044 1083 0 -1022 61872 3 -2312 3115 3 -1022 -3684 0 1022 -3234 1 1022 -16722 3 2044 -52632 4 -456 17886 1 2044 26930 5 2044
H 1701447181 0 65472 45632 13312 6528 128 33984 54016 11392 29760 57664 59904
EI 0 0x4cdbffff 0x02 262143:4918 29156 4 -2044 68728 5 -2352 3736 1 -1022 -16964 1 2044 7571 1 1022 181216 3 -2016 -15573 0 1022 6239 5 1022 22072 4 -2044 -23678 5 2044 EOF

View file

File diff suppressed because it is too large Load diff

View file

@ -14,19 +14,16 @@ import pandas as pd
from datetime import datetime from datetime import datetime
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(description="This script parses EI-data for AHBGOC and returns histogramms of B1,B2 and sum") parser = argparse.ArgumentParser(description="This script parses EI-data for CHAOS_jr and return histogramms")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages") parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("file", type = str, help="path/file were data is stored in") parser.add_argument("file", type = str, help="path/file were data is stored in")
parser.add_argument("-trigger", type=str, nargs='+', help = "letters of Triggerdiodes to chose") parser.add_argument("-trigger", type=str, nargs='+', help = "letters of Triggerdiodes to chose")
parser.add_argument("-nameadd", type=str, nargs='+', help = "custom nameadd to add to filename") parser.add_argument("-nameadd", type=str, nargs='+', help = "custom nameadd to add to filename")
parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag
parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag
parser.add_argument('-six', action='store_true', help = "choose, if six BGO diodes to single preamps") # on/off flag
args = parser.parse_args() args = parser.parse_args()
#stdoutOrigin=sys.stdout
file = args.file file = args.file
filename = file.split(".")[0].split("/")[-1] filename = file.split(".")[0].split("/")[-1]
@ -38,12 +35,12 @@ else:
mV = 14000 mV = 14000
minV = -100 minV = -100
maxV = 3500 maxV = 3500
resV = 0.838214/2 resV = 0.838214
def main(): def main():
global thr global thr
global ch global ch
ch,name,thr,u = channels(args.six) ch,name,thr,u = channels()
if name[0] == None and verbosity>0: if name[0] == None and verbosity>0:
print("no valid filename. Filename should contain 'AHBGOD' or 'AHBGOC'") print("no valid filename. Filename should contain 'AHBGOD' or 'AHBGOC'")
@ -60,7 +57,7 @@ def main():
energy = 'keV' energy = 'keV'
if not args.nameadd == None: if len(args.nameadd)>0:
nameadd = args.nameadd[0] nameadd = args.nameadd[0]
global trigchan global trigchan
@ -70,21 +67,15 @@ def main():
if t == name[i]: if t == name[i]:
trigchan.append(i) trigchan.append(i)
if verbosity > 1:
for t in trigchan: for t in trigchan:
print(ch[t]) print(ch[t])
bin = int((maxV-minV)/resV) bin = int((maxV-minV)/resV)
Bchans = [0,1] hist = np.zeros((bin,3+1))
if args.six: for i in range(0,bin):
hist = np.zeros((bin+1,7+1))
Bchans = Bchans + [13,5,17,9]
else:
hist = np.zeros((bin+1,3+1))
for i in range(0,bin+1):
hist[i][0]=minV + resV*i hist[i][0]=minV + resV*i
with fileinput.input(files=(file), encoding="utf-8", errors = 'ignore') as f: with fileinput.input(files=(file), encoding="utf-8") as f:
T='unknown' T='unknown'
for line in f: for line in f:
l = line.split() l = line.split()
@ -93,33 +84,24 @@ def main():
T = adc_to_T(int(l[8])) T = adc_to_T(int(l[8]))
elif l[0] == 'EI' and not T=='unknown': elif l[0] == 'EI' and not T=='unknown':
if conditions(l,args): if conditions(l,args):
# b1 = CmV(l,ch[0])*u[0]
# if b1>=minV and b1<=maxV:
# xb1 = int(b1-minV/resV)
# hist[xb1,1] += 1
# b2 = CmV(l,ch[1])*u[1]
# if b2>=minV and b2<=maxV:
# xb2 = int(b2-minV/resV)
# hist[xb2,2] += 1
# s = b1+b2
s = 0.0
for i in range(len(Bchans)):
b = CmV(l,ch[Bchans[i]])*u[Bchans[i]]
if b>=minV and b<=maxV:
xb = int((b-minV)/resV)
hist[xb,i+1] += 1
s = s + b
if s>=minV and s<=maxV:
xs = int((s-minV)/resV)
hist[xs,-1] += 1
cols = []
for c in Bchans:
cols.append(name[c])
frame = pd.DataFrame(hist, columns = [energy] + cols +['sum']) b1 = CmV(l,ch[0])*u[0]
if b1>=minV and b1<=maxV:
xb1 = int(b1-minV/resV)
hist[xb1,1] += 1
b2 = CmV(l,ch[1])*u[1]
if b2>=minV and b2<=maxV:
xb2 = int(b2-minV/resV)
hist[xb2,2] += 1
s = b1+b2
if s>=minV and s<=maxV:
xs = int(s-minV/resV)
hist[xs,3] += 1
frame = pd.DataFrame(hist, columns = [energy] + [name[0]]+[name[1]]+['sum'])
frame.to_csv('histograms/'+filename+nameadd+'.hist', sep = ' ', index = False) frame.to_csv('histograms/'+filename+nameadd+'.hist', sep = ' ', index = False)
def channels(six): def channels():
ch = np.arange(18) ch = np.arange(18)
name=[None]*18 name=[None]*18
thr=[12]*18 thr=[12]*18
@ -144,8 +126,8 @@ def channels(six):
# name[16] = "TU7"; ch[16] = 10; u[16] = 1/0.7 # name[16] = "TU7"; ch[16] = 10; u[16] = 1/0.7
# name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7 # name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7
name[0] = "B1"; ch[0] = 16; thr[0] = 12; u[0] = 1/0.652 name[0] = "B1"; ch[0] = 17; thr[0] = 8; u[0] = 1/0.652
name[1] = "B2"; ch[1] = 17; thr[1] = 12; u[1] = 1/0.668 name[1] = "B2"; ch[1] = 16; thr[1] = 8; u[1] = 1/0.668
name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7 #7 name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7 #7
name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7 #2 name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7 #2
name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7 #5 name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7 #5
@ -163,14 +145,6 @@ def channels(six):
name[16] = "TU7"; ch[16] = 2; u[16] = 1/0.7 name[16] = "TU7"; ch[16] = 2; u[16] = 1/0.7
name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7 name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7
if args.six:
name[0] = "B1a"
name[1] = "B2a"
name[5] = "B2b"
name[9] = "B2c"
name[13] = "B1b"
name[17] = "B1c"
# (TO1,TU1,TU2,TO2,TU3,TO3,TO4, TU4, TU5, TO5, TU7, TO6, TO7, TU6, TU8, TO8, B2, B1) = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17) # (TO1,TU1,TU2,TO2,TU3,TO3,TO4, TU4, TU5, TO5, TU7, TO6, TO7, TU6, TU8, TO8, B2, B1) = (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17)
@ -207,7 +181,7 @@ def adc_to_T(adc):
def conditions(l,args): def conditions(l,args):
if (not args.xray and not args.muon) or (args.xray and isXray(l)) or (args.muon and not args.six and isMuon(l)) or (args.muon and args.six and isMuon_six(l)): if (not args.xray and not args.muon) or (args.xray and isXray(l)) or (args.muon and isMuon(l)):
if not args.trigger or (args.trigger and isTrigger(l)): if not args.trigger or (args.trigger and isTrigger(l)):
return True return True
else: return False else: return False
@ -220,10 +194,6 @@ def isMuon(l):
if CmV(l,ch[0]) >= thr[0] and CmV(l,ch[1]) >= thr[1]: return True if CmV(l,ch[0]) >= thr[0] and CmV(l,ch[1]) >= thr[1]: return True
else: return False else: return False
def isMuon_six(l):
if CmV(l,ch[0]) >= thr[0] and CmV(l,ch[1]) >= thr[1] and CmV(l,ch[5]) >= thr[5] and CmV(l,ch[9]) >= thr[9] and CmV(l,ch[13]) >= thr[13] and CmV(l,ch[17]) >= thr[17]: return True
else: return False
def isTrigger(l): def isTrigger(l):
for t in trigchan: for t in trigchan:
if CmV(l,ch[t]) <= thr[t]: return False if CmV(l,ch[t]) <= thr[t]: return False

276
AHBGOx.py
View file

@ -6,14 +6,12 @@ import pandas as pd
from datetime import datetime from datetime import datetime
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
parser = argparse.ArgumentParser(description="This script parses EI-data for AHBGO(C/D/S) and returns histogramms") parser = argparse.ArgumentParser(description="This script parses EI-data for AHBGO(C/D) and return histogramms")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages") parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("file", type = str, help="path/file were data is stored in") parser.add_argument("file", type = str, help="path/file were data is stored in")
parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels") # on/off flag parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels") # on/off flag
parser.add_argument("-sum", action='store_true', help = "makes histogramms of BGOdiodes and sum (same as 'AHBGOC_vertical.py')") # on/off flag parser.add_argument("-sum", action='store_true', help = "makes histogramms of sum(s) of BGOdiodes") # on/off flag
parser.add_argument('-Itime', action='store_true', help = "if chosen, Itime is calculatet and printet to filename.Itime") # on/off flag parser.add_argument('-Itime', action='store_true', help = "if chosen, Itime is calculatet and printet to filename.Itime") # on/off flag
parser.add_argument('-dau', action='store_true', help = "if chosen, time and temperature of BGO are printet to filename.dau") # on/off flag
parser.add_argument('-ntc', action='store_true', help = "if chosen, time and temperature of BGO (ntc value) are printet to filename.ntc") # on/off flag
parser.add_argument("-mV", action='store_true', help = "if chosen, data will be kept in mV changed to keV otherwise") # on/off flag parser.add_argument("-mV", action='store_true', help = "if chosen, data will be kept in mV changed to keV otherwise") # on/off flag
parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag parser.add_argument('-muon', action='store_true', help = "only select muon data") # on/off flag
parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag parser.add_argument("-xray", action='store_true', help = "only select xray data") # on/off flag
@ -22,12 +20,7 @@ parser.add_argument("-two", action='store_true', help = "if chosen, functions fu
parser.add_argument("-zero", action='store_true', help = "if chosen, data will be normalized to 0°C, chose only for sum") # on/off flag parser.add_argument("-zero", action='store_true', help = "if chosen, data will be normalized to 0°C, chose only for sum") # on/off flag
parser.add_argument("-export", type=str, nargs='+', help = "filpath to store output if other then currend directory/histogramms/filename") parser.add_argument("-export", type=str, nargs='+', help = "filpath to store output if other then currend directory/histogramms/filename")
parser.add_argument("-nameadd", type=str, nargs='+', help = "custom nameadd to add to filename") parser.add_argument("-nameadd", type=str, nargs='+', help = "custom nameadd to add to filename")
parser.add_argument("-six", action='store_true', help = "use channels for 'AHBGOS'") parser.add_argument("-tdhist", action='store_true', help = "makes 2d histogramm of B1 against B2 if AHBGOC")
parser.add_argument("-ignoreT", action='store_true', help = "ignores temperature values")
parser.add_argument("-deltaT", action='store_true', help = "saves deltatimes between events")
parser.add_argument("-deltaTmuons", action='store_true', help = "saves deltatimes between muon events")
#parser.add_argument("-tdhist", action='store_true', help = "makes 2d histogramm of B1 against B2 if AHBGOC")
args = parser.parse_args() args = parser.parse_args()
@ -43,11 +36,10 @@ else:
mV = 14000 mV = 14000
minV = -100 minV = -100
maxV = 3500 maxV = 3500
resV = 2*0.838214 resV = 0.838214
if args.trigger==None: if args.trigger==None:
resV=resV/2 resV=resV/2
pol = [1.65857396e-04, -7.56891495e-03, -3.66207616e+00, 3.70051587e+02] #polynom zur Temperaturumrechung pol = [1.65857396e-04, -7.56891495e-03, -3.66207616e+00, 3.70051587e+02] #polynom zur Temperaturumrechung
pol = [1.88909231e-04, -6.84421799e-03, -3.28911747e+00, 3.24630271e+02]
global x global x
x = None x = None
@ -55,17 +47,8 @@ if 'AHBGOD' in file:
x = 'D' x = 'D'
elif 'AHBGOC' in file: elif 'AHBGOC' in file:
x = 'C' x = 'C'
if args.six:
x = 'S'
elif 'AHBGOS' in file:
x = 'S'
def main(x):
global thr
global ch
ch,name,thr,u = channels()
def main():
if args.Itime: if args.Itime:
Itime = find_Itime() Itime = find_Itime()
fname = 'histograms/'+filename+ '.Itime' fname = 'histograms/'+filename+ '.Itime'
@ -73,47 +56,11 @@ def main(x):
outfile.write(str(Itime)) outfile.write(str(Itime))
outfile.close() outfile.close()
elif args.dau:
time,temp = find_timetemp()
frame = pd.DataFrame({'time': time, 'T': temp})
frame.to_csv('histograms/'+filename+'.dau', sep = ' ', index = False)
elif args.ntc:
time,temp = find_timentc()
frame = pd.DataFrame({'time': time, 'T': temp})
frame.to_csv('histograms/'+filename+'.ntc', sep = ' ', index = False)
elif args.deltaT:
dTh = np.zeros((1000000,2))
dTh[:, 0] = np.arange(1, 1000001)
with fileinput.input(files=(file), encoding="utf-8", errors='ignore') as f:
for line in f:
l = line.split()
if not 'EOF' in l and l[0] == 'EI':
dT = int(l[4].split(":")[0])
x = int(dT/3)
dTh[x, 1] += 1
frame = pd.DataFrame(dTh, columns = ["deltaT","count"])
frame.to_csv('histograms/'+filename+'.dThist', sep = ' ', index = False)
elif args.deltaTmuons:
dTh = np.zeros((10000000,2))
dTh[:, 0] = np.arange(1, 10000001)
with fileinput.input(files=(file), encoding="utf-8", errors='ignore') as f:
dT = 0
for line in f:
l = line.split()
if not 'EOF' in l and l[0] == 'EI':
dT += int(l[4].split(":")[0])
if isMuon(l):
x = int(dT/3)
dTh[x, 1] += 1
dT = 0
frame = pd.DataFrame(dTh, columns = ["deltaTmuons","count"])
frame.to_csv('histograms/'+filename+'_muons'+'.dThist', sep = ' ', index = False)
else: else:
global thr
global ch
ch,name,thr,u = channels()
if name[0] == None and verbosity>0: if name[0] == None and verbosity>0:
print("no valid filename. Filename should contain 'AHBGOD' or 'AHBGOC'") print("no valid filename. Filename should contain 'AHBGOD' or 'AHBGOC'")
sys.exit() sys.exit()
@ -121,35 +68,20 @@ def main(x):
global trig global trig
trig=[] trig=[]
nameadd='x' nameadd='x'
if args.sum: if args.sum: nameadd = nameadd + '_sum'
nameadd = nameadd + '_sum'
chans = [0,1]
if x == 'S':
chans =[0,1,5,9,13,17]
channames = []
for c in chans:
channames.append(name[c])
channames = channames + ['sum']
else:
chans = list(range(0, 18))
channames = name
if args.xray: nameadd = nameadd + '_xray' if args.xray: nameadd = nameadd + '_xray'
if args.muon: nameadd = nameadd + '_muon' if args.muon: nameadd = nameadd + '_muon'
if args.zero: nameadd = nameadd + '_zero'
if args.trigger: if args.trigger:
nameadd = nameadd + '_trigger' nameadd = nameadd + '_trigger'
for t in args.trigger: for t in args.trigger:
trig.append(t) trig.append(t)
nameadd = nameadd + '_' + str(t) nameadd = nameadd + '_' + str(t)
if args.zero: nameadd = nameadd + '_zero'
energy = 'keV'
if args.mV: if args.mV:
energy = 'mV'
nameadd = nameadd + '_mV' nameadd = nameadd + '_mV'
u = [1.0]*18 u = [1.0]*18
if not args.nameadd == None: if args.nameadd:
nameadd = args.nameadd[0] nameadd = args.nameadd[0]
global trigchan global trigchan
@ -160,38 +92,39 @@ def main(x):
trigchan.append(i) trigchan.append(i)
bin = int((maxV-minV)/resV) bin = int((maxV-minV)/resV)
if not args.sum: hist = np.zeros((bin,18+1))
hist = np.zeros((bin+1,18+1)) for i in range(0,bin):
else:
hist = np.zeros((bin+1,len(chans)+2))
for i in range(0,bin+1):
hist[i][0]=minV + resV*i hist[i][0]=minV + resV*i
with fileinput.input(files=(file), encoding="utf-8", errors='ignore') as f: with fileinput.input(files=(file), encoding="utf-8") as f:
T='unknown' T = None
if args.ignoreT: T=10 B1 = []
B2 = []
for line in f: for line in f:
l = line.split() l = line.split()
if not 'EOF' in l: if not 'EOF' in l:
if l[0] == 'H' and not args.ignoreT: if l[0] == 'H':
T = adc_to_T(int(l[8])) T = adc_to_T(int(l[8]))
elif l[0] == 'EI' and not T=='unknown': elif l[0] == 'EI' and T is not None:
if conditions(l,args): if conditions(l,args):
s = 0.0 if args.tdhist:
for i in range(len(chans)): B1.append(CmV(l,ch[0])*u[0])
b = CmV(l,ch[chans[i]])*u[chans[i]] B2.append(CmV(l,ch[1])*u[1])
if args.hist:
for i in range(18):
x = CmV(l,ch[i])*u[i]
if args.zero: if args.zero:
b = b*polynom(0,*pol)/polynom(T,*pol) x = x*polynom(0,*pol)/polynom(T,*pol)
if b>=minV and b<=maxV: if x>=minV and x<=maxV:
xb = int((b-minV)/resV) xx = int(x-minV/resV)
hist[xb,i+1] += 1 hist[xx,i+1] += 1
s = s + b
if args.sum and s>=minV and s<=maxV:
xs = int((s-minV)/resV)
hist[xs,-1] += 1
if args.tdhist:
frame = pd.DataFrame({"B1":B1, "B2":B2})
frame.to_csv('histograms/'+filename+nameadd+'.2dhist', sep = ' ', index = False)
frame = pd.DataFrame(hist, columns = [energy] + channames) if args.hist:
frame = pd.DataFrame(hist, columns = ['mV'] + name)
frame.to_csv('histograms/'+filename+nameadd+'.hist', sep = ' ', index = False) frame.to_csv('histograms/'+filename+nameadd+'.hist', sep = ' ', index = False)
@ -209,87 +142,31 @@ def channels():
name[5] = "B2"; ch[5] = 13; u[5] = 1/0.668 name[5] = "B2"; ch[5] = 13; u[5] = 1/0.668
elif x == 'C': elif x == 'C':
# name[0] = "B1"; ch[0] = 16; thr[0] = 8; u[0] = 1/0.7 name[0] = "B1"; ch[0] = 17; thr[0] = 8; u[0] = 1/0.7
# name[1] = "B2"; ch[1] = 17; thr[1] = 8; u[1] = 1/0.7 name[1] = "B2"; ch[1] = 16; thr[1] = 8; u[1] = 1/0.7
# name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7 name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7
# name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7 name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7
# name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7 name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7
# name[5] = "TO4"; ch[5] = 6; u[5] = 1/0.7 name[5] = "TO4"; ch[5] = 6; u[5] = 1/0.7
# name[6] = "TO5"; ch[6] = 9; u[6] = 1/0.7 name[6] = "TO5"; ch[6] = 9; u[6] = 1/0.7
# name[7] = "TO6"; ch[7] = 11; u[7] = 1/0.7 name[7] = "TO6"; ch[7] = 11; u[7] = 1/0.7
# name[8] = "TO7"; ch[8] = 12; u[8] = 1/0.7 name[8] = "TO7"; ch[8] = 12; u[8] = 1/0.7
# name[9] = "TO8"; ch[9] = 15; u[9] = 1/0.7 name[9] = "TO8"; ch[9] = 15; u[9] = 1/0.7
# name[10] = "TU1"; ch[10] = 1; u[10] = 1/0.7
# name[11] = "TU2"; ch[11] = 2; u[11] = 1/0.7
# name[12] = "TU3"; ch[12] = 4; u[12] = 1/0.7
# name[13] = "TU4"; ch[13] = 8; u[13] = 1/0.7
# name[14] = "TU5"; ch[14] = 7; u[14] = 1/0.7
# name[15] = "TU6"; ch[15] = 13; u[15] = 1/0.7
# name[16] = "TU7"; ch[16] = 10; u[16] = 1/0.7
# name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7
name[0] = "B1"; ch[0] = 16; thr[0] = 12; u[0] = 1/0.652
name[1] = "B2"; ch[1] = 17; thr[1] = 12; u[1] = 1/0.668
name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7 #7
name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7 #2
name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7 #5
name[5] = "TO4"; ch[5] = 6; u[5] = 1/0.7 #9
name[6] = "TO5"; ch[6] = 9; u[6] = 1/0.7 #13
name[7] = "TO6"; ch[7] = 11; u[7] = 1/0.7 #16
name[8] = "TO7"; ch[8] = 12; u[8] = 1/0.7 #12
name[9] = "TO8"; ch[9] = 15; u[9] = 1/0.7 #11
name[10] = "TU1"; ch[10] = 1; u[10] = 1/0.7 name[10] = "TU1"; ch[10] = 1; u[10] = 1/0.7
name[11] = "TU2"; ch[11] = 10; u[11] = 1/0.7 name[11] = "TU2"; ch[11] = 2; u[11] = 1/0.7
name[12] = "TU3"; ch[12] = 13; u[12] = 1/0.7 name[12] = "TU3"; ch[12] = 4; u[12] = 1/0.7
name[13] = "TU4"; ch[13] = 8; u[13] = 1/0.7 name[13] = "TU4"; ch[13] = 7; u[13] = 1/0.7
name[14] = "TU5"; ch[14] = 7; u[14] = 1/0.7 name[14] = "TU5"; ch[14] = 8; u[14] = 1/0.7
name[15] = "TU6"; ch[15] = 4; u[15] = 1/0.7 name[15] = "TU6"; ch[15] = 13; u[15] = 1/0.7
name[16] = "TU7"; ch[16] = 2; u[16] = 1/0.7 name[16] = "TU7"; ch[16] = 10; u[16] = 1/0.7
name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7 name[17] = "TU8"; ch[17] = 14; u[17] = 1/0.7
elif x == 'S':
# name[0] = "B1a"; ch[0] = 16; thr[0] = 8; u[0] = 1/0.652
# name[1] = "B2a"; ch[1] = 17; thr[1] = 8; u[1] = 1/0.668
# name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7
# name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7
# name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7
# name[5] = "B2b"; ch[5] = 6; u[5] = 1/0.7
# name[6] = "TO5"; ch[6] = 9; u[6] = 1/0.7
# name[7] = "TO6"; ch[7] = 11; u[7] = 1/0.7
# name[8] = "TO7"; ch[8] = 12; u[8] = 1/0.7
# name[9] = "B2c"; ch[9] = 15; u[9] = 1/0.7
# name[10] = "TU1"; ch[10] = 1; u[10] = 1/0.7
# name[11] = "TU2"; ch[11] = 2; u[11] = 1/0.7
# name[12] = "TU3"; ch[12] = 4; u[12] = 1/0.7
# name[13] = "B1b"; ch[13] = 8; u[13] = 1/0.7
# name[14] = "TU5"; ch[14] = 7; u[14] = 1/0.7
# name[15] = "TU6"; ch[15] = 13; u[15] = 1/0.7
# name[16] = "TU7"; ch[16] = 10; u[16] = 1/0.7
# name[17] = "B1c"; ch[17] = 14; u[17] = 1/0.7
name[0] = "B1a"; ch[0] = 16; thr[0] = 12; u[0] = 1/0.652
name[1] = "B2a"; ch[1] = 17; thr[1] = 12; u[1] = 1/0.668
name[2] = "TO1"; ch[2] = 0; u[2] = 1/0.7 #7
name[3] = "TO2"; ch[3] = 3; u[3] = 1/0.7 #2
name[4] = "TO3"; ch[4] = 5; u[4] = 1/0.7 #5
name[5] = "B2b"; ch[5] = 6; u[5] = 1/0.7 #9
name[6] = "TO5"; ch[6] = 9; u[6] = 1/0.7 #13
name[7] = "TO6"; ch[7] = 11; u[7] = 1/0.7 #16
name[8] = "TO7"; ch[8] = 12; u[8] = 1/0.7 #12
name[9] = "B2c"; ch[9] = 15; u[9] = 1/0.7 #11
name[10] = "TU1"; ch[10] = 1; u[10] = 1/0.7
name[11] = "TU2"; ch[11] = 10; u[11] = 1/0.7
name[12] = "TU3"; ch[12] = 13; u[12] = 1/0.7
name[13] = "B1b"; ch[13] = 8; u[13] = 1/0.7
name[14] = "TU5"; ch[14] = 7; u[14] = 1/0.7
name[15] = "TU6"; ch[15] = 4; u[15] = 1/0.7
name[16] = "TU7"; ch[16] = 2; u[16] = 1/0.7
name[17] = "B1c"; ch[17] = 14; u[17] = 1/0.7
return ch, name, thr, u return ch, name, thr, u
def find_Itime(): def find_Itime():
Itime = 0 Itime = 0
lasttime = 0 lasttime = 0
with fileinput.input(files=(file), encoding="utf-8", errors = 'ignore') as f: with fileinput.input(files=(file), encoding="utf-8") as f:
for line in f: for line in f:
if line[0] == 'H': if line[0] == 'H':
time = int(line.split()[1]) time = int(line.split()[1])
@ -299,31 +176,6 @@ def find_Itime():
lasttime=time lasttime=time
return Itime return Itime
def find_timentc():
time=[]
ntc=[]
with fileinput.input(files=(file), encoding="utf-8", errors = 'ignore') as f:
for line in f:
l = line.split()
if not 'EOF' in l and l[0] == 'H':
T = l[8]
time.append(l[1])
ntc.append(T)
return time,ntc
def find_timetemp():
time=[]
temp=[]
with fileinput.input(files=(file), encoding="utf-8", errors = 'ignore') as f:
for line in f:
l = line.split()
if not 'EOF' in l and l[0] == 'H':
T = adc_to_T(int(l[8]))
time.append(l[1])
temp.append(T)
return time,temp
def CmV(line, i): def CmV(line, i):
return int(line[3*i+5])/mV return int(line[3*i+5])/mV
@ -331,18 +183,14 @@ def polynom(x, a,b,c,d):
return np.multiply(np.multiply(np.multiply(a,x),x),x)+np.multiply(np.multiply(b,x),x)+np.multiply(c,x)+d return np.multiply(np.multiply(np.multiply(a,x),x),x)+np.multiply(np.multiply(b,x),x)+np.multiply(c,x)+d
def adc_to_T(adc): def adc_to_T(adc):
#R25 = 10000 R25 = 10000
#R1 = 10000 #bis 2024-05-28 R1 = 10000
R25 = 9820
R1 = 30700
b = 3940 b = 3940
#dac = 62690 dac = 62690
dac = 62697 #new value from Stephan (see matrix, AHBGO 28.05.24) #bis 2024-05-28 if adc/(dac-adc)-1 <= 0:
dac = 58380 return
T = 0
alpha = np.log(R1/R25 *(dac/(dac-adc)-1)) alpha = np.log(R1/R25 *(dac/(dac-adc)-1))
T = 1/(alpha/b+1/298.15) - 273.15 return 1/(alpha/b+1/298.15) -273.15
return T
def conditions(l,args): def conditions(l,args):
@ -361,8 +209,6 @@ def isXray(l):
(CmV(l,ch[3]) >= thr[3] and CmV(l,ch[4]) < thr[4] and CmV(l,ch[5]) < thr[5]): return True (CmV(l,ch[3]) >= thr[3] and CmV(l,ch[4]) < thr[4] and CmV(l,ch[5]) < thr[5]): return True
elif x == 'C': elif x == 'C':
if CmV(l,ch[0]) <= thr[0] or CmV(l,ch[1]) <= thr[1]: return True if CmV(l,ch[0]) <= thr[0] or CmV(l,ch[1]) <= thr[1]: return True
elif x =='S':
if CmV(l,ch[0]) <= thr[0] or CmV(l,ch[1]) <= thr[1] or CmV(l,ch[5]) <= thr[5] or CmV(l,ch[9]) <= thr[9] or CmV(l,ch[13]) <= thr[13] or CmV(l,ch[17]) <= thr[17]: return True
else: return False else: return False
def isMuon(l): def isMuon(l):
@ -374,17 +220,15 @@ def isMuon(l):
#CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1]: return True #CmV(l,A1) >= thr[0] and CmV(l,A2) >= thr[1]: return True
elif x == 'C': elif x == 'C':
if CmV(l,17) >= thr[0] and CmV(l,16) >= thr[1]: return True if CmV(l,17) >= thr[0] and CmV(l,16) >= thr[1]: return True
elif x == 'S':
if CmV(l,ch[0]) >= thr[0] and CmV(l,ch[1]) >= thr[1] and CmV(l,ch[5]) >= thr[5] and CmV(l,ch[9]) >= thr[9] and CmV(l,ch[13]) >= thr[13] and CmV(l,ch[17]) >= thr[17]: return True
else: return False else: return False
def isTrigger(l): def isTrigger(l):
if x == 'D': if x == 'D':
if CmV(l,ch[3]) >= thr[3]: return True if CmV(l,ch[3]) >= thr[3]: return True
elif x == 'C' or x == 'S': elif x == 'C':
for t in trigchan: for t in trigchan:
if CmV(l,ch[t]) <= thr[t]: return False if CmV(l,ch[t]) <= thr[t]: return False
return True return True
else: return False else: return False
main(x) main()

View file

@ -1,21 +0,0 @@
#Inventory and Status of BigBGOs
No Serial No History Current Condition Current Location
------------------------------------------------------------------------------------------------------
1 43BGO008-2 2 diodes with DC two large diodes 180° shifted Cleanroom
wrapped, unwrapped unwrapped
2 43BGO008-1 diodes with DC six small diodes CHAOS or CHAOSspare
wrapped, unwraped several times wrapped (3 layer millipore)
removed, reglued diodes scratched
tipped over -> scratched
3 43BGO008-1 diodes with DC six small diodes CHAOS or CHAOSspare
wrapped, unwraped several times wrapped (3 layer millipore)
removed, reglued diodes scratched
tipped over -> scratched
4 43BGO008-2 several diodes glued with DC two large diodes 180°
one side roughened one side roughened, unwrapped Cleanroom
------------------------------------------------------------------------------------------------------
5 43BGO009-2 inspected, unused raw Cleanroom
6 43BGO0013-1 inspected, unused raw Cleanroom
note: CHAOSspare is in Ava's testbox in Elab

View file

@ -1,24 +1,6 @@
# BGO # BGO
authors: Ava, Nicolas
description: git repositpory of scripts for data analysis of experiments with large BGO
---------------------------------------------------------------------------------------
scripts are designed to be executed in the command line
type 'scriptname.py -h' to see what the script does and what options are available
---------------------------------------------------------------------------------------
universal script 'AHBGOx.py' processes EI-data and stores results in '/histograms'
figures will be saved in '/plots'
---------------------------------------------------------------------------------------
DATA STORAGE
EI-data is stored in '/net/asterix3/data/asterix/athena/arm/irena/ahbgo'
The file 'README.txt' in the previous destination provides description to the data files
pressure and temperature data from vac-cham is stored in '/net/falbala/home/falbala/stephan/solo/spectra/dau' scripts for data analysis of experiments with large BGO
histograms,Itime, dau(T_BGO) are beeing created using f.e. 'AHBGOx.py' and stored in '/histograms'. The foulder '/histograms/' is ignored by the git repository. Create data by yourself or copy 'net/asterix/home/asterix/ava/BGO/histograms/' To DO
-------------------------------------------------------------------------------------- Irgendwas
SYMLINK
to avoid long file paths in the function call, symlinks to the storage locations are suitable
example: 'ln -s /net/falbala/home/falbala/stephan/solo/spectra/dau/ dau'
to see, where the symlink goes type 'readlink -f dau'

106
T_comp.py
View file

@ -1,106 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 24 10:28:15 2024
@author: rohrbeck
Program to compare measured BGO temps vs estimated, atm only plots all temps in one time diagram
"""
from matplotlib import pyplot as plt
import argparse
import pandas as pd
from datetime import datetime
import numpy as np
# argparse stuff
parser = argparse.ArgumentParser(description="This script returns a figure comparing measured and estimated BGO temperature values")
parser.add_argument("-T", type = str, help="path/file of temperature data around BGO")
parser.add_argument("-Tbgo", type = str, help="path/file of BGO temp data")
args = parser.parse_args()
# files
file_T = args.T
file_Tbgo = args.Tbgo
# this function takes a resistance value and returns a temperature (author of the function: Ava Pohley)
def T(x):
return np.divide(np.subtract(x,1000), 3.85)
# Estimates the BGO temp as the mean of Temp above and below
def est_T(T3, T2):
return np.divide(T3+T2, 2)
# returns a list of two dataframes containing time and temps
def extract(*files):
columns = [['time', 'I', 'T1', 'T2', 'T3', 'T4'], ['time', 'Tbgo']]
data = []
for i in range(len(files)):
data.append(pd.read_csv(files[i], sep=' ', header = 0, names=columns[i], on_bad_lines='skip'))
return data
# merges two dataframes on the time column
def sync(data):
res = pd.merge(data[0], data[1], on='time')
return res
# converting a unix timestamp to a date
def sec_to_day(time):
time = time.to_list()
new_time = []
for i in time:
new_time.append(datetime.fromtimestamp(i))
return new_time
# PLOT
# extracting the data and merging
data = extract(file_T, file_Tbgo)
synced = sync(data)
tT = sec_to_day(data[0].loc[:, 'time'])
tTbgo = sec_to_day(data[1].loc[:, 'time'])
Tbgo_est = est_T(T(data[0].loc[:, 'T3']), T(data[0].loc[:, 'T2']))
Tbgo_mes = data[1].loc[:, 'Tbgo']
#Comparing each temp at the same timestamp
t_long = synced.loc[:, 'time']
T_est = est_T(T(synced.loc[:, 'T3']), T(synced.loc[:, 'T2']))
T_mes = synced.loc[:, 'Tbgo']
# making the figure
fig1 = plt.figure()
fig2 = plt.figure()
ax1 = fig1.add_subplot(111)
ax2 = fig2.add_subplot(111)
# fig1: All Temps in one diagram
ax1.set_xlabel("t/date")
fig1.autofmt_xdate(rotation=45)
ax1.set_ylabel("$T/°C$")
ax1.plot(tT, Tbgo_est, label="Tbgo_est")
ax1.plot(tTbgo, Tbgo_mes, 'x',label="Tbgo_mes")
print(Tbgo_est, Tbgo_mes)
# fig 2: T_mes on x and T_est on y
ax2.set_xlabel("$T_{measured}/°C$")
ax2.set_ylabel("$T_{estimated}/°C$")
ax2.plot(T_mes, T_est)
#
plt.grid()
fig1.legend()
plt.show()

View file

@ -1,121 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 11 13:46:53 2024
@author: ava
"""
import argparse
import sys
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy import special
from scipy import constants
from scipy.optimize import curve_fit
import os.path
from fit_functions import lan
from fit_functions import mips
from fit_functions import find_par
from fit_functions import find_par_new
parser = argparse.ArgumentParser(description="This script plots and fits histograms for Tranges")
parser.add_argument("Tranges", type = str,nargs='+', help="temperature ranges to do script for [n60,n50,n40,...,40]")
args = parser.parse_args()
keV = True
factor = 1/0.00362
plt.figure(figsize=(17,10))
labels = ['40','30','20','10','0','n10','n20','n30','n40','n50','n60']
# params = [] #[[950,192,25,55,200]]+9*[[]]+[[770,440,45,58,1700]]
# area = []
# for i in range(11):
# a = 250+(490-270)/10*i
# b = 650 + (950-650)/10*i
# area.append([int(a),int(b)])
# par = np.array([950,192,25,55,200]) + (np.array([770,440,45,58,1700]) - np.array([950,192,25,55,200]))/10*i
# paradd = [int(x) for x in par]
# params.append(paradd)
params = [[950, 192, 25, 55, 200], [932, 216, 27, 55, 350], [914, 241, 29, 55, 500], [896, 266, 31, 55, 650], [878, 291, 33, 56, 800], [860, 316, 35, 56, 950], [842, 340, 37, 56, 1100], [824, 365, 39, 57, 1250], [806, 390, 41, 57, 1400], [788, 415, 43, 57, 1550], [770, 440, 45, 58, 1700]]
area = [[250, 650], [272, 680], [294, 710], [316, 740], [338, 770], [360, 800], [382, 830], [404, 860], [426, 890], [448, 920], [470, 950]]
fitparams = {'T': [], 'mpv': [], 'err_mpv':[]}
for i in range(len(args.Tranges)):
data = pd.read_csv("histograms/2024-Tcalib-AHBGOC_"+args.Tranges[i]+'x_sum_muon.hist', sep = '\s+', skiprows=0)
Itime = None
f = "histograms/2024-Tcalib-AHBGOC_"+args.Tranges[i]+"x_sum_muon.hist"
while len(f) > 0:
if os.path.isfile(f+'.Itime'):
Itime = int(pd.read_csv(f+'.Itime', sep = '\s+', skiprows=0, names = ['time'])['time'][0])
f=''
else:
f=f[:-1]
pos = labels.index(args.Tranges[i])
startparams = params[pos]
a,b = area[pos]
factor=1.0
#factor = 1/0.00362
energy = 'keV'
#signal = '$e^{-}_{ph}$'
resV = 0.838214/2
#plt.axvline(data[energy][a])
#plt.axvline(data[energy][b])
for ch in ['sum']:
sig = np.power(data[ch]+1, 0.5)
par, cov = curve_fit(lan, data[energy][a:b], data[ch][a:b], startparams, sigma = sig[a:b], absolute_sigma=True)
print(par)
perr = np.sqrt(np.diag(cov))
print(perr)
fitparams['T'].append(args.Tranges[i])
fitparams['mpv'].append(par[1])
fitparams['err_mpv'].append(perr[1])
if not Itime==None:
plt.step(data[energy]*factor, np.multiply(data[ch], 3600/resV/Itime/factor), label=args.Tranges[i]+' ; $e$ = ('+ str(round(par[1]*factor,1)) + '$\pm$' +str(round((perr[1]*factor+0.05),1))+')'+energy)
plt.plot(data[energy][a:b]*factor, np.multiply(lan(data[energy], *par), 3600/resV/Itime/factor)[a:b], 'k--')
else:
plt.step(data[energy]*factor, data[ch]/factor, label=ch)
#+' ; $e$ = ('+ str(int(round(par[1]*factor,-1))) + '$\pm$' +str(int(round(perr[1]*factor+4.9,-1)))+')'+signal)
#plt.plot(data[energy][a:b]*factor, lan(data[energy]*par)[a:b]/factor, 'k--')
frame = pd.DataFrame(fitparams)
print('---------------------')
print(fitparams['mpv'])
print(fitparams['err_mpv'])
frame.to_csv('T_calib/'+'fitparams_landau_sums_keV', sep = ' ', index = False)
fs = 15
ylab = 'counts [1/h/$e^{-}_{ph}$]'
xlab = 'signal [$e^{-}_{ph}$]'
ylab = 'counts / h / keV$_{Si}$'
xlab = 'signal in keV$_{Si}$'
plt.plot(0, 0,'k--', linewidth=1, label = 'landau_fit')
plt.legend(fontsize = fs)
plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs)
plt.title("Landau fit for BGO-sums at different temperatures", fontsize = fs+10, pad = 15)
plt.yscale('log')
plt.ylabel(ylab, fontsize = fs+5)
plt.xlabel(xlab, fontsize=fs+5)
#plt.ylim(5,100) #1
plt.ylim(1.1/factor,100/factor) #2
#plt.ylim(0.9,50) #3
plt.xlim(100*factor,900*factor)
plt.show()
#plt.savefig('T_calib/landau_sums')
#plt.savefig('T_calib/landau_sums.pdf')

View file

@ -1,9 +0,0 @@
trigger pos-vorher pos-nachher
1 7 17
2 2 6
3 5 4
4 9 1
5 13 3
6 16 15
7 12 12
8 11 14

View file

@ -1,156 +0,0 @@
'''
Autor: Ava Pohley
Fits and plots B1, B2 and sum from histograms/filename_B1B2sum... for all 8 vertical triggerpositions
convertion from keVSi to counts of photoelectrons (eph) in progress
'''
import argparse
import sys
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy import special
from scipy import constants
from scipy.optimize import curve_fit
import os.path
from fit_functions import lan
#from fit_functions import find_par
#from fit_functions import find_par_new
def main():
parser = argparse.ArgumentParser(description="This script plots histogramms of give data ending on '.hist'")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filepath", type = str, help="path/file were data is stored in")
parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filepath of histdata will be chosen with filepath_plot) \n second:format (png,pdf,...)")
parser.add_argument("-p", "--photoelectrons", action='store_true', help = "converts data from keV{Si} to amount of photoelectrons")
args = parser.parse_args()
if args.verbose == None:
verbosity = 1
else:
verbosity = args.verbose
if verbosity == 2:
sys.stderr.write("--verbostiy = '" + str(args.verbose)+"'\n")
sys.stderr.write("--filepath = '" + str(args.filepath)+"'\n")
sys.stderr.write("--title = '" + str(args.title)+"'\n")
sys.stderr.write("--export = '" + str(args.export) +"'\n")
sys.stderr.write("--photoelectrons = '" + str(args.export) +"'\n")
file = args.filepath.split('.')[0]
channels = ["B1","B2","sum"]
end = '.hist'
energy = 'mV'
if args.title == None:
tit = 'Histplot, '+"'"+file.split('/')[-1]+"' "
else:
tit = args.title
data = pd.read_csv(file+end, sep='\s+')
Itime = read_Itime(file)
plt.figure(figsize=(20,10))
if 'keV' in data:
energy = 'keV'
if args.photoelectrons:
a = 0.00362
energystr = '$e_{ph}$'
else:
a = 1.0
energystr = energy + '$_{Si}$'
print_data(data,Itime,channels, energy, a, energystr)
layout(tit,energystr,a)
if args.export == None:
plt.show()
else:
if args.export[0] == 'f':
name = 'plots/fitplot_vertical' + file.split('/')[-1]
if args.photoelectrons:
name = name + '_eph'
else:
name = args.export[0]
if len(args.export)>1:
end = args.export[1]
else:
end=''
plt.savefig(name+'.'+end)
def read_Itime(file):
f = file + '.Itime'
Itime = None
while len(f) > 0:
if os.path.isfile(f+'.Itime'):
#Itime = int(pd.read_csv(f+'.Itime', sep = ' ', delim_whitespace=False, skiprows=0, names = ['time'])['time'][0])
Itime = int(pd.read_csv(f+'.Itime', sep='\s+', skiprows=0, names = ['time'])['time'][0])
f=''
else:
f=f[:-1]
return Itime
def print_data(data, Itime, channels, energy, f, energystr):
a = [165,165,220]
b = [290,290,400]
startparams = [[2400,58,7,160,60],[2400,58,7,160,60],[1300,115,15,80,130]]
resV = 0.838214/2
for i in range(len(channels)):
sig = np.power(data[channels[i]]+1, 0.5)
par, cov = curve_fit(lan, data[energy][a[i]:b[i]], data[channels[i]][a[i]:b[i]], startparams[i], sigma = sig[a[i]:b[i]], absolute_sigma=True)
print(par)
perr = np.sqrt(np.diag(cov))
#print(perr)
if not Itime==None:
plt.step(np.multiply(data[energy],1.0/f), np.multiply(data[channels[i]], 3600/resV/Itime*f), label=channels[i]+' ; $e$ = ('+ str(round(par[1]/f,2)) + '$\pm$' +str(round(perr[1]/f+0.005,2))+') '+energystr)
plt.plot(np.multiply(data[energy][a[i]:b[i]],1.0/f), np.multiply(lan(data[energy], *par), 3600/resV/Itime*f)[a[i]:b[i]], 'k--')
else:
plt.plot(np.multiply(data[energy],1.0/f), np.multiply(data[channels[i]],f), label=channels[i]+' ; $e$ = ('+ str(round(par[1]/f,2)) + '$\pm$' +str(round(perr[1]/f+0.005,2))+') '+energystr)
plt.plot(np.multiply(data[energy][a:b],1.0/f), np.multiply(lan(data[energy]*par)[a:b],f), 'k--')
def layout(tit,energystr,a):
# energy = 'mV'
# if keV:
# energy = 'keV'
fs = 20
lim = [30/a, 280/a, 0.003*a, 1.0*a]
ylab = 'counts [1/h/' +energystr+']'
xlab = 'A [' + energystr +']'
plt.legend(fontsize = fs+7)
plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs)
plt.title(tit, fontsize = fs+10, pad = 15)
plt.yscale('log')
plt.ylabel(ylab, fontsize = fs+7)
plt.xlabel(xlab, fontsize=fs+7)
plt.ylim(lim[2],lim[3])
plt.xlim(lim[0],lim[1])
main()

View file

@ -12,7 +12,7 @@ import os.path
def main(): def main():
parser = argparse.ArgumentParser(description="This script plots histogramms of given data ending on '.hist'") parser = argparse.ArgumentParser(description="This script plots histogramms of give data ending on '.hist'")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages") parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filepath", type = str, help="path/file were data is stored in") parser.add_argument("filepath", type = str, help="path/file were data is stored in")
parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen") parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen")
@ -97,10 +97,10 @@ def main():
else: else:
name = args.export[0] name = args.export[0]
if len(args.export)>1: if len(args.export)>1:
end = '.' + args.export[1] end = args.export[1]
else: else:
end='' end=''
plt.savefig(name+end) plt.savefig(name+'.'+end)
def read_data(file, end, raw, dhist): def read_data(file, end, raw, dhist):
@ -108,14 +108,14 @@ def read_data(file, end, raw, dhist):
if dhist == None: if dhist == None:
data = pd.read_csv(file+end, sep = ' ') data = pd.read_csv(file+end, sep = ' ')
else: else:
data = pd.read_csv(file+end, sep='\s+', skiprows=0, names = dhist) data = pd.read_csv(file+end, sep = ' ', delim_whitespace=False, skiprows=0, names = dhist)
f = file + '.Itime' f = file + '.Itime'
Itime = None Itime = None
if not raw == True: if not raw == True:
while len(f) > 0: while len(f) > 0:
if os.path.isfile(f+'.Itime'): if os.path.isfile(f+'.Itime'):
Itime = int(pd.read_csv(f+'.Itime', sep='\s+', skiprows=0, names = ['time'])['time'][0]) Itime = int(pd.read_csv(f+'.Itime', sep = ' ', delim_whitespace=False, skiprows=0, names = ['time'])['time'][0])
f='' f=''
else: else:
f=f[:-1] f=f[:-1]
@ -123,14 +123,14 @@ def read_data(file, end, raw, dhist):
return data, Itime return data, Itime
def print_data(data, Itime, channels, u,energy): def print_data(data, Itime, channels, u,energy):
resV = data[energy][1]-data [energy][0] resV = 0.838214/2
if not u == None: if not u == None:
if len(u) == len(channels): if len(u) == len(channels):
for i in range(0,len(channels)): for i in range(0,len(channels)):
if not Itime==None: if not Itime==None:
plt.step(data[energy]/float(u[i]), np.multiply(data[channels[i]], 3600/resV/Itime*float(u[i])),label=channels[i]) plt.step(data['mV']/float(u[i]), np.multiply(data[channels[i]], 3600/resV/Itime*float(u[i])),label=channels[i])
else: else:
plt.step(data[energy]/float(u[i]), data[channels[i]]*float(u[i]), channels[i]) plt.step(data['mV']/float(u[i]), data[channels[i]]*float(u[i]), channels[i])
else: else:
for ch in channels: for ch in channels:
if not Itime==None: if not Itime==None:
@ -176,7 +176,7 @@ def layout(tit,raw, limits,energy):
lim[3] = 2000 lim[3] = 2000
xlab = 'A [' + energy +'$_{Si}$]' xlab = 'A [' + energy +'$_{Si}$]'
plt.legend(fontsize = fs, loc="upper right") plt.legend(fontsize = fs)
plt.xticks(fontsize=fs) plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs) plt.yticks(fontsize=fs)
plt.title(tit, fontsize = fs+10, pad = 15) plt.title(tit, fontsize = fs+10, pad = 15)

View file

@ -1,52 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 11 11:33:02 2024
@author: ava
Explaination:
Executes selected evaluation scripts for all temperature ranges
"""
import sys
import argparse
import subprocess as sub
parser = argparse.ArgumentParser(description="This script parses EI-data for 2024-Tcalib... and returns all histogramms")
parser.add_argument("Tranges", type = str,nargs='+', help="temperature ranges to do script for [n60,n50,n40,...,40]")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument('-muon', action='store_true', help = "makes histogramm of muon signals with AHBGOx.py") # on/off flag
parser.add_argument('-sum', action='store_true', help = "makes histogramm of BGO-diodes and sum with 'AHBGOx.py'") # on/off flag
parser.add_argument('-dau', action='store_true', help = "makes dau-file with 'AHBGOx.py'") # on/off flag
parser.add_argument('-Itime', action='store_true', help = "makes .Itime-data with 'AHBGOx.py'") # on/off flag
#parser.add_argument('-x', action='store_true', help = "makes histogramm of BGO-diodes and sum with 'AHBGOx.py'") # on/off flag
#parser.add_argument('-zero', action='store_true', help = "changes values to 0°C (use only with '-x')") # on/off flag
#parser.add_argument('-histfit', action='store_true', help = "fits and plots curves from -vertical with histfit_vertical.py") # on/off flag
args = parser.parse_args()
if args.verbose == None:
verbosity = 1
else:
verbosity = args.verbose
if verbosity == 2:
sys.stderr.write("--verbostiy = '" + str(args.verbose)+"'\n")
sys.stderr.write("--filepath = '" + str(args.file)+"'\n")
filepath = "T_calib/2024-Tcalib-AHBGOC_"
name = filepath.split("/")[-1]
options=[]
if args.muon:
options.append("-muon")
if args.sum:
options.append("-sum")
if args.dau:
options = ["-dau"]
if args.Itime:
options = ["-Itime"]
for i in range(len(args.Tranges)):
sub.run(["python3","AHBGOx.py", filepath+args.Tranges[i]+".EI"]+options)

View file

@ -12,17 +12,13 @@ import sys
import argparse import argparse
import subprocess as sub import subprocess as sub
parser = argparse.ArgumentParser(description="This script parses EI-data for AHBGOC and returns all histogramms with vertical trigger coincidence logic") parser = argparse.ArgumentParser(description="This script parses EI-data for AHBGOC and returns all histogramms with vertical coincidenses")
parser.add_argument("file", type = str, help="path/file were EI-file is stored in") parser.add_argument("file", type = str, help="path/file were EI-file is stored in")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages") parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels for all positions with AHBGOx.py") # on/off flag parser.add_argument('-hist', action='store_true', help = "makes histogramm of all channels for all positions with AHBGOx.py") # on/off flag
#parser.add_argument('-tdhist', action='store_true', help = "makes 2d histogramm of B1 against B2 for all positions") # on/off flag #parser.add_argument('-tdhist', action='store_true', help = "makes 2d histogramm of B1 against B2 for all positions") # on/off flag
parser.add_argument('-vertical', action='store_true', help = "makes histogramm of B1, B2 and sum(B1,B2) with AHBGOC_vertical.py") # on/off flag parser.add_argument('-vertical', action='store_true', help = "makes histogramm of B1, B2 and sum(B1,B2) with AHBGOC_vertical.py") # on/off flag
parser.add_argument('-x', action='store_true', help = "makes histogramm of BGO-diodes and sum with 'AHBGOx.py'") # on/off flag
parser.add_argument('-zero', action='store_true', help = "changes values to 0°C (use only with '-x')") # on/off flag
parser.add_argument('-histfit', action='store_true', help = "fits and plots curves from -vertical with histfit_vertical.py") # on/off flag parser.add_argument('-histfit', action='store_true', help = "fits and plots curves from -vertical with histfit_vertical.py") # on/off flag
parser.add_argument('-six', action='store_true', help = "makes histogramm of B1abc, B2abc and sum(B1,B2) with AHBGOC_vertical.py with less triggerdiodes due to six BGOdiodes" ) # on/off flag
parser.add_argument('-pos', action='store_true', help = "makes histogramm of B1abc, B2abc and sum(B1,B2) with AHBGOC_vertical.py with new triggerpositions") # on/off flag
args = parser.parse_args() args = parser.parse_args()
@ -39,48 +35,16 @@ if verbosity == 2:
filepath = args.file.split(".")[0] filepath = args.file.split(".")[0]
name = filepath.split("/")[-1] name = filepath.split("/")[-1]
if args.six:
trigger = [1,2,3,5,6,7]
pos = [7,2,5,13,16,12]
elif args.pos:
trigger = [1,2,3,4,5,6,7,8] trigger = [1,2,3,4,5,6,7,8]
pos = [17,6,4,1,3,15,12,14] pos = [7,2,5,9,13,16,12,11]
else:
trigger = [1,2,3,4,5,6,7,8]
pos = [7,2,5,9,13,16,12,11] -
#sys.stdout = open("fitparameters/log.txt", "w") for i in range(0,8):
for i in range(0,len(trigger)):
if args.vertical: if args.vertical:
if verbosity > 0:
print("position" + "%02d" % pos[i])
# print("python3 AHBGOC_vertical.py" + args.file + "-muon" + "-trigger"+ "TO"+str(trigger[i])+"TU"+str(trigger[i]),"-nameadd", "_B1B2sum_vertical"+"%02d" % pos[i])
if args.six:
sub.run(["python3","AHBGOC_vertical.py", args.file, "-muon", "-six","-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_B1B2sum_vertical"+"%02d" % pos[i]])
else:
sub.run(["python3","AHBGOC_vertical.py", args.file, "-muon", "-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_B1B2sum_vertical"+"%02d" % pos[i]]) sub.run(["python3","AHBGOC_vertical.py", args.file, "-muon", "-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_B1B2sum_vertical"+"%02d" % pos[i]])
print("python3 AHBGOC_vertical.py" + args.file + "-muon" + "-trigger"+ "TO"+str(trigger[i])+"TU"+str(trigger[i]),"-nameadd", "_B1B2sum_vertical"+"%02d" % pos[i])
if args.x:
if verbosity > 0:
print("position" + "%02d" % pos[i])
# print("python3 AHBGOx.py" + args.file + "-muon" + "-trigger"+ "TO"+str(trigger[i])+"TU"+str(trigger[i]),"-nameadd", "_sum_zero"+"%02d" % pos[i])
if args.zero:
if args.six:
sub.run(["python3","AHBGOx.py", args.file, "-muon", "-sum", "-zero", "-six", "-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_sum_zero"+"%02d" % pos[i]])
else:
sub.run(["python3","AHBGOx.py", args.file, "-muon", "-sum", "-zero","-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_sum_zero"+"%02d" % pos[i]])
else:
if args.six:
sub.run(["python3","AHBGOx.py", args.file, "-muon", "-sum","-six", "-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_sum"+"%02d" % pos[i]])
else:
sub.run(["python3","AHBGOx.py", args.file, "-muon", "-sum","-trigger", "TO"+str(trigger[i]), "TU"+str(trigger[i]),"-nameadd", "_sum"+"%02d" % pos[i]])
if args.histfit: if args.histfit:
if verbosity > 0:
print("Position: "+"%02d" % pos[i]) print("Position: "+"%02d" % pos[i])
sub.run(["python3","histfit_vertical.py", "histograms/"+name+"_B1B2sum_vertical"+"%02d" % pos[i]+".hist", "-e", "f"]) sub.run(["python3","histfit_vertical.py", "histograms/"+name+"_B1B2sum_vertical"+"%02d" % pos[i]+".hist", "-e", "f"])
if verbosity > 0:
print('#########################################################################################') print('#########################################################################################')
# elif args.hist and args.tdhist: # elif args.hist and args.tdhist:

View file

@ -1,271 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 19 12:30:26 2024
@author: ava
"""
import matplotlib.pyplot as plt
import argparse
import sys
import numpy as np
import pandas as pd
import os.path
from scipy.optimize import curve_fit
from fit_functions import lan
parser = argparse.ArgumentParser(description="This script plots overview for position dependencies in BigBGO (AHBGOC)")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filenumber", type = int, help="number of file of wich data shall be plottet (14, 16 or 18)")
parser.add_argument("-f", "--fit", action='store_true', help = "landau distributions will be fittet to data. Has to be adjusted for 19!!!") # on/off flag
parser.add_argument("-s", "--sumfit", action='store_true', help = "landau distributions will be fittet only for sums") # on/off flag
parser.add_argument("-p", "--photoelectrons", action='store_true', help = "converts data from keV{Si} to amount of photoelectrons")
parser.add_argument("-z", "--zero", action='store_true', help = "takes data that was normalised to 0°C")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filename will be 'overview-[number]') \n second:format (png,pdf,...)")
parser.add_argument("-l", "--large", action='store_true', help = "Enlarges the labelling (for presentations)")
args = parser.parse_args()
if args.filenumber == 14:
file = "2023-12-21-AHBGOC-14-langzeit"
elif args.filenumber == 16:
file = "2024-01-19-AHBGOC-rau-16_2weeks"
elif args.filenumber == 18:
file = "2024-03-27-AHBGOC-six-18"
elif args.filenumber == 19:
file = "2024-04-08-AHBGOC-six_30V-19"
elif args.filenumber ==20:
file="2024-04-11-AHBGOC-six-20"
elif args.filenumber == 22:
file="2024-04-25-AHBGOC-six-vac-22"
elif args.filenumber == 23:
file="2024-05-08-AHBGOC-six-vac-23_kurz2005"
else:
print("No valid filenamenumber, choose '14', '16', '18' , '19' ,'20', '22', or '23'.")
sys.exit()
pos = [3,2,1,6,5,4,11,10,9,8,7, 14,13,12,17,16,15]
fpos = [2,5,7,9,11,12,13,16]
#fpos = [11,12,13,16]
layoutchange=False
if args.filenumber > 19 and args.filenumber < 23:
layoutchange = True
fpos = [2,5,7,12,13,16]
filename = "histograms/" + file + "_B1B2sum_vertical"
if args.zero:
filename = "histograms/" + file + "_sum_zero"
def main(filename, fpos):
fig = plt.figure(figsize=(19,11))
axes = fig.subplot_mosaic(
"""
..CCBBAA..
.FF.EE.DD.
KKJJIIHHGG
.NN.MM.LL.
..QQPPOO..
"""
)
axs = []
labels=[]
for label, ax in axes.items():
axs.append(ax)
labels.append(label)
#ax.plot(range(10))
#ax.text(0.5, 0.5, k, transform=ax.transAxes, **kw)
#num [0,1,2,3,4,5,6, 7, 8,9,10,11,12,13,14,15,16]
#channels=['B1','B2','sum']
#Define startparameters for fit
a = [355,355,510]
b = [570,570,790]
startparams = 2*[[200,77,6,0.5,100]]+[[100,150,11,1,100]]
if args.filenumber == 18:
a[2] = 550
b[2] = 840
if args.zero:
#startparams = 2*[[200,95,6,0.5,100]]+[[100,185,11,1,100]]
startparams = 2*[[200,70,6,0.5,100]]+[[100,140,11,1,100]]
#a = [190,190,280]
#b = [350,350,490]
a = [85,85,115]
b = [140,140,200]
if args.filenumber==18:
a[2] = 120
b[2] = 235
if layoutchange:
a = 6*[365]+[550]
b = 6*[570]+[840]
#startparams = 6*[[2400,26,3,160,60]] + [[1300,115,15,80,130]]
startparams = 6*[[200,85,6,0.5,100]]+[[100,180,11,1,100]]
if args.zero:
#a = 6*[365]+[350]
#b = 6*[570]+[540]
a = 6*[365]+[140]
b = 6*[570]+[240]
startparams = 6*[[200,85,6,0.5,100]]+[[100,170,11,1,100]]
#################################################################################
resV = 0.838214/2
fs = 21
if args.large:
fs = 28
energy = 'keV'
if args.photoelectrons:
f = 0.00362
energystr = '$e_{ph}$'
else:
f = 1.0
energystr = energy + '$_{Si}$'
fitparams = {'P': [], 'mpv': [], 'err_mpv':[]}
for i in reversed(range(len(axs))):
kw = dict(fontsize=fs-7, color="darkgrey")
if args.large:
if not args.sumfit: axs[i].text(55,0.5, pos[i],kw)
else: axs[i].text(18,0.5, pos[i],kw)
elif not args.fit or args.sumfit: axs[i].text(13,0.9, pos[i],kw)
elif args.zero:
axs[i].text(35,0.75, pos[i],kw)
else: axs[i].text(42,0.75, pos[i],kw)
if args.zero: axs[i].set_xlim([30/f,300/f])
else: axs[i].set_xlim([40/f,280/f])
axs[i].set_ylim( [0.003*f,1.8*f])
if layoutchange:
axs[i].set_xlim([15/f,315/f])
if args.zero:
axs[i].set_xlim([5/f,350/f])
axs[i].set_ylim( [0.009*f,2.3*f])
axs[i].set_yscale('log')
axs[i].tick_params(labelsize=fs-8)
if args.large: axs[i].tick_params(labelsize=fs-15)
if pos[i] in fpos:
fitparams['P'].append(pos[i])
#print('P'+str(pos[i]))
channels = []
ch = pd.read_csv(filename+"%02d" % pos[i]+".hist", sep = ' ', nrows=0)
for c in ch:
channels.append(str(c))
channels = channels[1:]
data = pd.read_csv(filename+"%02d" % pos[i]+".hist", sep='\s+')
Itime=read_Itime(filename)
axs[i].grid(visible=True, which='major', axis='both')
for c in range(len(channels)):
if not args.fit and (not args.sumfit or not channels[c] == 'sum'):
if args.filenumber == 20 or args.filenumber == 22:
axs[i].step(np.multiply(data[energy],1.0/f),np.multiply(data[channels[c]], 3600/resV/Itime*f))
#axs[i].vlines(data[energy][a[c]],0.001,10, color = 'r')
#axs[i].vlines(data[energy][b[c]],0.001,10)
else: axs[i].step(np.multiply(data[energy],1.0/f),np.multiply(data[channels[c]], 3600/resV/Itime*f), label=channels[c])
#axs[i].vlines(data[energy][b[c]],0.1,1000)
elif args.sumfit and channels[c]=='sum':
sig = np.power(data[channels[c]]+1,0.5)
par, cov = curve_fit(lan, data[energy][a[c]:b[c]], data[channels[c]][a[c]:b[c]], startparams[c], sigma = sig[a[c]:b[c]], absolute_sigma=True)
print(str(channels[c])+': ',par)
fitparams['mpv'].append(par[1])
perr = np.sqrt(np.diag(cov))
fitparams['err_mpv'].append(perr[1])
axs[i].step(np.multiply(data[energy],1.0/f), np.multiply(data[channels[c]], 3600/resV/Itime*f), label=channels[c]+' ; $e$ = ('+ str(round(par[1]/f,2)) + '$\pm$' +str(round(perr[1]/f+0.005,2))+') '+energystr)
axs[i].plot(np.multiply(data[energy][a[c]:b[c]],1.0/f), np.multiply(lan(data[energy], *par), 3600/resV/Itime*f)[a[c]:b[c]], 'k--')
else:
sig = np.power(data[channels[c]]+1,0.5)
par, cov = curve_fit(lan, data[energy][a[c]:b[c]], data[channels[c]][a[c]:b[c]], startparams[c], sigma = sig[a[c]:b[c]], absolute_sigma=True)
print(str(channels[c])+': ',par)
perr = np.sqrt(np.diag(cov))
if channels[c]=='sum':
fitparams['mpv'].append(par[1])
fitparams['err_mpv'].append(perr[1])
axs[i].step(np.multiply(data[energy],1.0/f), np.multiply(data[channels[c]], 3600/resV/Itime*f), label=channels[c]+' ; $e$ = ('+ str(round(par[1]/f,2)) + '$\pm$' +str(round(perr[1]/f+0.005,2))+') '+energystr)
axs[i].plot(np.multiply(data[energy][a[c]:b[c]],1.0/f), np.multiply(lan(data[energy], *par), 3600/resV/Itime*f)[a[c]:b[c]], 'k--')
if not args.large:
if not args.fit and not args.sumfit: axs[i].legend(fontsize = 8)
elif args.sumfit:axs[i].legend(fontsize = 7, loc='upper right')
else: axs[i].legend(fontsize = 7, bbox_to_anchor=(0.35, 0.63))
elif args.sumfit: axs[i].legend(fontsize = 10,bbox_to_anchor=(0.1, 0.73))
if args.sumfit or args.fit:
frame = pd.DataFrame(fitparams)
if args.zero: frame.to_csv('fitparameters/'+file+'_mpv_sums_zero.txt', sep = ' ', index = False)
else: frame.to_csv('fitparameters/'+file+'_mpv_sums.txt', sep = ' ', index = False)
no_x=[0,1,2,3,4,5,7,8,9,12]
for i in no_x:
plt.setp(axs[i].get_xticklabels(), visible=False)
no_y=[1,2,4,5,7,8,9,10,12,13,15,16]
for i in no_y:
plt.setp(axs[i].get_yticklabels(), visible=False)
tit = "Overview position dependency '"+file+"'"
if args.zero: tit = tit + ' at 0°C'
ylab = 'counts [1/h/' +energystr+']'
xlab = 'signal [' + energystr +']'
#fig.legend(fontsize = fs)
fig.suptitle(tit, fontsize = fs+5)
fig.supxlabel(xlab, fontsize = fs, y = 0.001)
fig.supylabel(ylab, fontsize = fs, x = 0.07)
if 'six' in file:
plt.figtext(0.51, 0.9, " B1a ", fontdict=None, fontsize = 18, ha = 'center', va='bottom', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5))
plt.figtext(0.51, 0.07, " B2a ", fontdict=None, fontsize = 18, ha = 'center', va='top', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5))
plt.figtext(0.2, 0.75, " B2b ", fontdict=None, fontsize = 18, ha = 'center', va='bottom', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5), rotation = 40)
plt.figtext(0.2, 0.25, " B1b ", fontdict=None, fontsize = 18, ha = 'center', va='top', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5), rotation = -40)
plt.figtext(0.82, 0.75, " B2c ", fontdict=None, fontsize = 18, ha = 'center', va='bottom', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5), rotation = -40)
plt.figtext(0.82, 0.25, " B1c ", fontdict=None, fontsize = 18, ha = 'center', va='top', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5), rotation = 40)
else:
plt.figtext(0.51, 0.9, " B1 ", fontdict=None, fontsize = 18, ha = 'center', va='bottom', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5))
plt.figtext(0.51, 0.07, " B2 ", fontdict=None, fontsize = 18, ha = 'center', va='top', bbox=dict(boxstyle="square", facecolor='grey', alpha = 0.5))
if args.export == None:
plt.show()
else:
if args.export[0] == 'f':
name = 'plots/overview-' + str(args.filenumber)
if args.zero: name = name + '_zero'
else:
name = args.export[0]
if len(args.export)>1:
end = args.export[1]
else:
end=''
plt.savefig(name+'.'+end)
def read_Itime(file):
f = file + '.Itime'
Itime = None
while len(f) > 0:
if os.path.isfile(f+'.Itime'):
Itime = int(pd.read_csv(f+'.Itime', sep='\s+', skiprows=0, names = ['time'])['time'][0])
f=''
else:
f=f[:-1]
return Itime
main(filename, fpos)

View file

@ -1,163 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 13:21:02 2024
@author: ava
"""
import matplotlib.pyplot as plt
import argparse
import sys
import numpy as np
import pandas as pd
import os.path
from scipy.optimize import curve_fit
from fit_functions import lan
def main():
parser = argparse.ArgumentParser(description="This script plots overview for position dependencies in BigBGO (AHBGOC)")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filenumbers", type = int,nargs='+', help="number of files of wich data shall be plottet (14, 16, 18,20)")
parser.add_argument("-p", "--photoelectrons", action='store_true', help = "converts data from keV{Si} to amount of photoelectrons")
parser.add_argument("-z", "--zero", action='store_true', help = "takes data that was normalised to 0°C")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filename will be 'overview-[number]') \n second:format (png,pdf,...)")
parser.add_argument("-l", "--large", action='store_true', help = "Enlarges the labelling (for presentations)")
args = parser.parse_args()
files=[]
numberstr=''
descr = []
factors=[]
for num in args.filenumbers:
numberstr = numberstr + ','+str(num)
if num == 14:
files.append("2023-12-21-AHBGOC-14-langzeit")
descr.append("two large diodes")
factors.append(1.0)
if num == 16:
files.append("2024-01-19-AHBGOC-rau-16_2weeks")
descr.append("two large diodes, side roughened")
factors.append(1.0)
if num == 18:
files.append("2024-03-27-AHBGOC-six-18")
descr.append("six small diodes, two preamps")
factors.append(1.0)
if num == 20:
files.append("2024-04-11-AHBGOC-six-20")
descr.append("six small diodes, six preamps")
factors.append(1.0)
if num == 22:
files.append("2024-04-25-AHBGOC-six-vac-22")
descr.append("six small diodes, six preamps, vacuum")
factors.append(1.0)
if num == 5:
files.append("2026-03-10-ahbgoa-test-5")
descr.append("six small diodes, six preamps, dorn readout")
factors.append(1/0.7)
if num == 7:
files.append("2026-04-13-ahbgoa-test-7")
descr.append("six small diodes, six preamps, dorn readout")
factors.append(1/0.7)
colors = ['tab:blue','tab:orange','tab:green','tab:red','tab:purple','tab:brown', 'tab:pink', 'tab:olive']
if len(files)<1:
print("No valid filenamenumber, choose from '14', '16', '18' ,'20', '22' ,'5' or '7'.")
sys.exit()
energy = 'keV'
if args.photoelectrons:
f = 0.00362
energystr = '$e_{ph}$'
else:
f = 1.0
energystr = energy + '$_{Si}$'
plt.figure(figsize=(15,10))
for i in range(len(files)):
#print(files[i])
filename = "fitparameters/" + files[i] + '_mpv_sums'
if args.zero: filename = filename + '_zero'
dataf = pd.read_csv(filename+'.txt', sep='\s+')
if args.filenumbers[i] in [5, 7]:
mask = ~dataf['P'].isin([10, 11])
data = dataf[mask]
else:
data = dataf
#plt.plot(data['P'],data['mpv'],'x',label=args.filenumbers[i])
plt.errorbar(data['P'],data['mpv']*factors[i], data['err_mpv']*factors[i],fmt='o',capsize=5,ms =7,barsabove=True,color=colors[i], label=descr[i])# +' ('+str(args.filenumbers[i])+')')
ma = max(data['mpv']*factors[i])
mi = min(data['mpv']*factors[i])
plt.hlines(ma,1,16.5+i/4,ls=':', color=colors[i])
plt.hlines(mi,1,16.5+i/4,ls=':', color=colors[i])
#plt.vlines(17,mi,ma,color=colors[i])
plt.errorbar(16.5+i/4, ma-(ma-mi)/2,(ma-mi)/2,capsize=10,linewidth=2,color=colors[i],)
plt.fill_between([1,16.5+i/4], ma,mi,alpha = 0.1,color=colors[i])
fs = 14
if args.large: fs = 20
kw = dict(fontsize=fs, color=colors[i])
plt.text(17.5,ma-(ma-mi)/2-2/(2*i+1), "$\Delta$mpv = " + str(np.round(ma-mi,2)),kw)
#matplotlib.pyplot.errorbar(x, y, yerr=None, xerr=None, fmt='', ecolor=None, elinewidth=None, capsize=None, barsabove=False, lolims=False, uplims=False, xlolims=False, xuplims=False, errorevery=1, capthick=None, *, data=None, **kwargs)
if len(args.filenumbers)>1:
tit = "Overview MPVs of files '" + numberstr[1:] + "'"
else:
tit = "Overview MPVs of '"+files[0]+"'"
if args.zero: tit = tit + " at 0°C"
layout(tit,energystr,f,args.zero,args.large)
if not args.export:
plt.show()
else:
if args.export[0] == 'f':
name = 'plots/overview_mpvs'+numberstr
else:
name = args.export[0]
if len(args.export)>1:
end = args.export[1]
else:
end=''
plt.savefig(name+'.'+end)
################################################################
def layout(tit,energystr,f,z,l):
if l: fs = 25
else: fs = 15
#lim = [30/f,280/f, 0.003*f,1.8*f]
ylab = 'mpv [' + energystr+']'
xlab = 'Triggerposition'
plt.legend(fontsize = fs, loc='upper right')
plt.xticks([2,5,7,9,11,12,13,16],fontsize=fs)
plt.yticks(fontsize=fs)
plt.title(tit, fontsize = fs+10, pad = 15)
#plt.yscale('log')
plt.ylabel(ylab, fontsize = fs+5)
plt.xlabel(xlab, fontsize=fs+5)
add = 0
if l: add = 40
if z: plt.ylim(120,220+add)
#else: plt.ylim(125,200)
else: plt.ylim(125,220+add)
plt.ylim(100,220)
plt.xlim(0.8,20)
if l: plt.xlim(1,22)
main()

View file

@ -1,204 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import argparse
import sys
import numpy as np
import pandas as pd
import os.path
from scipy.optimize import curve_fit
from fit_functions import lan
# ---------------------------
# Argumente
# ---------------------------
parser = argparse.ArgumentParser()
parser.add_argument("filenumber", type=int)
parser.add_argument("-s", "--sumfit", action='store_true')
parser.add_argument("-e", "--export", action='store_true')
args = parser.parse_args()
# ---------------------------
# File mapping
# ---------------------------
if args.filenumber == 5:
file = "2026-03-10-ahbgoa-test-5"
elif args.filenumber == 7:
file = "2026-04-13-ahbgoa-test-7"
else:
print("Only filenumbers 5 and 7 are supported.")
sys.exit()
filename = "/net/asterix/home/asterix/ava/NMAHEPAM/hists/" + file + "_V"
# ---------------------------
# Layout & Positionen
# ---------------------------
pos = [3,2,1,6,5,4,11,10,9,8,7,14,13,12,17,16,15]
pos = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]
#alle Positionen verwenden
fpos = list(range(1,18))
# ---------------------------
# MAIN
# ---------------------------
def main():
fig = plt.figure(figsize=(19,11))
axes = fig.subplot_mosaic(
"""
..CCBBAA..
.FF.EE.DD.
KKJJIIHHGG
.NN.MM.LL.
..QQPPOO..
"""
)
axs = list(axes.values())
resV = 0.838214 / 2
energy = 'value'
a = 6*[40] + [10]
b = 6*[110] + [310]
startparams = 6*[[200,75,6,0.5,100]] + [[200,75,6,0.5,100]]
fitparams = {'P': [], 'mpv': [], 'err_mpv':[]}
for i in reversed(range(len(axs))):
axs[i].text(10, 1, pos[i], fontsize=14, color="grey")
axs[i].set_xlim([3,150])
axs[i].set_ylim([0.09,15])
axs[i].set_yscale('log')
axs[i].grid(True)
if pos[i] in fpos:
fitparams['P'].append(pos[i])
data = pd.read_csv(filename + "%02d" % pos[i] + ".Bhist", sep='\s+')
Itime = read_Itime(filename)
channels = list(data.columns)[1:]
for c in range(len(channels)):
y = data[channels[c]] * 3600 / resV / Itime
# ---------------------------
# FALL 1: kein sumfit → alles normal plotten
# ---------------------------
if not args.sumfit:
axs[i].step(data[energy], y, label=channels[c])
# ---------------------------
# FALL 2: sumfit → nur "sum" fitten
# ---------------------------
elif args.sumfit and channels[c] == 'SUM':
sig = np.sqrt(data[channels[c]] + 1)
par, cov = curve_fit(
lan,
data[energy][a[c]:b[c]],
data[channels[c]][a[c]:b[c]],
startparams[c],
sigma=sig[a[c]:b[c]],
absolute_sigma=True
)
print(str(channels[c])+': ',par)
fitparams['mpv'].append(par[1])
perr = np.sqrt(np.diag(cov))
fitparams['err_mpv'].append(perr[1])
axs[i].step(
data[energy],
y,
label=f"sum ; MPV={par[1]:.2f} ± {perr[1]:.2f}"
)
axs[i].plot(
data[energy][a[c]:b[c]],
lan(data[energy], *par)[a[c]:b[c]] * 3600 / resV / Itime,
'k--'
)
frame = pd.DataFrame(fitparams)
frame.to_csv('fitparameters/'+file+'_mpv_sums.txt', sep = ' ', index = False)
# ---------------------------
# FALL 3: sumfit aktiv → andere Kanäle nur plotten
# ---------------------------
else:
axs[i].step(data[energy], y)
axs[i].legend(fontsize=7)
# keine x-Ticks außer unten
no_x = [0,1,2,3,4,5,7,8,9,12]
for i in no_x:
plt.setp(axs[i].get_xticklabels(), visible=False)
# keine y-Ticks außer links
no_y = [1,2,4,5,7,8,9,10,12,13,15,16]
for i in no_y:
plt.setp(axs[i].get_yticklabels(), visible=False)
# ---------------------------
# Detektor-Labels (C1C6 im Uhrzeigersinn)
# ---------------------------
# oben
plt.figtext(0.51, 0.9, " B6 ", fontsize=18, ha='center', va='bottom',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5))
# unten
plt.figtext(0.51, 0.07, " B3 ", fontsize=18, ha='center', va='top',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5))
# links oben
plt.figtext(0.2, 0.75, " B5 ", fontsize=18, ha='center', va='bottom',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5),
rotation=40)
# links unten
plt.figtext(0.2, 0.25, " B4 ", fontsize=18, ha='center', va='top',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5),
rotation=-40)
# rechts oben
plt.figtext(0.82, 0.75, " B1 ", fontsize=18, ha='center', va='bottom',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5),
rotation=-40)
# rechts unten
plt.figtext(0.82, 0.25, " B2 ", fontsize=18, ha='center', va='top',
bbox=dict(boxstyle="square", facecolor='grey', alpha=0.5),
rotation=40)
fig.suptitle(f"Overview position dependency '{file}'", fontsize=18)
fig.supxlabel("signal [mV]")
fig.supylabel("counts [1/h/mV]")
if args.export:
name = f"plots/overview-{args.filenumber}"
plt.savefig(name + ".png")
else:
plt.show()
# ---------------------------
# Itime
# ---------------------------
def read_Itime(file):
f = file + '.Itime'
while len(f) > 0:
if os.path.isfile(f + '.Itime'):
return int(pd.read_csv(f + '.Itime', sep='\s+', names=['time'])['time'][0])
f = f[:-1]
return 1
# ---------------------------
main()

View file

@ -1,107 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 2 13:21:02 2024
@author: ava
"""
import matplotlib.pyplot as plt
import argparse
import sys
import numpy as np
import pandas as pd
import os.path
from scipy.optimize import curve_fit
from fit_functions import lan
def main():
parser = argparse.ArgumentParser(description="This script plots overview for position dependencies in BigBGO (AHBGOC)")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filenumbers", type = int,nargs='+', help="number of files of wich data shall be plottet (14, 16, 18,19,20)")
parser.add_argument("-p", "--photoelectrons", action='store_true', help = "converts data from keV{Si} to amount of photoelectrons")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filename will be 'overview-[number]') \n second:format (png,pdf,...)")
args = parser.parse_args()
files=[]
numberstr=''
for num in args.filenumbers:
numberstr = numberstr + '-'+str(num)
if num == 14:
files.append("2023-12-21-AHBGOC-14-langzeit")
if num == 16:
files.append("2024-01-19-AHBGOC-rau-16_2weeks")
if num == 18:
files.append("2024-03-27-AHBGOC-six-18")
if num == 19:
files.append("2024-04-08-AHBGOC-six_30V-19")
if num == 20:
files.append("2024-04-11-AHBGOC-six-20")
if len(files)<1:
print("No valid filenamenumber, choose from '14', '16', '18' , '19' ,'20'.")
sys.exit()
energy = 'keV'
if args.photoelectrons:
f = 0.00362
energystr = '$e_{ph}$'
else:
f = 1.0
energystr = energy + '$_{Si}$'
plt.figure(figsize=(15,10))
for i in range(len(files)):
print(files[i])
filename = "fitparameters/" + files[i] + '_mpv_sums.txt'
data = pd.read_csv(filename, sep='\s+')
plt.plot(data[0],data[1],label=args.filenumbers[i])
if len(args.filenumbers)>1:
tit = "Overview MPVs of files " + numberstr
else:
tit = "Overview MPVs of '"+files[0]+"'"
layout(tit,energystr,f)
if not args.export:
plt.show()
else:
if args.export[0] == 'f':
name = 'plots/overview_mpvs'+numberstr
else:
name = args.export[0]
if len(args.export)>1:
end = args.export[1]
else:
end=''
plt.savefig(name+'.'+end)
################################################################
def layout(tit,energystr,f):
fs = 15
#lim = [30/f,280/f, 0.003*f,1.8*f]
ylab = 'Triggerposition'
xlab = 'mpv [' + energystr+']'
plt.legend(fontsize = fs)
plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs)
plt.title(tit, fontsize = fs+10, pad = 15)
plt.yscale('log')
plt.ylabel(ylab, fontsize = fs+5)
plt.xlabel(xlab, fontsize=fs+5)
#plt.ylim(lim[2],lim[3])
#plt.xlim(lim[0],lim[1])
main()

View file

@ -1,162 +0,0 @@
'''
Autor: Ava Pohley
This script prints spectra and temperatures of given datafiles over time
Option -c [cycles] Changes paramesters optimal for shorter timeperiods like in TVcycles
Option -s [specify] Asks further parameters to specify the plot
'''
import getopt
import sys
from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import matplotlib.dates as mdates
from datetime import datetime
import fileinput
def main():
opt, filepaths = getopt.getopt(sys.argv[1:], 'vcs')
files = ''
for line in fileinput.input(filepaths):
files.append(line)
print('opt:'+str(opt))
# for file in files:
# target_dir = Path(file)
# if not target_dir.exists():
# print("The file '"+file +"' does not exist")
# raise SystemExit(1)
n = 0
op = []
for o,a in opt:
op.append(o)
if '-s' in op:
tit = specification()
else:
tit=''
for name in files:
tit = tit + ' ' +name.split('/')[-1]
if '-c' in op:
n = 1
tit = 'AHBGO TvCycles' + tit
else:
n = 0
tit ='AHBGO TvTest' + tit
data = dataread(files, [])
date = convert_date(data)
ax, ax2, cbar = print_data(data,date,n)
layout(ax, ax2, cbar,n, tit)
plt.show()
def dataread(files, data):
filenames = ['','']
for name in files:
if name.split('.')[-1] == '2dhist':
filenames[0] = name
if name.split('.')[-1]== 'dau':
filenames[1] = name
colums = [['time', 'mV', 'counts'],['time', 'I', 'T1', 'T2', 'T3', 'T4']]
for i in range (0,2):
data.append(pd.read_csv(filenames[i], sep = ' ', delim_whitespace=False, skiprows=1, names = colums[i]))
return data
def convert_date(data):
date=[]
for dat in data:
d = []
for time in dat['time']:
d.append(pd.to_datetime(datetime.fromtimestamp(time)))
date.append(d)
return date
def T(x):
return np.divide(np.subtract(x,1000), 3.85)
def print_data(data, date, n):
fig, ax = plt.subplots()
vm = [100,50]
ax.margins(x=0)
# den scatterplot kannst du weglassen
plot = ax.scatter(date[0], data[0]['mV'], c=data[0]['counts'], norm = 'log', vmin=0.5, vmax = vm[n])
ax2=ax.twinx()
ax2.margins(y=0)
cbar = plt.colorbar(plot, orientation = 'vertical', shrink = 0.95, pad = 0.1)
colums = [['time', 'mV', 'counts'],['time', 'I', 'T1', 'T2', 'T3', 'T4']]
colors = ['orange', 'g', 'r', 'm']
for i in range(2,6):
ax2.plot(date[1], T(data[1][str(colums[1][i])]), '-', color = colors[i-2],label = str(colums[1][i]))
return ax, ax2, cbar
def specification():
titel = input('Titel des Plots:')
return titel
def layout(ax, ax2, cbar, n, tit):
fs = 15
ylabel1 = 'A [mV]'
ylabel2 = 'T [°C]'
clabel = 'counts'
xlabel = 'time'
y1min = 30
y1max = 500
y2min = -65
y2max = 50
ax.set_ylabel(ylabel1, fontsize = fs+5)
ax.set_ylim(y1min,y1max)
plt.yticks(fontsize=fs)
cbar.set_label(clabel, fontsize = fs+5)
cbar.ax.tick_params(labelsize=fs)
#ax.margins(x=0)
ax.set_xlabel(xlabel, fontsize = fs+5)
ax2.set_ylabel(ylabel2, fontsize = fs+5)
ax2.set_ylim(y2min, y2max)
plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs)
ax.tick_params(axis='x', labelsize=fs)
ax.tick_params(axis='y', labelsize=fs)
for label in (ax.get_xticklabels() + ax2.get_xticklabels()):
label.set_fontsize(fs-2)
plt.legend(fontsize = fs)
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%H:%M\n%d.Okt\n%Y'))
h = [10,[4,10,16,22]]
ax.xaxis.set_major_locator(mdates.HourLocator(byhour=h[n]))
plt.title(tit, fontsize = fs+4, pad = fs)
if __name__ == "__main__":
main()

View file

@ -1,89 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 21 13:33:03 2024
@author: ava
"""
import argparse
import sys
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os.path
def main():
parser = argparse.ArgumentParser(description="This script plots histogramms of given data ending on '.hist'")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("filepath", type = str, help="path/file were data is stored in")
parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filepath of histdata will be chosen with filepath_plot) \n second:format (png,pdf,...)")
parser.add_argument("-l", "--limits", type=str, nargs='+',help = "limits of plot in order xmin,xmax, ymin,ymax,")
args = parser.parse_args()
if args.verbose == None:
verbosity = 1
else:
verbosity = args.verbose
if verbosity == 2:
sys.stderr.write("--verbostiy = '" + str(args.verbose)+"'\n")
sys.stderr.write("--filepath = '" + str(args.filepath)+"'\n")
sys.stderr.write("--title = '" + str(args.title)+"'\n")
sys.stderr.write("--export = '" + str(args.export) +"'\n")
sys.stderr.write("--limits = '" + str(args.limits) +"'\n")
sys.stderr.write("--dhist = '" + str(args.dhist) +"'\n")
file = args.filepath
if args.title == None:
tit = 'Histplot, '+"'"+file.split('/')[-1]+"' "
else:
tit = args.title
data = pd.read_csv(file, sep='\s+', skiprows=1, names = ["dTime","counts"])
plt.figure(figsize=(15,10))
plt.step(data["dTime"], data["counts"], label='deltatimes')
fs = 15
lim = [0, 90000, 0.9, 30000]
if not args.limits == None:
for i in range(0,4):
if not args.limits[i] == None:
lim[i] = float(args.limits[i])
xlab = 'deltatime in $\mu$s'
ylab = 'counts'
plt.legend(fontsize = fs, loc="upper right")
plt.xticks(fontsize=fs)
plt.yticks(fontsize=fs)
plt.title(tit, fontsize = fs+10, pad = 15)
plt.yscale('log')
plt.ylabel(ylab, fontsize = fs+5)
plt.xlabel(xlab, fontsize=fs+5)
plt.ylim(lim[2],lim[3])
plt.xlim(lim[0],lim[1])
if args.export == None:
plt.show()
else:
if args.export[0] == 'f':
name = 'plots/dThist_' + file.split('/')[-1].split('.')[0]
else:
name = args.export[0]
if len(args.export)>1:
end = '.' + args.export[1]
else:
end=''
plt.savefig(name+end)
main()

View file

@ -1,126 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 21 11:22:59 2024
@author: Nicolas Rohrbeck
Program to show a plot of Temp and (Pressure is broken atm!!!) against time. Needs to be modified to be more commonly usable.
Calling syntax is: plot_tp.py -p FILE1 -T FILE2 -Tbgo FILE3
data usually stored in /home/falbala/stephan/solo/spectra/dau
"""
from matplotlib import pyplot as plt
import argparse
import pandas as pd
from datetime import datetime
import numpy as np
# argparse stuff
parser = argparse.ArgumentParser(description="This script returns a figure combinig 4 temperature and two pressure readings")
parser.add_argument("-p", type = str, help="path/file of pressure data")
parser.add_argument("-T", type = str, help="path/file of temperature data")
parser.add_argument("-Tbgo", type = str, help="path/file of BGO temp data")
args = parser.parse_args()
# files
file_p = args.p
file_T = args.T
file_Tbgo = args.Tbgo
# this function takes a resistance value and returns a temperature (author of the function: Ava Pohley)
def T(x):
return np.divide(np.subtract(x,1000), 3.85)
# extracting the data from files and saving them in a list of 3 dataframes. Note the order of p, T, Tbgo!
def extract(*files):
if not files[0]==None:#####!!!!!!!!
columns = [['time', 'p1', '0', 'p2', '5', '00' ], ['time', 'I', 'T1', 'T2', 'T3', 'T4'], ['time', 'Tbgo']]
data = []
data.append(pd.read_csv(files[0], sep=',', header = 0, names = columns[0], on_bad_lines='skip'))
temp1 = data[0].loc[:, 'time'].to_list()
for i in range(len(temp1)):
tentry = temp1[i].split(' ')[1]
temp1[i] = tentry
data[0].loc[:, 'time'] = pd.Series(temp1)
# unsure if its ok to skip faulty rows and if header 0 takes out the first line of values
for i in [1, 2]:
if not files[i]==None:
data.append(pd.read_csv(files[i], sep=' ', header = 0, names=columns[i], on_bad_lines='skip'))
return data
# converting a unix timestamp to a date
def sec_to_day(time):
time = time.to_list()
new_time = []
for i in time:
#ZUSATZBEDINGUNG int(i)
new_time.append(datetime.fromtimestamp(int(i)))
return new_time
# PLOT
# pressure breaks the PC. extracting is fine, but plotting somehow not
# x values
data = extract(file_p, file_T, file_Tbgo)
#tT = sec_to_day(data[1].loc[:, 'time'])
#tTbgo = sec_to_day(data[2].loc[:, 'time'])
#######AENDERUNG HIER AUCH SEC_TOTIME ANGEWENDET * SEC TO TIME ANGEPASST
tp = sec_to_day(data[0].loc[:, 'time'])
print(tp)
p1 = data[0].loc[:, 'p1']
print(p1)
p2 = data[0].loc[:, 'p2']
print(p2)
# T1 = T(data[1].loc[:, 'T1'])
# T2 = T(data[1].loc[:, 'T2'])
# T3 = T(data[1].loc[:, 'T3'])
# T4 = T(data[1].loc[:, 'T4'])
# Tbgo = data[2].loc[:, 'Tbgo']
# making the figure with 2 axes
fig = plt.figure()
ax1 = fig.add_subplot(111, label = "1")
##ax2 = fig.add_subplot(111, label = "2", frame_on = False)
# left axis
# ax1.plot(tT, T1, label="T1")
# ax1.set_xlabel("t/date")
# fig.autofmt_xdate(rotation=45)
# ax1.set_ylabel("$T/°C$")
# # rest of the temp curves
# ax1.plot(tT, T2, label="T2")
# ax1.plot(tT, T3, label="T3")
# ax1.plot(tT, T4,label="T4")
# ax1.plot(tTbgo, Tbgo, label="Tbgo")
# right axis
##ax2.plot(tp, p1)
##ax2.yaxis.tick_right()
##ax2.set_ylabel("p/")
##ax2.yaxis.set_label_position('right')
ax1.plot(tp, p1, label="p1")
ax1.plot(tp, p2, label="p2")
# second pressure curve
##ax2.plot(tp, p2)
#
plt.grid()
plt.legend()
plt.show()

View file

@ -89,6 +89,6 @@ ax.tick_params(axis='y', labelsize=15)
plt.yticks(fontsize=15) plt.yticks(fontsize=15)
plt.ylim(3000,8600) plt.ylim(3000,8600)
#plt.grid(True) #plt.grid(True)
plt.show() #plt.show()
#plt.savefig("temperature_dependence.pdf") plt.savefig("temperature_dependence.pdf")

View file

@ -1,135 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 13:54:06 2024
@author: Ava Pohley
"""
import argparse
import sys
import matplotlib.pyplot as plt
from datetime import datetime
import pandas as pd
import numpy as np
import os.path
import matplotlib.dates as mdates
def main():
parser = argparse.ArgumentParser(description="This script plots temperatures and pressures of given data ending on '.dau' or '.vac'")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("files", type=str, nargs='+', help="files were data is stored in")
parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filepath of histdata will be chosen with filepath_plot) \n second:format (png,pdf,...)")
#parser.add_argument("-l", "--limits", type=str, nargs='+',help = "limits of plot in order xmin,xmax, ymin,ymax,")
args = parser.parse_args()
if args.verbose == None:
verbosity = 1
else:
verbosity = args.verbose
if verbosity == 2:
sys.stderr.write("--verbostiy = '" + str(args.verbose)+"'\n")
sys.stderr.write("--files = '" + str(args.filepath)+"'\n")
sys.stderr.write("--title = '" + str(args.title)+"'\n")
sys.stderr.write("--export = '" + str(args.export) +"'\n")
#sys.stderr.write("--limits = '" + str(args.limits) +"'\n")
fig, ax = plt.subplots()
fig.figsize=(20,15)
secondax=0
cbar = None
ax2 = ax.twinx()
used_labels=[]
for file in args.files:
path,end = file.split('.')
if end == 'dau':
if secondax == 0:
secondax = 1
if 'AHBGO' in file:
names = ['$T_{BGO}$']
data = pd.read_csv(file, sep="\s+",names=['time']+names,skiprows=1, on_bad_lines='skip')
colors = ['tab:blue']
else:
names = ['T1','T2','T3','T4']
#time, I,T1,T2,T3,T4 = np.genfromtxt(file,dtype=np.dtype(str),delimiter=' ',usecols=(0,1,2,3,4,5),unpack=True,invalid_raise=False)
data = pd.read_csv(file, sep=' ',names=['time','I']+names, on_bad_lines='skip')
for n in names:
data[n] = T(data.loc[:, n])
colors = ['tab:orange','tab:green','tab:red','tab:purple']
time=[]
for t in data['time']: time.append(pd.to_datetime(datetime.fromtimestamp(t)))
for i in range(len(names)):
label = names[i]
if label in used_labels:
label = ""
else: used_labels.append(label)
ax2.plot(time,data[names[i]], color=colors[i],label = label)
elif end == '2dhist':
count = True
names = ['time', 'mV', 'counts']
data = pd.read_csv(file, sep = "\s+", skiprows=1, names = names)
time=[]
for t in data['time']: time.append(pd.to_datetime(datetime.fromtimestamp(t)))
plot = ax.scatter(time, data['mV'], c=data['counts'], norm = 'log', vmin=0.5, vmax = 100)
if cbar == None:
cbar = plt.colorbar(plot, orientation = 'vertical',location ='left', shrink = 0.95, pad = 0.1)
if count:
layout(ax,ax2,secondax,cbar)
if args.export == None:
plt.show()
else:
if args.export[0] == 'f1':
name = 'plots/vacmon_' + args.files[0].split('/')[-1].split('.')[0]
else:
name = args.export[0]
if len(args.export)>1:
end = '.' + args.export[1]
else:
end=''
plt.savefig(name+end)
else:
print('no valid file')
def T(x):
return np.divide(np.subtract(x,1000), 3.85)
def layout(ax,ax2,secondax,cbar):
fs=20
if not cbar == None:
ax2.margins(x=0)
ax.margins(y=0)
ax.tick_params(axis='x', labelsize=fs-3)
cbar.set_label('counts', fontsize = fs+5)
cbar.ax.tick_params(labelsize=fs)
ax.tick_params(axis='y', labelsize=fs)
ax.set_ylabel("signal [mV]", fontsize = fs)
if secondax > 0:
ax2.set_ylabel("T [°C]", fontsize = fs)
ax2.legend(fontsize=fs-2,loc = 'lower right')
ax2.tick_params(axis='x', labelsize=fs-3)
ax2.tick_params(axis='y', labelsize=fs)
plt.xticks(fontsize=fs)
plt.title("vacmonitor-2d.py", fontsize = fs+2)
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%H:%M\n%m-%d\n%Y'))
main()

View file

@ -1,143 +0,0 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 29 13:54:06 2024
@author: Ava Pohley
"""
import argparse
import sys
import matplotlib.pyplot as plt
import datetime as dt
from datetime import datetime
import pandas as pd
import numpy as np
import os.path
import matplotlib.dates as mdates
def main():
parser = argparse.ArgumentParser(description="This script plots temperatures and pressures of given data ending on '.dau' or '.vac'")
parser.add_argument("-v", "--verbose", choices = ['0','1','2'], help = "when zero only emit serious error messages; when one also emit warnings, when two emit informational messages")
parser.add_argument("files", type=str, nargs='+', help="files were data is stored in")
parser.add_argument("-t", "--title", type = str, help="title to use in plot; if not given a standard title will be chosen")
parser.add_argument("-e", "--export", type = str, nargs='+', help = "first: filepath were figure shall be exported to (if f, filepath of histdata will be chosen with filepath_plot) \n second:format (png,pdf,...)")
#parser.add_argument("-l", "--limits", type=str, nargs='+',help = "limits of plot in order xmin,xmax, ymin,ymax,")
args = parser.parse_args()
if args.verbose == None:
verbosity = 1
else:
verbosity = args.verbose
if verbosity == 2:
sys.stderr.write("--verbostiy = '" + str(args.verbose)+"'\n")
sys.stderr.write("--files = '" + str(args.filepath)+"'\n")
sys.stderr.write("--title = '" + str(args.title)+"'\n")
sys.stderr.write("--export = '" + str(args.export) +"'\n")
#sys.stderr.write("--limits = '" + str(args.limits) +"'\n")
fig, ax = plt.subplots()
fig.figsize=(20,15)
secondax=0
ax2 = None
used_labels=[]
for file in args.files:
path,end = file.split('.')
if end == 'dau':
if secondax == 0: secondax=1
if 'AHBGO' in file:
names = ['$T_{BGO}$']
data = pd.read_csv(file, sep=' ',names=['time']+names,skiprows=1, on_bad_lines='skip')
colors = ['tab:blue']
else:
names = ['T1','T2','T3','T4']
#time, I,T1,T2,T3,T4 = np.genfromtxt(file,dtype=np.dtype(str),delimiter=' ',usecols=(0,1,2,3,4,5),unpack=True,invalid_raise=False)
data = pd.read_csv(file, sep=' ',names=['time','I']+names, on_bad_lines='skip')
for n in names:
data[n] = T(data.loc[:, n])
colors = ['tab:orange','tab:green','tab:red','tab:purple']
time=[]
for t in data['time']: time.append(pd.to_datetime(datetime.fromtimestamp(t)))
for i in range(len(names)):
label = names[i]
if label in used_labels:
label = ""
else: used_labels.append(label)
ax.plot(time,data[names[i]], color=colors[i],label = label)
elif 'vac' in end:
if secondax < 2:
ax2=ax.twinx()
if secondax < 2: secondax = 2
else: secondax = 3
names = ['p1','p2']
data = pd.read_csv(file, sep=',',names=['time']+['p1', '0', 'p2', '00', '000'], on_bad_lines='skip')
colors = ['tab:cyan','tab:pink']
time = []
for t in data['time']:
time.append(pd.to_datetime(datetime.fromtimestamp(int(t.split(' ')[1]))))
for i in range(len(names)):
label = names[i]
if label in used_labels:
label = ""
else: used_labels.append(label)
ax2.plot(time,data[names[i]], color=colors[i],label = label)
if secondax > 0:
layout(ax,ax2,secondax)
if args.export == None:
plt.show()
else:
if args.export[0] == 'f1':
name = 'plots/vacmon_' + args.files[0].split('/')[-1].split('.')[0]
else:
name = args.export[0]
if len(args.export)>1:
end = '.' + args.export[1]
else:
end=''
plt.savefig(name+end)
else:
print('no valid file')
def T(x):
return np.divide(np.subtract(x,1000), 3.85)
def layout(ax,ax2,secondax):
fs=10
if secondax<3:
ax.set_ylabel("T [°C]", fontsize = fs)
ax.legend(fontsize=fs-2,loc = 'upper left')
ax.tick_params(axis='x', labelsize=fs-3)
ax.tick_params(axis='y', labelsize=fs)
if secondax > 1:
ax2.set_yscale('log')
ax2.set_ylabel("p [mbar]", fontsize = fs)
ax2.tick_params(axis='x', labelsize=fs-3)
ax.tick_params(axis='y', labelsize=fs)
ax2.legend(fontsize=fs-2, loc = 'upper right')
plt.xticks(fontsize=fs)
plt.title("vacmonitor.py", fontsize = fs+2)
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter('%H:%M\n%m-%d\n%Y'))
main()