A few small changes to revert unimportant edits and fix linting issues

This commit is contained in:
allevitan
2026-03-24 19:34:38 +01:00
parent f55b35f0dd
commit 4172a9a11a
4 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ model = cdtools.models.FancyPtycho.from_dataset(
probe_support_radius=120, # Force the probe to 0 outside a radius of 120 pix
propagation_distance=5e-3, # Propagate the initial probe guess by 5 mm
units='mm', # Set the units for the live plots
obj_view_crop=-50, # Expands the field of view in the object plot by 50 pix,
obj_view_crop=-50, # Expands the field of view in the object plot by 50 pix
)
if t.cuda.is_available():
+1 -1
View File
@@ -27,7 +27,7 @@ model = cdtools.models.FancyPtycho.from_dataset(
propagation_distance=3.65e-3, # 3.65 downstream from focus
units='um', # Set the units for the live plots
obj_view_crop=-35,
panel_plot_mode=True,
panel_plot_mode=True, # Set to False to get individual figures
)
if t.cuda.is_available():
+1 -1
View File
@@ -26,7 +26,7 @@ if t.cuda.is_available():
model.inspect(dataset)
# We run the reconstruction
for loss in model.Adam_optimize(30, dataset, batch_size=10):
for loss in model.Adam_optimize(100, dataset, batch_size=10):
# We print a quick report of the optimization status
print(model.report())
# And liveplot the updates to the model as they happen
+1 -4
View File
@@ -7,8 +7,6 @@ from cdtools.tools import analysis
from matplotlib import pyplot as plt
from datetime import datetime
import numpy as np
from scipy import linalg as sla
from copy import copy
__all__ = ['FancyPtycho']
@@ -557,7 +555,7 @@ class FancyPtycho(CDIModel):
else:
try:
Ws = t.ones(len(index)) # I'm positive this introduced a bug
except:
except TypeError:
Ws = 1
if self.weights is None or len(self.weights[0].shape) == 0:
@@ -782,7 +780,6 @@ class FancyPtycho(CDIModel):
# First we treat the incoherent but stable case, where the weights are
# just one per-shot overall weight
if self.weights.dim() == 1:
probe = self.probe.detach().cpu().numpy()
ortho_probes = analysis.orthogonalize_probes(self.probe.detach())
self.probe.data = ortho_probes
return