Skip to content

Commit

Permalink
Export all figures in docs as PNG
Browse files Browse the repository at this point in the history
  • Loading branch information
fhagemann committed Dec 29, 2024
1 parent 0e69c68 commit d026f6f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
10 changes: 7 additions & 3 deletions docs/src/man/charge_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,20 @@ Electron and hole clouds can be easily constructed using [`NBodyChargeCloud`](@r

One way of defining an [`NBodyChargeCloud`](@ref) is having a center point charge surrounded by shells with point charges on the vertices of platonic solids. For now, all shells will have the same number of charges and be oriented the same way.

````@example NBodyChargeCloud
````@setup NBodyChargeCloud
using SolidStateDetectors #hide
using Unitful #hide
using Plots #hide
gr(fmt = :png) #hide
T = Float64 #hide
````

````@example NBodyChargeCloud
center = CartesianPoint{T}([0,0,0])
energy = 1460u"keV"
nbcc = NBodyChargeCloud(center, energy)
plot(nbcc)
plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-0.0012,0.0012), zlims = (-0.0012,0.0012)) #hide
plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-0.0012,0.0012), zlims = (-0.0012,0.0012), fmt = :png) #hide
````

#### Equally Distributed on a Regular Sphere
Expand All @@ -296,7 +300,7 @@ center = CartesianPoint{T}([0,0,0])
energy = 1460u"keV"
nbcc = NBodyChargeCloud(center, energy, 100)
plot(nbcc)
plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-0.0012,0.0012), zlims = (-0.0012,0.0012)) #hide
plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-0.0012,0.0012), zlims = (-0.0012,0.0012), fmt = :png) #hide
````


Expand Down
1 change: 1 addition & 0 deletions docs/src/man/csg.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ can be specified in the configuration files.
using SolidStateDetectors
import SolidStateDetectors.ConstructiveSolidGeometry as CSG
using Plots
gr(fmt = :png) #hide
T = Float64;
nothing #hide
````
Expand Down
2 changes: 1 addition & 1 deletion docs/src/man/plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ First, we have to calculate something in order to demonstrate the plotting tools
using Plots
using SolidStateDetectors
using Unitful
gr(fmt = :png) #hide
gr(fmt = :png)
T = Float32
sim = Simulation{T}(SSD_examples[:InvertedCoax]);
Expand Down
50 changes: 20 additions & 30 deletions docs/src/tutorials/complete_simulation_chain_IVC_lit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ sim = Simulation{T}(SSD_examples[:InvertedCoax])

plot(sim.detector, xunit = u"mm", yunit = u"mm", zunit = u"mm", size = (700, 700))
#jl savefig("tutorial_det.pdf") # hide
#md savefig("tutorial_det.pdf") # hide
#md savefig("tutorial_det.svg"); nothing # hide
#md # [![tutorial_det](tutorial_det.svg)](tutorial_det.pdf)
#md savefig("tutorial_det.png"); nothing # hide
#md # [![tutorial_det](tutorial_det.png)](tutorial_det.png)

# By default only the contacts and passives are shown in detector plots. One can also take a look at the semiconductor. The following plots show the semiconductor and slices in the y and z direction.

Expand All @@ -22,9 +21,8 @@ plot(
layout = (1,3), size = (1500,500), legend = false
)
#jl savefig("tutorial_semiconductor.pdf") # hide
#md savefig("tutorial_semiconductor.pdf") # hide
#md savefig("tutorial_semiconductor.svg"); nothing # hide
#md # [![tutorial_semiconductor](tutorial_semiconductor.svg)](tutorial_semiconductor.pdf)
#md savefig("tutorial_semiconductor.png"); nothing # hide
#md # [![tutorial_semiconductor](tutorial_semiconductor.png)](tutorial_semiconductor.png)

# One can also have a look at how the initial conditions look like on the grid (its starts with a very coarse grid):

Expand All @@ -37,9 +35,8 @@ plot(
layout = (1, 4), size = (1600, 500)
)
#jl savefig("tutorial_initial_condition.pdf") # hide
#md savefig("tutorial_initial_condition.pdf") # hide
#md savefig("tutorial_initial_condition.svg"); nothing # hide
#md # [![tutorial_initial_condition](tutorial_initial_condition.svg)](tutorial_initial_condition.pdf)
#md savefig("tutorial_initial_condition.png"); nothing # hide
#md # [![tutorial_initial_condition](tutorial_initial_condition.png)](tutorial_initial_condition.png)


# Next, calculate the electric potential:
Expand All @@ -55,9 +52,8 @@ plot(
layout = (1, 4), size = (1600, 500)
)
#jl savefig("tutorial_calculated_potential.pdf") # hide
#md savefig("tutorial_calculated_potential.pdf") # hide
#md savefig("tutorial_calculated_potential.svg"); nothing # hide
#md # [![tutorial_calculated_potential](tutorial_calculated_potential.svg)](tutorial_calculated_potential.pdf)
#md savefig("tutorial_calculated_potential.png"); nothing # hide
#md # [![tutorial_calculated_potential](tutorial_calculated_potential.png)](tutorial_calculated_potential.png)

