Skip to content

Commit 9458d85

Browse files
committed
Added header comments. Renamed phd-of-rho-and-z-two-layer-compute-fluence.py to phd-of-rho-and-z-compute-fluence.py because homogeneous solution not two layer.
1 parent 5bf5be4 commit 9458d85

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

forward-solvers/fluence-of-rho-and-z-two-layer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# This is an example of python code using VTS to Compute fluence for a two-layer
2-
# medium as a function of radial extent and depth at a given set of optical properties
2+
# medium as a function of radial extent and depth at a given set of optical properties.
3+
# A two-layer SDA forward solver is used to compute the fluence with optical properties
4+
# defined in opRegions[0] opRegions[1], and top layer thickness defined in topLayerThickness [mm].
5+
# The fluence as a function of rho and z is determined and when displayed, it is mirrored
6+
# to show full fluence.
37
#
48
# Import PythonNet
59
from pythonnet import load
@@ -92,4 +96,5 @@ def heatmap(values, x, y, x_label="", y_label="", title=""):
9296
return fig
9397

9498
fluenceChart = heatmap(allFluenceRowsToPlot.tolist(), allRhos.tolist(), list(zs), "ρ [mm]", "z [mm]", "log(Φ(ρ, z) [mm-2])")
95-
fluenceChart.show(renderer="browser")
99+
fluenceChart.add_hline(y=topLayerThickness, line_dash="dash", line_color="white", line_width=2)
100+
fluenceChart.show(renderer="browser")

forward-solvers/phd-of-rho-and-z-two-layer-compute-fluence.py renamed to forward-solvers/phd-of-rho-and-z-compute-fluence.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This is an example of python code using VTS to Compute photon hitting density for a two-layer
2-
# medium at a given set of optical properties
1+
# This is an example of python code using VTS to Compute photon hitting density for homogeneous
2+
# medium at a given set of optical properties opRegions[0].
33
# This sample uses ComputeFluence in place of calling FluenceOfRhoAndZ on the forward solver object
44
# and it uses a distributed point source SDA Forward Solver
55
#
@@ -35,9 +35,8 @@
3535
solver = DistributedPointSourceSDAForwardSolver()
3636

3737
topLayerThickness = 5
38-
opRegions = Array.CreateInstance(IOpticalPropertyRegion, 2)
38+
opRegions = Array.CreateInstance(IOpticalPropertyRegion, 1)
3939
opRegions[0] = LayerOpticalPropertyRegion(DoubleRange(0, topLayerThickness, 2), OpticalProperties(0.1, 1, 0.8, 1.4))
40-
opRegions[1] = LayerOpticalPropertyRegion(DoubleRange(topLayerThickness, Double.PositiveInfinity, 2), OpticalProperties(0.01, 1, 0.8, 1.4))
4140
# Create the DoubleRange instance
4241
rhos_range = DoubleRange(0.1, 19.9, 100) # range of s-d separations in mm
4342

@@ -105,4 +104,4 @@ def heatmap(values, x, y, x_label="", y_label="", title=""):
105104
return fig
106105

107106
fluenceChart = heatmap(phdRowsToPlot.tolist(), allRhos.tolist(), list(zs), "ρ [mm]", "z [mm]", "log(phd(ρ, z) [mm-2])")
108-
fluenceChart.show(renderer="browser")
107+
fluenceChart.show(renderer="browser")

forward-solvers/phd-of-rho-and-z-two-layer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This is an example of python code using VTS to Compute photon hitting density for a two-layer
2-
# medium at a given set of optical properties
2+
# medium at a given set of optical properties. A two-layer SDA forward solver is used to
3+
# compute the photon hitting density with optical properties defined in opRegions[0] and
4+
# opRegions[1], and top layer thickness defined in topLayerThickness [mm].
35
#
46
# Import PythonNet
57
from pythonnet import load

0 commit comments

Comments
 (0)