拉曼整体图:完成信息(还需要调整表达)

This commit is contained in:
2025-04-12 15:58:07 +08:00
parent 44623daf8d
commit 2aa72c4f3e
29 changed files with 156 additions and 120 deletions

View File

@@ -62,36 +62,36 @@ def export(mode_id):
frame.OutputDataSetType = 'vtkPolyData' frame.OutputDataSetType = 'vtkPolyData'
frame.Script = """input_data = self.GetInput() frame.Script = """input_data = self.GetInput()
# 创建输出数据结构vtkPolyData # 创建输出数据结构vtkPolyData
output = self.GetOutput() output = self.GetOutput()
points = vtk.vtkPoints() points = vtk.vtkPoints()
lines = vtk.vtkCellArray() lines = vtk.vtkCellArray()
# 遍历CSV的每一行每条线段 # 遍历CSV的每一行每条线段
for row_idx in range(input_data.GetNumberOfRows()): for row_idx in range(input_data.GetNumberOfRows()):
# 获取起点坐标(假设列名格式) # 获取起点坐标(假设列名格式)
start_x = input_data.GetValueByName(row_idx, "x0").ToDouble() start_x = input_data.GetValueByName(row_idx, "x0").ToDouble()
start_y = input_data.GetValueByName(row_idx, "y0").ToDouble() start_y = input_data.GetValueByName(row_idx, "y0").ToDouble()
start_z = input_data.GetValueByName(row_idx, "z0").ToDouble() start_z = input_data.GetValueByName(row_idx, "z0").ToDouble()
# 获取终点坐标 # 获取终点坐标
end_x = input_data.GetValueByName(row_idx, "x1").ToDouble() end_x = input_data.GetValueByName(row_idx, "x1").ToDouble()
end_y = input_data.GetValueByName(row_idx, "y1").ToDouble() end_y = input_data.GetValueByName(row_idx, "y1").ToDouble()
end_z = input_data.GetValueByName(row_idx, "z1").ToDouble() end_z = input_data.GetValueByName(row_idx, "z1").ToDouble()
# 添加点到点集 # 添加点到点集
start_id = points.InsertNextPoint(start_x, start_y, start_z) start_id = points.InsertNextPoint(start_x, start_y, start_z)
end_id = points.InsertNextPoint(end_x, end_y, end_z) end_id = points.InsertNextPoint(end_x, end_y, end_z)
# 创建线段 # 创建线段
line = vtk.vtkLine() line = vtk.vtkLine()
line.GetPointIds().SetId(0, start_id) line.GetPointIds().SetId(0, start_id)
line.GetPointIds().SetId(1, end_id) line.GetPointIds().SetId(1, end_id)
lines.InsertNextCell(line) lines.InsertNextCell(line)
# 设置输出数据 # 设置输出数据
output.SetPoints(points) output.SetPoints(points)
output.SetLines(lines)""" output.SetLines(lines)"""
frame.RequestInformationScript = '' frame.RequestInformationScript = ''
frame.RequestUpdateExtentScript = '' frame.RequestUpdateExtentScript = ''
frame.PythonPath = '' frame.PythonPath = ''
@@ -476,8 +476,10 @@ def export(mode_id):
SetActiveSource(a3csv) SetActiveSource(a3csv)
# ---------------------------------------------------------------- # ----------------------------------------------------------------
renderView1.Update() # 强制更新视图
Render()
# ImageResolution=[1920, 1080] # ImageResolution=[1920, 1080]
SaveScreenshot(f'mode/z/{mode_id}.png', TransparentBackground=True) SaveScreenshot(f'mode/z/{mode_id}.png', renderView1, TransparentBackground=True)
for i in [*range(3, 9), *range(11, 21), 23]: for i in range(3, 24):
export(i) export(i)

Binary file not shown.

View File