# SolidStateDetectors.jl supports active (i.e. depleted) volume calculation:

Expand Down Expand Up @@ -90,9 +86,8 @@ plot(
layout = (1, 3), size = (1200, 600)
)
#jl savefig("tutorial_calculated_potential_undep.pdf") # hide
#md savefig("tutorial_calculated_potential_undep.pdf") # hide
#md savefig("tutorial_calculated_potential_undep.svg"); nothing # hide
#md # [![tutorial_calculated_potential_undep](tutorial_calculated_potential_undep.svg)](tutorial_calculated_potential_undep.pdf)
#md savefig("tutorial_calculated_potential_undep.png"); nothing # hide
#md # [![tutorial_calculated_potential_undep](tutorial_calculated_potential_undep.png)](tutorial_calculated_potential_undep.png)

#

Expand All @@ -119,9 +114,8 @@ plot(sim.electric_field, full_det = true, φ = 0.0, size = (700, 700),
xunit = u"mm", yunit = u"mm", zunit = u"V/mm", clims = (0,800).*u"V/mm")
plot_electric_fieldlines!(sim, full_det = true, φ = 0.0)
#jl savefig("tutorial_electric_field.pdf") # hide
#md savefig("tutorial_electric_field.pdf") # hide
#md savefig("tutorial_electric_field.svg"); nothing # hide
#md # [![tutorial_electric_field](tutorial_electric_field.svg)](tutorial_electric_field.pdf)
#md savefig("tutorial_electric_field.png"); nothing # hide
#md # [![tutorial_electric_field](tutorial_electric_field.png)](tutorial_electric_field.png)


# ## Simulation of charge drifts
Expand Down Expand Up @@ -150,9 +144,8 @@ drift_charges!(evt, sim, Δt = time_step)
plot(sim.detector, xunit = u"mm", yunit = u"mm", zunit = u"mm", size = (700, 700))
plot!(evt.drift_paths)
#jl savefig("tutorial_drift_paths.pdf") # hide
#md savefig("tutorial_drift_paths.pdf") # hide
#md savefig("tutorial_drift_paths.svg"); nothing # hide
#md # [![tutorial_drift_paths](tutorial_drift_paths.svg)](tutorial_drift_paths.pdf)
#md savefig("tutorial_drift_paths.png"); nothing # hide
#md # [![tutorial_drift_paths](tutorial_drift_paths.png)](tutorial_drift_paths.png)


# ## Weighting potential calculation
Expand All @@ -172,9 +165,8 @@ plot(
size = (900, 700)
)
#jl savefig("tutorial_weighting_potentials.pdf") # hide
#md savefig("tutorial_weighting_potentials.pdf") # hide
#md savefig("tutorial_weighting_potentials.svg"); nothing # hide
#md # [![tutorial_weighting_potentials](tutorial_weighting_potentials.svg)](tutorial_weighting_potentials.pdf)
#md savefig("tutorial_weighting_potentials.png"); nothing # hide
#md # [![tutorial_weighting_potentials](tutorial_weighting_potentials.png)](tutorial_weighting_potentials.png)

# ## Detector Capacitance Matrix

Expand All @@ -193,16 +185,14 @@ simulate!(evt, sim) # drift_charges + signal generation of all channels
p_pc_signal = plot( evt.waveforms[1], lw = 1.5, xlims = (0, 1100), xlabel = "Time", unitformat = :slash,
legend = false, tickfontsize = 12, ylabel = "Charge", guidefontsize = 14)
#jl savefig("tutorial_waveforms.pdf") # hide
#md savefig("tutorial_waveforms.pdf") # hide
#md savefig("tutorial_waveforms.svg"); nothing # hide
#md # [![tutorial_waveforms](tutorial_waveforms.svg)](tutorial_waveforms.pdf)
#md savefig("tutorial_waveforms.png"); nothing # hide
#md # [![tutorial_waveforms](tutorial_waveforms.png)](tutorial_waveforms.png)

# SolidStateDetectors.jl also allows to separate the observed charge signal into the charge induced by the electrons and the charge induced by the holes.

contact_id = 1
plot_electron_and_hole_contribution(evt, sim, contact_id, xlims = (0, 1100), xlabel = "Time",
legend = :topleft, tickfontsize = 12, ylabel = "Charge", guidefontsize = 14)
#jl savefig("tutorial_waveform_contributions.pdf") # hide
#md savefig("tutorial_waveform_contributions.pdf") # hide
#md savefig("tutorial_waveform_contributions.svg"); nothing # hide
#md # [![tutorial_waveform_contributions](tutorial_waveform_contributions.svg)](tutorial_waveform_contributions.pdf)
#md savefig("tutorial_waveform_contributions.png"); nothing # hide
#md # [![tutorial_waveform_contributions](tutorial_waveform_contributions.png)](tutorial_waveform_contributions.png)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Plots
using SolidStateDetectors
using Unitful
#md gr(fmt = :png); nothing # hide

sim = Simulation{Float32}(SSD_examples[:InfiniteParallelPlateCapacitor])
plot( sim.detector.semiconductor, fillalpha = 0.4)
Expand Down

0 comments on commit d026f6f

Please sign in to comment.