-1

我有一个通过信号分离器发送的激光。90% 的光进入扩散器并由光电倍增管 (PMT) 检测。其他 10% 的信号进入一个单独的硅光电二极管,用于在漫射器测试期间监控激光器的功率。漫射器在 -60° 到 +60° 的范围内旋转,每 3° 停止一次,以记录来自 PMT 和光电二极管的光信号区域(这称为一次扫描)。光电二极管记录的数据用于标准化 PMT 的面积,如下所示:

angle1 = np.array(PMT1[0]), area1 = np.array(PMT[1])
p1 = np.array(diode1[1]), `area1_norm = area1 * 0.01 / p1 

数据以 (x,y) = ([角度], [面积]) 表示。我想计算扩散器每个角度位置的归一化 PMT 区域的平均值和标准偏差。所以说三组光电二极管区域:

PMT1 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],[7.099,7.317,7.543,7.811,7.955,8.194,8.292,8.558,8.862,8.906,9.166,9.265,9.354,9.641,9.748,9.856,9.906,9.805,9.936,9.950,9.892,9.944,9.867,9.808,9.696,9.732,9.624,9.480,9.389,9.244,9.187,8.955,8.673,8.538,8.227,8.161,7.966,7.679,7.442,7.307,7.017])
diode1 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],[0.01011,0.01007,0.01013,0.01005,0.01014,0.01018,0.01013,0.01021,0.01020,0.01020,0.01019,0.01028,0.01021,0.01026,0.01025,0.01020,0.01024,0.01029,0.01019,0.01023,0.01027,0.01019,0.01031,0.01030,0.01031,0.01034,0.01021,0.01019,0.01019,0.01025,0.01034,0.01020,0.01024,0.01029,0.01011,0.01013,0.01025,0.01013,0.01025,0.01004,0.01003])
 
PMT2 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],([6.947,7.196,7.376,7.610,7.853,8.096,8.299,8.410,8.567,8.702,8.896,9.1429.425,9.400,9.527,9.654,9.614,9.870,9.943,9.998,10.05,9.969,9.951,9.957,9.828,9.803.9.629,9.419,9.313,9.170,9.084,8.885,8.793,8.513,8.328,8.130,7.939,7.677,7.431,7.184,6.905])
diode2 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],[0.01016,0.01004,0.01019,0.01023,0.01018,0.01022,0.01036,0.01027,0.01023,0.01034,0.01033,0.01026,0.01028,0.01040,0.01035,0.01034,0.01032,0.01039,0.01021,0.01036,0.01035,0.01025,0.01024,0.01035,0.01034,0.01030,0.01028,0.01038,0.01020,0.01024,0.01028,0.01017,0.01014,0.01025,0.01022,0.01025,0.01022,0.01025,0.01022,0.01025,0.01021])
 
PMT3 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],[7.116,7.364,7.668,7.868,8.011,8.321,8.567,8.699,8.876,9.154,9.346,9.591,9.524,9.744,9.969,9.989,10.08,10.20,10.16,10.13,10.19,10.11,10.03,10.03,9.936,9.732,9.655,9.492,9.305,9.245,9.120,8.877,8.833,8.635,8.470,8.217,7.980,7.844,7.534,7.336,6.966])
diode3 = ([-60,-57,-54,-51,-48,-45,-42,-39,-36,-33,-30,-27,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60],[0.01016,0.01004,0.01019,0.01023,0.01018,0.01022,0.01036,0.01027,0.01023,0.01034,0.01033,0.01026,0.01028,0.01040,0.01035,0.01034,0.01032,0.01039,0.01021,0.01036,0.01035,0.01025,0.01024,0.01035,0.01034,0.01030,0.01028,0.01038,0.01020,0.01024,0.01028,0.01017,0.01014,0.01025,0.01022,0.01025,0.01022,0.01025,0.01022,0.01025,0.01021,0.01006,0.01021,001020,0.01012])

我会使用diode1 数据来标准化PMT1 中的y 值等等。每个数据集的 x 值都是相同的,因为它们只是重复扫描。我有兴趣计算每个相应 x 角度的 y 值(对于 PMT)的平均值和标准偏差。所以对于每个角度,我应该有一个平均归一化 PMT 面积的值和一个归一化 PMT 面积的标准偏差值。我希望这是有道理的,并提前感谢您的帮助!

4

1 回答 1

0

您似乎想计算三个列表的平均值和标准差。

import numpy as np

PMT1 = ([-60,-57,-54,-51,-48,-45,-42,-39], [7.099,7.317,7.543,7.811,7.955,8.194,8.292,8.558])
diode1 = ([-60,-57,-54,-51,-48,-45,-42,-39], [0.01011,0.01007,0.01013,0.01005,0.01014,0.01018,0.01013,0.01021])
 
PMT2 = ([-60,-57,-54,-51,-48,-45,-42,-39], [6.947,7.196,7.376,7.610,7.853,8.096,8.299,8.410])
diode2 = ([-60,-57,-54,-51,-48,-45,-42,-39], [0.01016,0.01004,0.01019,0.01023,0.01018,0.01022,0.01036,0.01027])
 
PMT3 = ([-60,-57,-54,-51,-48,-45,-42,-39], [7.116,7.364,7.668,7.868,8.011,8.321,8.567,8.699])
diode3 = ([-60,-57,-54,-51,-48,-45,-42,-39], [0.01016,0.01004,0.01019,0.01023,0.01018,0.01022,0.01036,0.01027])

PMT_angles=np.asarray(PMT1[0])

PMT_areas = np.asarray([PMT1[1], PMT2[1], PMT3[1]])
PMT_area_mean = PMT_areas.mean(axis=0)
PMT_area_std = PMT_areas.std(axis=0)

print("data are not normalized", PMT_angles, PMT_area_mean, PMT_area_std, sep="\n")


diodes = np.asarray([diode1[1], diode2[1], diode3[1]])
PMT_areas_norm = PMT_areas * 0.01 / diodes
PMT_area_norm_mean = PMT_areas_norm.mean(axis=0)
PMT_area_norm_std = PMT_areas_norm.std(axis=0)

print("normalized data", PMT_angles, PMT_area_norm_mean, PMT_area_norm_std, sep="\n")

样本输出:

data are not normalized
[-60 -57 -54 -51 -48 -45 -42 -39]
[7.054      7.29233333 7.529      7.763      7.93966667 8.20366667
 8.386      8.55566667]
[0.07597807 0.07076879 0.11961884 0.11066165 0.06540812 0.09210984
 0.12801823 0.11799529]
normalized data
[-60 -57 -54 -51 -48 -45 -42 -39]
[6.95443202 7.25604302 7.40323101 7.63404969 7.8095549  8.03757223
 8.15517005 8.34706   ]
[0.08293366 0.06868433 0.12086692 0.1418983  0.06818333 0.09024843
 0.10777657 0.11750536]
于 2022-01-16T16:29:06.320 回答