@@ -0,0 +1,9 @@
vx,vy,vz
0,0,0.04986
0,0,-0.10462
0,0,-0.04986
0,0,0.10462
0,0,0.06389
0,0,-0.01697
0,0,-0.06389
0,0,0.01697
1 vx vy vz
2 0 0 0.04986
3 0 0 -0.10462
4 0 0 -0.04986
5 0 0 0.10462
6 0 0 0.06389
7 0 0 -0.01697
8 0 0 -0.06389
9 0 0 0.01697

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 56 KiB

View File

@@ -0,0 +1,9 @@
vx,vy,vz
0,0,0.05431
0,0,-0.03742
0,0,-0.05431
0,0,0.03742
0,0,-0.11183
0,0,-0.03075
0,0,0.11183
0,0,0.03075
1 vx vy vz
2 0 0 0.05431
3 0 0 -0.03742
4 0 0 -0.05431
5 0 0 0.03742
6 0 0 -0.11183
7 0 0 -0.03075
8 0 0 0.11183
9 0 0 0.03075

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -0,0 +1,9 @@
vx,vy,vz
0,0,0.03648
0,0,0.0542
0,0,-0.03648
0,0,-0.0542
0,0,0.03046
0,0,-0.11228
0,0,-0.03046
0,0,0.11228
1 vx vy vz
2 0 0 0.03648
3 0 0 0.0542
4 0 0 -0.03648
5 0 0 -0.0542
6 0 0 0.03046
7 0 0 -0.11228
8 0 0 -0.03046
9 0 0 0.11228

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -0,0 +1,9 @@
vx,vy,vz
0,0,0.10505
0,0,0.05019
0,0,-0.10505
0,0,-0.05019
0,0,0.01692
0,0,0.06295
0,0,-0.01692
0,0,-0.06295
1 vx vy vz
2 0 0 0.10505
3 0 0 0.05019
4 0 0 -0.10505
5 0 0 -0.05019
6 0 0 0.01692
7 0 0 0.06295
8 0 0 -0.01692
9 0 0 -0.06295

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -1864,8 +1864,13 @@
<Element index="2" value="1"/> <Element index="2" value="1"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14541" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14546" servers="16">
<Property name="Source" id="14541.Source" number_of_elements="1"> <Property name="Source" id="14546.Source" number_of_elements="1">
<Proxy value="13143"/>
</Property>
</Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14538" servers="16">
<Property name="Source" id="14538.Source" number_of_elements="1">
<Proxy value="13154"/> <Proxy value="13154"/>
</Property> </Property>
</Proxy> </Proxy>
@@ -3090,18 +3095,18 @@
<Element index="2" value="1"/> <Element index="2" value="1"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14538" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14539" servers="16">
<Property name="Source" id="14538.Source" number_of_elements="1"> <Property name="Source" id="14539.Source" number_of_elements="1">
<Proxy value="13391"/> <Proxy value="13391"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14539" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14540" servers="16">
<Property name="Source" id="14539.Source" number_of_elements="1"> <Property name="Source" id="14540.Source" number_of_elements="1">
<Proxy value="13402"/> <Proxy value="13402"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14542" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14541" servers="16">
<Property name="Source" id="14542.Source" number_of_elements="1"> <Property name="Source" id="14541.Source" number_of_elements="1">
<Proxy value="13413"/> <Proxy value="13413"/>
</Property> </Property>
</Proxy> </Proxy>
@@ -4326,13 +4331,13 @@
<Element index="2" value="1"/> <Element index="2" value="1"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14543" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14542" servers="16">
<Property name="Source" id="14543.Source" number_of_elements="1"> <Property name="Source" id="14542.Source" number_of_elements="1">
<Proxy value="13650"/> <Proxy value="13650"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="14546" servers="16"> <Proxy group="misc" type="RepresentationAnimationHelper" id="14543" servers="16">
<Property name="Source" id="14546.Source" number_of_elements="1"> <Property name="Source" id="14543.Source" number_of_elements="1">
<Proxy value="13661"/> <Proxy value="13661"/>
</Property> </Property>
</Proxy> </Proxy>
@@ -9047,11 +9052,6 @@
<Domain name="range" id="12874.GridColor.range"/> <Domain name="range" id="12874.GridColor.range"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="misc" type="RepresentationAnimationHelper" id="17604" servers="16">
<Property name="Source" id="17604.Source" number_of_elements="1">
<Proxy value="17592"/>
</Property>
</Proxy>
<Proxy group="representations" type="GeometryRepresentation" id="13112" servers="21"> <Proxy group="representations" type="GeometryRepresentation" id="13112" servers="21">
<Property name="DataAxesGrid" id="13112.DataAxesGrid" number_of_elements="1"> <Property name="DataAxesGrid" id="13112.DataAxesGrid" number_of_elements="1">
<Proxy value="12883"/> <Proxy value="12883"/>
@@ -16020,37 +16020,37 @@
<Domain name="range" id="265.WidgetColor.range"/> <Domain name="range" id="265.WidgetColor.range"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="sources" type="CSVReader" id="17592" servers="1"> <Proxy group="sources" type="CSVReader" id="13143" servers="1">
<Property name="FileName" id="17592.FileName" number_of_elements="1"> <Property name="FileName" id="13143.FileName" number_of_elements="1">
<Element index="0" value="/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv"/> <Element index="0" value="/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv"/>
<Domain name="files" id="17592.FileName.files"/> <Domain name="files" id="13143.FileName.files"/>
</Property> </Property>
<Property name="FileNameInfo" id="17592.FileNameInfo" number_of_elements="1"> <Property name="FileNameInfo" id="13143.FileNameInfo" number_of_elements="1">
<Element index="0" value="/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv"/> <Element index="0" value="/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv"/>
</Property> </Property>
<Property name="TimestepValues" id="17592.TimestepValues"/> <Property name="TimestepValues" id="13143.TimestepValues"/>
<Property name="AddTabFieldDelimiter" id="17592.AddTabFieldDelimiter" number_of_elements="1"> <Property name="AddTabFieldDelimiter" id="13143.AddTabFieldDelimiter" number_of_elements="1">
<Element index="0" value="0"/> <Element index="0" value="0"/>
<Domain name="bool" id="17592.AddTabFieldDelimiter.bool"/> <Domain name="bool" id="13143.AddTabFieldDelimiter.bool"/>
</Property> </Property>
<Property name="DetectNumericColumns" id="17592.DetectNumericColumns" number_of_elements="1"> <Property name="DetectNumericColumns" id="13143.DetectNumericColumns" number_of_elements="1">
<Element index="0" value="1"/> <Element index="0" value="1"/>
<Domain name="bool" id="17592.DetectNumericColumns.bool"/> <Domain name="bool" id="13143.DetectNumericColumns.bool"/>
</Property> </Property>
<Property name="FieldDelimiterCharacters" id="17592.FieldDelimiterCharacters" number_of_elements="1"> <Property name="FieldDelimiterCharacters" id="13143.FieldDelimiterCharacters" number_of_elements="1">
<Element index="0" value=","/> <Element index="0" value=","/>
</Property> </Property>
<Property name="HaveHeaders" id="17592.HaveHeaders" number_of_elements="1"> <Property name="HaveHeaders" id="13143.HaveHeaders" number_of_elements="1">
<Element index="0" value="1"/> <Element index="0" value="1"/>
<Domain name="bool" id="17592.HaveHeaders.bool"/> <Domain name="bool" id="13143.HaveHeaders.bool"/>
</Property> </Property>
<Property name="MergeConsecutiveDelimiters" id="17592.MergeConsecutiveDelimiters" number_of_elements="1"> <Property name="MergeConsecutiveDelimiters" id="13143.MergeConsecutiveDelimiters" number_of_elements="1">
<Element index="0" value="0"/> <Element index="0" value="0"/>
<Domain name="bool" id="17592.MergeConsecutiveDelimiters.bool"/> <Domain name="bool" id="13143.MergeConsecutiveDelimiters.bool"/>
</Property> </Property>
<Property name="UseStringDelimiter" id="17592.UseStringDelimiter" number_of_elements="1"> <Property name="UseStringDelimiter" id="13143.UseStringDelimiter" number_of_elements="1">
<Element index="0" value="1"/> <Element index="0" value="1"/>
<Domain name="bool" id="17592.UseStringDelimiter.bool"/> <Domain name="bool" id="13143.UseStringDelimiter.bool"/>
</Property> </Property>
</Proxy> </Proxy>
<Proxy group="filters" type="AppendAttributes" id="13413" servers="1"> <Proxy group="filters" type="AppendAttributes" id="13413" servers="1">
@@ -16313,7 +16313,7 @@
<Domain name="bool" id="13154.Create2DPoints.bool"/> <Domain name="bool" id="13154.Create2DPoints.bool"/>
</Property> </Property>
<Property name="Input" id="13154.Input" number_of_elements="1"> <Property name="Input" id="13154.Input" number_of_elements="1">
<Proxy value="17592" output_port="0"/> <Proxy value="13143" output_port="0"/>
<Domain name="groups" id="13154.Input.groups"/> <Domain name="groups" id="13154.Input.groups"/>
<Domain name="input_array" id="13154.Input.input_array"/> <Domain name="input_array" id="13154.Input.input_array"/>
<Domain name="input_type" id="13154.Input.input_type"/> <Domain name="input_type" id="13154.Input.input_type"/>
@@ -16583,14 +16583,14 @@
<Proxy value="12906"/> <Proxy value="12906"/>
<Proxy value="13391"/> <Proxy value="13391"/>
<Proxy value="13402"/> <Proxy value="13402"/>
<Proxy value="17592"/> <Proxy value="13143"/>
<Proxy value="13154"/> <Proxy value="13154"/>
<Proxy value="13413"/> <Proxy value="13413"/>
<Proxy value="13650"/> <Proxy value="13650"/>
<Proxy value="13749"/> <Proxy value="13749"/>
<Proxy value="14066"/> <Proxy value="14066"/>
<Proxy value="13661"/> <Proxy value="13661"/>
<Proxy value="17592"/> <Proxy value="13143"/>
</Property> </Property>
<Property name="TimestepValues" id="256.TimestepValues"/> <Property name="TimestepValues" id="256.TimestepValues"/>
<Property name="Views" id="256.Views" number_of_elements="1"> <Property name="Views" id="256.Views" number_of_elements="1">
@@ -17375,8 +17375,11 @@
<Item id="13044" name="ScaleTransferFunction" logname="GeometryRepresentation1/PointGaussianRepresentation/ScaleTransferFunction/PiecewiseFunction"/> <Item id="13044" name="ScaleTransferFunction" logname="GeometryRepresentation1/PointGaussianRepresentation/ScaleTransferFunction/PiecewiseFunction"/>
<Item id="13045" name="TextureTransform" logname="GeometryRepresentation1/SurfaceRepresentation/TextureTransform/Transform2"/> <Item id="13045" name="TextureTransform" logname="GeometryRepresentation1/SurfaceRepresentation/TextureTransform/Transform2"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13143">
<Item id="14546" name="RepresentationAnimationHelper"/>
</ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13154"> <ProxyCollection name="pq_helper_proxies.13154">
<Item id="14541" name="RepresentationAnimationHelper"/> <Item id="14538" name="RepresentationAnimationHelper"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13360"> <ProxyCollection name="pq_helper_proxies.13360">
<Item id="13131" name="DataAxesGrid" logname="GeometryRepresentation2/DataAxesGrid/GridAxesRepresentation"/> <Item id="13131" name="DataAxesGrid" logname="GeometryRepresentation2/DataAxesGrid/GridAxesRepresentation"/>
@@ -17395,13 +17398,13 @@
<Item id="13293" name="TextureTransform" logname="GeometryRepresentation2/SurfaceRepresentation/TextureTransform/Transform2"/> <Item id="13293" name="TextureTransform" logname="GeometryRepresentation2/SurfaceRepresentation/TextureTransform/Transform2"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13391"> <ProxyCollection name="pq_helper_proxies.13391">
<Item id="14538" name="RepresentationAnimationHelper"/>
</ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13402">
<Item id="14539" name="RepresentationAnimationHelper"/> <Item id="14539" name="RepresentationAnimationHelper"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13402">
<Item id="14540" name="RepresentationAnimationHelper"/>
</ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13413"> <ProxyCollection name="pq_helper_proxies.13413">
<Item id="14542" name="RepresentationAnimationHelper"/> <Item id="14541" name="RepresentationAnimationHelper"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13619"> <ProxyCollection name="pq_helper_proxies.13619">
<Item id="13379" name="DataAxesGrid" logname="GeometryRepresentation3/DataAxesGrid/GridAxesRepresentation"/> <Item id="13379" name="DataAxesGrid" logname="GeometryRepresentation3/DataAxesGrid/GridAxesRepresentation"/>
@@ -17420,10 +17423,10 @@
<Item id="13552" name="TextureTransform" logname="GeometryRepresentation3/SurfaceRepresentation/TextureTransform/Transform2"/> <Item id="13552" name="TextureTransform" logname="GeometryRepresentation3/SurfaceRepresentation/TextureTransform/Transform2"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13650"> <ProxyCollection name="pq_helper_proxies.13650">
<Item id="14543" name="RepresentationAnimationHelper"/> <Item id="14542" name="RepresentationAnimationHelper"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13661"> <ProxyCollection name="pq_helper_proxies.13661">
<Item id="14546" name="RepresentationAnimationHelper"/> <Item id="14543" name="RepresentationAnimationHelper"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.13749"> <ProxyCollection name="pq_helper_proxies.13749">
<Item id="13649" name="GlyphTransform" logname="Glyph1/GlyphTransform/Transform2"/> <Item id="13649" name="GlyphTransform" logname="Glyph1/GlyphTransform/Transform2"/>
@@ -17500,9 +17503,6 @@
<Item id="12871" name="LegendGrid" logname="RenderView1/LegendGrid/LegendGridActor"/> <Item id="12871" name="LegendGrid" logname="RenderView1/LegendGrid/LegendGridActor"/>
<Item id="12874" name="PolarGrid" logname="RenderView1/PolarGrid/PolarGridActor"/> <Item id="12874" name="PolarGrid" logname="RenderView1/PolarGrid/PolarGridActor"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="pq_helper_proxies.17592">
<Item id="17604" name="RepresentationAnimationHelper"/>
</ProxyCollection>
<ProxyCollection name="representations"> <ProxyCollection name="representations">
<Item id="13112" name="GeometryRepresentation1" logname="GeometryRepresentation1"/> <Item id="13112" name="GeometryRepresentation1" logname="GeometryRepresentation1"/>
<Item id="13360" name="GeometryRepresentation2" logname="GeometryRepresentation2"/> <Item id="13360" name="GeometryRepresentation2" logname="GeometryRepresentation2"/>
@@ -17520,7 +17520,7 @@
<Item id="265" name="ColorPalette"/> <Item id="265" name="ColorPalette"/>
</ProxyCollection> </ProxyCollection>
<ProxyCollection name="sources"> <ProxyCollection name="sources">
<Item id="17592" name="3.csv" logname="3.csv"/> <Item id="13143" name="3.csv" logname="3.csv"/>
<Item id="13413" name="AppendAttributes1" logname="AppendAttributes1"/> <Item id="13413" name="AppendAttributes1" logname="AppendAttributes1"/>
<Item id="13402" name="atom" logname="TableToPoints1"/> <Item id="13402" name="atom" logname="TableToPoints1"/>
<Item id="13749" name="atom" logname="Glyph1"/> <Item id="13749" name="atom" logname="Glyph1"/>

