


辅助数据:首先在第一行输入temperature :300K,emissivity:0.1;



辅助数据:
首先在第一行输入temperature :300K,emissivity: 0.1;


单透镜参数设定:F=100, bend=0, 位置位于坐标原点

在菜单栏中选择Create/Element Primitive /plane


光源类型选择为任意平面,光源半角设定为15度。




到此,所有的光学结构和属性设定完成,通过光线追迹我们可以查看光线是否可以穿过元件。


打开后清空里面的内容,此脚本为通用脚本适用于一切可热成像的应用。 绿色字体为说明文字, '#Language "WWB-COM"'script for calculating thermal image map'edited rnp 4 november 2005 'declarationsDim op As T_OPERATIONDim trm As T_TRIMVOLUMEDim irrad(32,32) As Double 'make consistent with samplingDim temp As DoubleDim emiss As DoubleDim fname As String, fullfilepath As String 'Option Explicit Sub Main 'USER INPUTS nx = 31 ny = 31 numRays = 1000 minWave = 7 'microns maxWave = 11 'microns sigma = 5.67e-14 'watts/mm^2/deg k^4 fname = "teapotimage.dat" Print "" Print "THERMAL IMAGE CALCULATION" detnode = FindFullName( "Geometry.Detector.Surface" ) '找到探测器平面节点 Print "found detector array at node " & detnode srcnode = FindFullName( "Optical Sources.Source 1" ) '找到光源节点 Print "found differential detector area at node " & srcnode GetTrimVolume detnode, trm detx = trm.xSemiApe dety = trm.ySemiApe area = 4 * detx * dety Print "detector array semiaperture dimensions are " & detx & " by " & dety Print "sampling is " & nx & " by " & ny 'reset differential detector area dimensions to be consistent with sampling pixelx = 2 * detx / nx pixely = 2 * dety / ny SetSourcePosGridRandom srcnode, pixelx / 2, pixely / 2, numRays, False Print "resetting source dimensions to " & pixelx / 2 & " by " & pixely / 2 'reset the source power SetSourcePower( srcnode, Sin(DegToRad(15))^2 ) Print "resetting the source power to " & GetSourcePower( srcnode ) & " units" 'zero out irradiance array For i = 0 To ny - 1 For j = 0 To nx - 1 irrad(i,j) = 0.0 Next j Next i 'main loop EnableTextPrinting( False ) ypos = dety + pixely / 2 For i = 0 To ny - 1 xpos = -detx - pixelx / 2 ypos = ypos - pixely EnableTextPrinting( True ) Print i EnableTextPrinting( False ) For j = 0 To nx - 1 xpos = xpos + pixelx 'shift source LockOperationUpdates srcnode, True GetOperation srcnode, 1, op op.val1 = xpos op.val2 = ypos SetOperation srcnode, 1, op LockOperationUpdates srcnode, False 'raytrace DeleteRays CreateSource srcnode TraceExisting 'draw 'radiometry For k = 0 To GetEntityCount()-1 If IsSurface( k ) Then temp = AuxDataGetData( k, "temperature" ) emiss = AuxDataGetData( k, "emissivity" ) If ( temp <> 0 And emiss <> 0 ) Then ProjSolidAngleByPi = GetSurfIncidentPower( k ) frac = BlackBodyFractionalEnergy ( minWave, maxWave, temp ) irrad(i,j) = irrad(i,j) + frac * emiss * sigma * temp^4 * ProjSolidAngleByPi End If End If Next k Next j Next i EnableTextPrinting( True ) 'write out file fullfilepath = CurDir() & "\" & fname Open fullfilepath For Output As #1 Print #1, "GRID " & nx & " " & ny Print #1, "1e+308" Print #1, pixelx & " " & pixely Print #1, -detx+pixelx/2 & " " & -dety+pixely/2 maxRow = nx - 1 maxCol = ny - 1 For rowNum = 0 To maxRow ' begin loop over rows (constant X) row = "" For colNum = maxCol To 0 Step -1 ' begin loop over columns (constant Y) row = row & irrad(colNum,rowNum) & " " ' append column data to row string Next colNum ' end loop over columns Print #1, row Next rowNum ' end loop over rows Close #1 Print "File written: " & fullfilepath Print "All done!!"End Sub 在输出报告中,我们会看到脚本对光源的孔径和功率做了修改,并最终经过31次迭代,将所有的热成像数据以dat的格式放置于:

找到Tools工具,点击Open plot files in 3D chart并找到该文件

打开后,选择二维平面图:
