Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/time.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* remove time dependency in pip, conda.txt

**Security:**

* <news item>
1 change: 0 additions & 1 deletion requirements/conda.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
h5py
time
tk
matplotlib-base
numpy
1 change: 0 additions & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
h5py
time
tk
matplotlib
numpy
8 changes: 0 additions & 8 deletions src/diffpy/fourigui/fourigui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import time
import tkinter as tk
from tkinter.ttk import Button

Expand Down Expand Up @@ -392,15 +391,12 @@ def fft(self):
"""

def perform_fft(fftholder):
time0 = time.time()
fftholder = np.nan_to_num(fftholder)
size = list(fftholder.shape)
fftholder = np.fft.ifftshift(fftholder)
fftholder = np.fft.fftn(fftholder, s=size, norm="ortho")
fftholder = np.fft.fftshift(fftholder)
fftholder = fftholder.real
fftdur = time.time() - time0
print("- FFT performed in {} sec.".format(round(fftdur, 4)))
return fftholder

if not self.transformed and not self.transcutted: # no fft at all yet
Expand Down Expand Up @@ -469,7 +465,6 @@ def applycutoff(self):
"""
if not self.cutted:

time0 = time.time()
X, Y, Z = self.cube.shape
sphere = np.ones((X, Y, Z))
qmin = float(self.qminentry.get())
Expand All @@ -482,21 +477,18 @@ def applycutoff(self):
R2 = (XS - X // 2) ** 2 + (YS - Y // 2) ** 2 + (ZS - Z // 2) ** 2
mask = (R2 <= r2_inner) | (R2 >= r2_outer)
sphere[mask] = np.nan
cutdur = time.time() - time0

if self.space.get():
self.cube_real = self.cube
self.cube = self.cube_reci * sphere
self.cube_recicut = self.cube
print("- Cutoff below {} and beyond {} in {} sec.".format(qmin, qmax, round(cutdur, 4)))
self.fft()
else:
self.cube_reci = self.cube
self.cube = self.cube * sphere
self.cube_recicut = self.cube
self.plot_plane()
self.intensity_upd_global()
print("- Cutoff below {} and beyond {} in {} sec.".format(qmin, qmax, round(cutdur, 4)))

self.cutted = True

Expand Down