Skip to content

Commit 1d8a5f4

Browse files
committed
Ported to Python 3.9
1 parent 0751daf commit 1d8a5f4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

planetary_system_stacker/alignment_points.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from math import ceil
3030
from numpy import arange, amax, stack, amin, float32, uint8, zeros, sqrt, empty, int32, uint16
3131
from scipy import ndimage
32-
from skimage.feature import register_translation
32+
from skimage.registration import phase_cross_correlation
3333
from cv2 import meanStdDev, GaussianBlur
3434

3535
from align_frames import AlignFrames
@@ -801,8 +801,11 @@ def compute_shift_alignment_point(self, frame_mono_blurred, frame_index, alignme
801801
# explained above.
802802
box_in_frame = frame_mono_blurred[y_low + dy:y_high + dy,
803803
x_low + dx:x_high + dx]
804-
shift_pixel, error, diffphase = register_translation(
805-
alignment_point['reference_box'], box_in_frame, 10, space='real')
804+
# The following use of "phase_cross_correlation" replaces the original call to
805+
# "register_translation" which seems not to be in the package anymore. If this
806+
# replacement really works has not been tested.
807+
shift_pixel, error, diffphase = phase_cross_correlation(
808+
alignment_point['reference_box'], box_in_frame, upsample_factor=10)
806809

807810
# Use a simple phase shift computation (contained in module "miscellaneous").
808811
elif self.configuration.alignment_points_method == 'CrossCorrelation':

planetary_system_stacker/workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,14 @@ def execute_align_frames(self, y_low_opt, y_high_opt, x_low_opt, x_high_opt):
679679
def execute_set_roi(self, y_min, y_max, x_min, x_max):
680680

681681
self.set_status_bar_processing_phase("setting the ROI")
682-
if self.configuration.global_parameters_protocol_level > 0 and y_min != 0 or y_max != 0:
682+
if self.configuration.global_parameters_protocol_level > 0 and (y_min != 0 or y_max != 0):
683683
Miscellaneous.protocol("+++ Start setting a ROI and computing a new reference frame +++",
684684
self.attached_log_file)
685685
self.my_timer.create_no_check('Setting ROI and new reference')
686686
self.align_frames.set_roi(y_min, y_max, x_min, x_max)
687687
self.my_timer.stop('Setting ROI and new reference')
688688

689-
if self.configuration.global_parameters_protocol_level > 1 and y_min != 0 or y_max != 0:
689+
if self.configuration.global_parameters_protocol_level > 1 and (y_min != 0 or y_max != 0):
690690
Miscellaneous.protocol(
691691
" ROI, set by the user: " + str(y_min) + "<y<" + str(y_max) + ", " + str(
692692
x_min) + "<x<" + str(x_max), self.attached_log_file,

setup_windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
packages=setuptools.find_packages(),
1818
ext_modules=None,
1919
install_requires=[
20-
'numpy == 1.18.4',
20+
'numpy',
2121
'matplotlib',
2222
'psutil',
23-
'PyQt5 >= 5.15',
23+
'PyQt5',
2424
'scipy',
2525
'astropy',
2626
'scikit-image',
@@ -34,7 +34,7 @@
3434
# "Operating System :: OS Independent"
3535
"Operating System :: Microsoft :: Windows"
3636
],
37-
python_requires='>=3.5, <3.7',
37+
python_requires='>=3.5',
3838
entry_points={
3939
"console_scripts": [
4040
"PlanetarySystemStacker=planetary_system_stacker.planetary_system_stacker:main",

0 commit comments

Comments
 (0)