mirror of
https://github.com/cdtools-developers/cdtools.git
synced 2026-09-20 01:22:09 +02:00
A few small changes to revert unimportant edits and fix linting issues
This commit is contained in:
@@ -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():
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user