View File

@@ -49,6 +49,18 @@ SetActiveView(renderView1)
# setup the data processing pipelines # setup the data processing pipelines
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# create a new 'CSV Reader'
atomcsv = CSVReader(registrationName='atom.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/atom.csv'])
# create a new 'CSV Reader'
a3csv = CSVReader(registrationName='3.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv'])
# create a new 'Table To Points'
atom = TableToPoints(registrationName='atom', Input=atomcsv)
atom.XColumn = 'x'
atom.YColumn = 'y'
atom.ZColumn = 'z'
# create a new 'CSV Reader' # create a new 'CSV Reader'
framecsv = CSVReader(registrationName='frame.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/frame.csv']) framecsv = CSVReader(registrationName='frame.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/frame.csv'])
@@ -91,9 +103,6 @@ frame.RequestInformationScript = ''
frame.RequestUpdateExtentScript = '' frame.RequestUpdateExtentScript = ''
frame.PythonPath = '' frame.PythonPath = ''
# create a new 'CSV Reader'
a3csv = CSVReader(registrationName='3.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/mode/z/3.csv'])
# create a new 'Table To Points' # create a new 'Table To Points'
mode = TableToPoints(registrationName='mode', Input=a3csv) mode = TableToPoints(registrationName='mode', Input=a3csv)
mode.XColumn = 'vx' mode.XColumn = 'vx'
@@ -101,15 +110,6 @@ mode.YColumn = 'vy'
mode.ZColumn = 'vz' mode.ZColumn = 'vz'
mode.KeepAllDataArrays = 1 mode.KeepAllDataArrays = 1
# create a new 'CSV Reader'
atomcsv = CSVReader(registrationName='atom.csv', FileName=['/home/chn/repo/SiC-2nd-paper/画图/拉曼整体图/atom.csv'])
# create a new 'Table To Points'
atom = TableToPoints(registrationName='atom', Input=atomcsv)
atom.XColumn = 'x'
atom.YColumn = 'y'
atom.ZColumn = 'z'
# create a new 'Append Attributes' # create a new 'Append Attributes'
appendAttributes1 = AppendAttributes(registrationName='AppendAttributes1', Input=[atom, mode]) appendAttributes1 = AppendAttributes(registrationName='AppendAttributes1', Input=[atom, mode])
@@ -123,6 +123,19 @@ radius = Calculator(registrationName='radius', Input=velocity)
radius.ResultArrayName = 'radius' radius.ResultArrayName = 'radius'
radius.Function = '(type == 0)*1.18 + (type == 1)*0.77' radius.Function = '(type == 0)*1.18 + (type == 1)*0.77'
# create a new 'Glyph'
atom_1 = Glyph(registrationName='atom', Input=radius,
GlyphType='Sphere')
atom_1.OrientationArray = ['POINTS', 'No orientation array']
atom_1.ScaleArray = ['POINTS', 'radius']
atom_1.ScaleFactor = 1.5
atom_1.GlyphTransform = 'Transform2'
atom_1.GlyphMode = 'All Points'
# init the 'Sphere' selected for 'GlyphType'
atom_1.GlyphType.ThetaResolution = 64
atom_1.GlyphType.PhiResolution = 64
# create a new 'Glyph' # create a new 'Glyph'
velocity_1 = Glyph(registrationName='velocity', Input=radius, velocity_1 = Glyph(registrationName='velocity', Input=radius,
GlyphType='Arrow') GlyphType='Arrow')
@@ -139,19 +152,6 @@ velocity_1.GlyphType.TipLength = 0.15
velocity_1.GlyphType.ShaftResolution = 64 velocity_1.GlyphType.ShaftResolution = 64
velocity_1.GlyphType.ShaftRadius = 0.05 velocity_1.GlyphType.ShaftRadius = 0.05
# create a new 'Glyph'
atom_1 = Glyph(registrationName='atom', Input=radius,
GlyphType='Sphere')
atom_1.OrientationArray = ['POINTS', 'No orientation array']
atom_1.ScaleArray = ['POINTS', 'radius']
atom_1.ScaleFactor = 1.5
atom_1.GlyphTransform = 'Transform2'
atom_1.GlyphMode = 'All Points'
# init the 'Sphere' selected for 'GlyphType'
atom_1.GlyphType.ThetaResolution = 64
atom_1.GlyphType.PhiResolution = 64
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# setup the visualization in view 'renderView1' # setup the visualization in view 'renderView1'
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@@ -427,35 +427,33 @@ separate_atom_1Display_typeLUTColorBar.Visibility = 0
# note: the Get..() functions create a new object, if needed # note: the Get..() functions create a new object, if needed
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# get opacity transfer function/opacity map for 'radius' # get opacity transfer function/opacity map for 'type'
radiusPWF = GetOpacityTransferFunction('radius') typePWF = GetOpacityTransferFunction('type')
radiusPWF.Points = [0.2, 0.0, 0.5, 0.0, 2.0, 1.0, 0.5, 0.0] typePWF.ScalarRangeInitialized = 1
radiusPWF.ScalarRangeInitialized = 1
# get separate opacity transfer function/opacity map for 'type' # get separate opacity transfer function/opacity map for 'type'
separate_atom_1Display_typePWF = GetOpacityTransferFunction('type', atom_1Display, separate=True) separate_atom_1Display_typePWF = GetOpacityTransferFunction('type', atom_1Display, separate=True)
separate_atom_1Display_typePWF.ScalarRangeInitialized = 1 separate_atom_1Display_typePWF.ScalarRangeInitialized = 1
# get opacity transfer function/opacity map for 'type' # get opacity transfer function/opacity map for 'radius'
typePWF = GetOpacityTransferFunction('type') radiusPWF = GetOpacityTransferFunction('radius')
typePWF.ScalarRangeInitialized = 1 radiusPWF.Points = [0.2, 0.0, 0.5, 0.0, 2.0, 1.0, 0.5, 0.0]
radiusPWF.ScalarRangeInitialized = 1
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# setup animation scene, tracks and keyframes # setup animation scene, tracks and keyframes
# note: the Get..() functions create a new object, if needed # note: the Get..() functions create a new object, if needed
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# get time animation track
timeAnimationCue1 = GetTimeTrack()
# initialize the animation scene
# get the time-keeper # get the time-keeper
timeKeeper1 = GetTimeKeeper() timeKeeper1 = GetTimeKeeper()
# initialize the timekeeper # initialize the timekeeper
timeKeeper1.SuppressedTimeSources = framecsv timeKeeper1.SuppressedTimeSources = framecsv
# get time animation track
timeAnimationCue1 = GetTimeTrack()
# initialize the animation track # initialize the animation track
# get animation scene # get animation scene
@@ -466,9 +464,11 @@ animationScene1.ViewModules = renderView1
animationScene1.Cues = timeAnimationCue1 animationScene1.Cues = timeAnimationCue1
animationScene1.AnimationTime = 0.0 animationScene1.AnimationTime = 0.0
# initialize the animation scene
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# restore active source # restore active source
SetActiveSource(a3csv) SetActiveSource(frame)
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@@ -495,6 +495,4 @@ SetActiveSource(a3csv)
# #
## Please refer to the documentation of paraview.simple ## Please refer to the documentation of paraview.simple
## https://www.paraview.org/paraview-docs/latest/python/paraview.simple.html ## https://www.paraview.org/paraview-docs/latest/python/paraview.simple.html
##-------------------------------------------- ##--------------------------------------------
# ImageResolution=[1920, 1080]
SaveScreenshot('output.png', TransparentBackground=True)