文章目录
- 加载数据
- 孔径内分析
加载数据
prysm提供了干涉仪类,用相位图的后处理。在其sample_data中,贴心地提供了Zygo干涉仪的测量数据,其地址为:https://github.com/brandondube/prysm/raw/master/sample_files/,其中的【valid_zygo_dat_file.dat】即为干涉仪数据,如下图所示
代码如下
fromprysm.interferogramimportInterferogramfromprysm.sample_dataimportsample_filesfrommatplotlibimportpyplotasplt plt.rcParams['font.sans-serif']='Times New Roman'path=sample_files('dat')interf=Interferogram.from_zygo_dat(path)interf.plot2d()plt.show()孔径内分析
在干涉测量中,通常用PV值和RMS来衡量光学表面的不平整度, 但是在上图中,边缘处的落差非常大,且测量数据中还有Nan值,为此需要对上述图像做进一步处理,步骤如下
第一步是把有效数据筛选出来,即无效部分置Nan;第二步将有效数据从网格中抠出来;第三步是去除倾斜等操作,代码如下
fromprysm.geometryimportcircle interf.recenter()interf.mask(circle(12,interf.r))interf.plot2d(ax=plt.subplot(131))interf.crop()interf.plot2d(interpolation='bilinear',ax=plt.subplot(132))interf.recenter()interf.remove_piston()interf.remove_tiptilt()interf.remove_power()interf.plot2d(interpolation='bilinear',ax=plt.subplot(133))plt.show()【mask】用于掩膜,功能是把掩膜区域之外的数据置为Nan;【crop】用一个选框将非Nan数据截取出来。
【remove_piston】和【remove_tiptilt】分别去除像差的活塞和倾斜项。【remove_power】则通过最小二乘法去除数据中的功率项。在经过这些处理之后,PV和RMS值如下,单位是nm。
interf.pv# np.float64(76.201950828473)interf.rms# np.float64(25.75297772229068)