Skip to content

Commit

Permalink
specifying matplotlib with backend and using the default monitor inst…
Browse files Browse the repository at this point in the history
…ead of tensorboard monitor
  • Loading branch information
ShantanuKodgirwar committed Jun 24, 2024
1 parent efc95e4 commit 4e28e01
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions example_scripts/exampleReconstructionCPM.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import logging
from pathlib import Path

import matplotlib
import matplotlib.pyplot as plt

matplotlib.use("qt5agg")
import PtyLab
from PtyLab import Engines
from PtyLab.Engines.BaseEngine import smooth_amplitude
Expand Down Expand Up @@ -49,10 +51,14 @@
experimentalData, reconstruction, params, monitor, ePIE_engine = PtyLab.easyInitialize(
fileName, operationMode="CPM"
)

# optional - use tensorboard monitor instead. To see the results, open tensorboard in the directory ./logs_tensorboard
from PtyLab.Monitor.TensorboardMonitor import TensorboardMonitor
tensorboard_monitor = False
if tensorboard_monitor:
from PtyLab.Monitor.TensorboardMonitor import TensorboardMonitor

monitor = TensorboardMonitor()

monitor = TensorboardMonitor()

# turn these two lines on to see the autofocusing in action
# experimentalData.zo = experimentalData.zo + 1e-2
Expand Down Expand Up @@ -184,7 +190,7 @@
params.TV_autofocus = i % 2 == 1
params.l2reg = i % 2 == 0

mPIE.reconstruct(experimentalData, reconstruction)
mPIE.reconstruct()
reconstruction.saveResults(f"{getExampleDataFolder()}/recon.hdf5", squeeze=False)

plt.show()

0 comments on commit 4e28e01

Please sign in to comment.