Skip to content

Commit 880361a

Browse files
committed
black formatting
1 parent e2555e5 commit 880361a

2 files changed

Lines changed: 49 additions & 52 deletions

File tree

py4DSTEM/braggvectors/probe.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,19 +367,19 @@ def zero_vacuum_sinusoid(self, s=0.1, w=1, p=1, update_inplace=True):
367367
self.origin is not None
368368
), "no probe origin found; try running `Probe.measure_disk`"
369369
# prepare vars
370-
qx0,qy0 = self.origin
370+
qx0, qy0 = self.origin
371371
alpha = self.alpha
372372
probe = self.probe
373-
Q_Nx,Q_Ny = probe.shape
373+
Q_Nx, Q_Ny = probe.shape
374374
# setup mesh
375-
qyy,qxx = np.meshgrid(np.arange(Q_Ny),np.arange(Q_Nx))
376-
qrr = np.hypot(qxx-qx0,qyy-qy0)
375+
qyy, qxx = np.meshgrid(np.arange(Q_Ny), np.arange(Q_Nx))
376+
qrr = np.hypot(qxx - qx0, qyy - qy0)
377377
# find damping curve
378-
r = alpha*(1+s)
379-
_w = alpha*w
380-
f = 1+(r-qrr)/_w
381-
f = np.minimum(np.maximum(f,0),1)
382-
f = np.sin(f)**p
378+
r = alpha * (1 + s)
379+
_w = alpha * w
380+
f = 1 + (r - qrr) / _w
381+
f = np.minimum(np.maximum(f, 0), 1)
382+
f = np.sin(f) ** p
383383
# scale probe
384384
probe *= f
385385
# update
@@ -388,7 +388,6 @@ def zero_vacuum_sinusoid(self, s=0.1, w=1, p=1, update_inplace=True):
388388
# return scaled probe
389389
return probe
390390

391-
392391
# Kernel generation methods
393392

394393
def get_kernel(
@@ -626,6 +625,7 @@ def get_probe_kernel_edge_sigmoid(
626625
# Get CoM
627626
if origin is None:
628627
from py4DSTEM.process.calibration import get_probe_size
628+
629629
_, xCoM, yCoM = get_probe_size(probe)
630630
else:
631631
xCoM, yCoM = origin
@@ -639,7 +639,7 @@ def get_probe_kernel_edge_sigmoid(
639639
np.mod(np.arange(Q_Ny) + Q_Ny // 2, Q_Ny) - Q_Ny // 2,
640640
np.mod(np.arange(Q_Nx) + Q_Nx // 2, Q_Nx) - Q_Nx // 2,
641641
)
642-
qr = np.hypot(qx,qy)
642+
qr = np.hypot(qx, qy)
643643
# Calculate sigmoid
644644
if type == "logistic":
645645
r0 = 0.5 * (ro + ri)

py4DSTEM/datacube/datacube.py

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -607,64 +607,62 @@ def get_vacuum_probe(
607607

608608
# show
609609
if plot:
610-
fig,axs = plt.subplots(2,3,figsize=(12,8))
610+
fig, axs = plt.subplots(2, 3, figsize=(12, 8))
611611
show(
612612
probe.probe,
613-
scaling='log',
614-
circle = {
615-
'center':probe.origin,
616-
'R': probe.alpha,
617-
'alpha':0.2,
618-
'fill':True
613+
scaling="log",
614+
circle={
615+
"center": probe.origin,
616+
"R": probe.alpha,
617+
"alpha": 0.2,
618+
"fill": True,
619619
},
620-
figax = (fig,axs[0,0])
620+
figax=(fig, axs[0, 0]),
621621
)
622622
show(
623623
probe.probe,
624-
scaling='none',
625-
intensity_range='minmax',
626-
circle = {
627-
'center':probe.origin,
628-
'R': probe.alpha,
629-
'alpha':0.2,
630-
'fill':True
624+
scaling="none",
625+
intensity_range="minmax",
626+
circle={
627+
"center": probe.origin,
628+
"R": probe.alpha,
629+
"alpha": 0.2,
630+
"fill": True,
631631
},
632-
figax = (fig,axs[0,1])
632+
figax=(fig, axs[0, 1]),
633633
)
634634
show(
635635
probe.probe,
636-
scaling='none',
637-
intensity_range='absolute',
638-
vmin=0,vmax=np.max(probe.probe)*0.1,
639-
circle = {
640-
'center':probe.origin,
641-
'R': probe.alpha,
642-
'alpha':0.2,
643-
'fill':True
636+
scaling="none",
637+
intensity_range="absolute",
638+
vmin=0,
639+
vmax=np.max(probe.probe) * 0.1,
640+
circle={
641+
"center": probe.origin,
642+
"R": probe.alpha,
643+
"alpha": 0.2,
644+
"fill": True,
644645
},
645-
figax = (fig,axs[0,2])
646+
figax=(fig, axs[0, 2]),
646647
)
648+
show(probe.probe, scaling="log", figax=(fig, axs[1, 0]))
647649
show(
648650
probe.probe,
649-
scaling='log',
650-
figax = (fig,axs[1,0])
651+
scaling="none",
652+
intensity_range="minmax",
653+
figax=(fig, axs[1, 1]),
651654
)
652655
show(
653656
probe.probe,
654-
scaling='none',
655-
intensity_range='minmax',
656-
figax = (fig,axs[1,1])
657+
scaling="none",
658+
intensity_range="absolute",
659+
vmin=0,
660+
vmax=np.max(probe.probe) * 0.1,
661+
figax=(fig, axs[1, 2]),
657662
)
658-
show(
659-
probe.probe,
660-
scaling='none',
661-
intensity_range='absolute',
662-
vmin=0,vmax=np.max(probe.probe)*0.1,
663-
figax = (fig,axs[1,2])
664-
)
665-
axs[0,0].set_title('log')
666-
axs[0,1].set_title('linear | min/max')
667-
axs[0,2].set_title('linear | min/0.1*max')
663+
axs[0, 0].set_title("log")
664+
axs[0, 1].set_title("linear | min/max")
665+
axs[0, 2].set_title("linear | min/0.1*max")
668666
plt.show()
669667

670668
# add probe to tree and return
@@ -765,7 +763,6 @@ def get_probe_size(
765763
if returncal:
766764
return x
767765

768-
769766
# Bragg disks
770767

771768
def find_Bragg_disks(

0 commit comments

Comments
 (0)