Skip to content

Commit

Permalink
Merge pull request #130 from ratt-ru/version_161
Browse files Browse the repository at this point in the history
Prepare release 1.6.1
  • Loading branch information
bennahugo authored May 23, 2022
2 parents d69b7be + 0a01b5a commit bdfe29a
Show file tree
Hide file tree
Showing 36 changed files with 856 additions and 245 deletions.
354 changes: 323 additions & 31 deletions .github/workflows/installation.yml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
Tigger Changelog
================

1.6.1
=====

* Version bump in preparation for release
* Supports Ubuntu 22.04
* Beta support for Ubuntu 22.04 ARM64
* Added FITS header preview pane to file dialog
* Dependent on the latest tigger-lsm (1.7.1)
* Fixed float errors with updated library API's
* Fixed dockable widgets and window sizing
* Refactored plot zooming
* Re-enabled splash screen
* Fixes venv pip3 bug
* Fixes issue #131
* Install script 'setup.py install' has been replaced by pip
* Updated URL's
* GitHub Actions are now compatible with 'act'
* Actions now test VENV installations on Ubuntu 20.04 and 22.04
* Improved Action tests and logging

1.6.0
=====

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_REPO=radioastro/tigger:1.6.0
DOCKER_REPO=radioastro/tigger:1.6.1

.PHONY: build clean

Expand Down
36 changes: 24 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Tigger
======

|actionsbadge| |actionspypibadge| |versionbadge|

.. |actionsbadge| image:: https://github.com/ratt-ru/tigger/workflows/Tigger%20Ubuntu%20CI/badge.svg
:target: https://github.com/ratt-ru/tigger/actions
.. |actionspypibadge| image:: https://github.com/ratt-ru/tigger/workflows/Deploy%20Python%20Package/badge.svg
:target: https://github.com/ratt-ru/tigger/actions
.. |versionbadge| image:: https://img.shields.io/github/v/release/ratt-ru/tigger
:target: https://github.com/ratt-ru/tigger/releases
:alt: GitHub release (latest by date)

.. image:: https://user-images.githubusercontent.com/7116312/113705452-5ac51d00-96d5-11eb-8087-5d2a8ccad99a.png

Installing Tigger
Expand All @@ -18,7 +28,7 @@ From source with Ubuntu LTS
Python dependencies
^^^^^^^^^^^^^^^^^^^

* Tigger-LSM v1.7.0 - if you are not installing Tigger via the KERN repository or using the ``install_tigger_ubuntu.sh`` script provided, please go here <https://github.com/ska-sa/tigger-lsm> and install this first.
* Tigger-LSM v1.7.1 - if you are not installing Tigger via the KERN repository or using the ``install_tigger_ubuntu.sh`` script provided, please go here <https://github.com/ratt-ru/tigger-lsm> and install this first.

Automatically installed Python dependencies:

Expand All @@ -42,9 +52,9 @@ Install on Ubuntu LTS with the installation script

Download the Tigger repository::

git clone https://github.com/ska-sa/tigger.git
git clone https://github.com/ratt-ru/tigger.git

The installation script works on Ubuntu 18.04, 20.04 and 21.04.
The installation script works on Ubuntu 18.04, 20.04 and 22.04 (including ARM64).

Run the installation script and enter ``sudo`` password when prompted::

Expand All @@ -53,13 +63,13 @@ Run the installation script and enter ``sudo`` password when prompted::
Manual installation from source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

After the Tigger repository has been downloaded with ``git clone https://github.com/ska-sa/tigger.git``, please run the following::
After the Tigger repository has been downloaded with ``git clone https://github.com/ratt-ru/tigger.git``, please run the following::

sudo apt -y install python3-pyqt5.qtsvg python3-pyqt5.qtopengl libqwt-qt5-6
sudo dpkg -i debian_pkgs/ubuntu_20_04_deb_pkg/python3-pyqt5.qwt_2.00.00-1build1_amd64.deb
python3 setup.py install --user
sudo dpkg -i debian_pkgs/ubuntu_22_04_deb_pkg/python3-pyqt5.qwt_2.00.00-1build1_amd64.deb
pip3 install . --user

Please note that the above commands are for installing on Ubuntu 20.04, Debian packages for 18.04 and 21.04 are located in the ``ubuntu_18_04_deb_pkg`` and ``ubuntu_21_04_deb_pkg`` directories respectively.
Please note that the above commands are for installing on Ubuntu 22.04, Debian packages for 18.04, 20.04 and 22.04 ARM64 are located in the ``ubuntu_18_04_deb_pkg``, ``ubuntu_20_04_deb_pkg`` and ``ubuntu_20_04__arm64_deb_pkg`` directories respectively.

Running Tigger
==============
Expand All @@ -71,11 +81,13 @@ Questions or problems

Open an issue on github

https://github.com/ska-sa/tigger
https://github.com/ratt-ru/tigger/issues

Contributors
============

Travis
======
Thank you to the people who have contributed to this project.

.. image:: https://contrib.rocks/image?repo=ratt-ru/tigger
:target: https://github.com/ratt-ru/tigger/graphs/contributors

.. image:: https://travis-ci.org/ska-sa/tigger.svg?branch=master
:target: https://travis-ci.org/ska-sa/tigger
6 changes: 3 additions & 3 deletions TigGUI/AboutDialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -89,8 +89,8 @@ def languageChange(self):
self.setWindowTitle(self.__tr("About Tigger"))
self.title_label.setText(self.__tr( \
"""<h3>Tigger %s</h3>
<p>\u00a92010-2021 Oleg Smirnov & Rhodes University & SKA SA<br>
<br>Please direct feedback and bug reports at https://github.com/ska-sa/tigger</p>
<p>\u00a92010-2022 Oleg Smirnov & Rhodes University & SKA SA<br>
<br>Please direct feedback and bug reports at https://github.com/ratt-ru/tigger</p>
""" % (release_string) \
))

Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/Colormaps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
13 changes: 6 additions & 7 deletions TigGUI/Images/ControlDialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand All @@ -25,7 +24,7 @@
import numpy
from PyQt5.Qt import QWidget, QHBoxLayout, QComboBox, QLabel, QLineEdit, QDialog, QToolButton, QVBoxLayout, \
Qt, QSize, QSizePolicy, QApplication, QColor, QBrush, QTimer, QFrame, QCheckBox, QStackedWidget, QIcon, QMenu, \
QGridLayout, QPen, QRect
QGridLayout, QPen, QRectF
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QDockWidget
from PyQt5.Qwt import QwtPlot, QwtText, QwtPlotItem, QwtPlotCurve, QwtSymbol, QwtLinearScaleEngine, QwtLogScaleEngine, \
Expand Down Expand Up @@ -86,9 +85,9 @@ def __init__(self, parent, rc, imgman):
# lo0.setContentsMargins(0,0,0,0)

# histogram plot
whide = self.makeButton("Hide", self.hide, width=128)
whide.setShortcut(Qt.Key_F9)
lo0.addWidget(Separator(self, "Histogram and ITF", extra_widgets=[whide]))
self.whide = self.makeButton("Hide", self.hide, width=128)
self.whide.setShortcut(Qt.Key_F9)
lo0.addWidget(Separator(self, "Histogram and ITF", extra_widgets=[self.whide]))
lo1 = QHBoxLayout()
lo1.setContentsMargins(0, 0, 0, 0)
self._histplot = QwtPlot(self)
Expand Down Expand Up @@ -544,7 +543,7 @@ def draw(self, painter, xmap, ymap, rect):
# remap into an Nx1 image
qimg = self.cmap.colorize(self.imap.remap(xp.reshape((len(xp), 1))))
# plot image
painter.drawImage(QRect(xp1, y0, xdp, dy), qimg)
painter.drawImage(QRectF(xp1, y0, xdp, dy), qimg)

class HistogramLineMarker:
"""Helper class implementing a line marker for a histogram plot"""
Expand Down
68 changes: 50 additions & 18 deletions TigGUI/Images/Controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -28,7 +28,7 @@
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QDockWidget, QSizePolicy, QWidget, QPushButton, QStyle
from PyQt5.Qwt import QwtText, QwtPlotCurve, QwtPlotMarker, QwtScaleMap, QwtPlotItem
from PyQt5.QtCore import pyqtSignal, QPointF, QSize
from PyQt5.QtCore import pyqtSignal, QPoint, QPointF, QSize

import TigGUI.kitties.utils
from TigGUI.Images.SkyImage import FITSImagePlotItem
Expand Down Expand Up @@ -345,16 +345,22 @@ def showRenderControls(self):
if not self._control_dialog.isVisible():
dprint(1, "showing control dialog")
self._control_dialog.show()
self._dockable_colour_ctrl.setVisible(True)
self.addDockWidgetToTab()
self._dockable_colour_ctrl.show()
self._dockable_colour_ctrl.raise_()
if self._dockable_colour_ctrl is not None:
self._dockable_colour_ctrl.setVisible(True)
self.addDockWidgetToTab()
self._dockable_colour_ctrl.show()
self._dockable_colour_ctrl.raise_()
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)
else:
self._control_dialog.hide()
self._dockable_colour_ctrl.setVisible(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(
self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def addDockWidgetToTab(self):
# Add dockable widget to main window.
Expand Down Expand Up @@ -396,17 +402,43 @@ def removeDockWidget(self):
def colourctrl_dockwidget_closed(self):
self._dockable_colour_ctrl.setVisible(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
if not self._dockable_colour_ctrl.isFloating():
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def colourctrl_dockwidget_toggled(self):
if self._dockable_colour_ctrl.isVisible():
if self._dockable_colour_ctrl.isWindow():
self._dockable_colour_ctrl.setFloating(False)
else:
self._dockable_colour_ctrl.setFloating(True)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(
self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self._dockable_colour_ctrl.isVisible():
return
if self._dockable_colour_ctrl.isWindow():
self._dockable_colour_ctrl.setFloating(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)
else:
self._dockable_colour_ctrl.setFloating(True)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def get_docked_widget_size(self, _dockable):
widget_list = self.parent().mainwin.findChildren(QDockWidget)
size_list = []
if _dockable:
for widget in widget_list:
if isinstance(widget.bind_widget, ImageControlDialog):
if widget is not _dockable:
if not widget.isWindow() and not widget.isFloating() and widget.isVisible():
size_list.append(widget.bind_widget.width())
if size_list:
return max(size_list)
else:
return size_list

def _changeDisplayRangeToPercent(self, percent):
if not self._control_dialog:
Expand Down
51 changes: 47 additions & 4 deletions TigGUI/Images/Manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand All @@ -20,15 +20,16 @@
#

import os.path
from re import split
import sys
import time
import traceback

import numpy
from PyQt5.Qt import (QWidget, QFileDialog, QVBoxLayout, QApplication, QMenu, QClipboard, QInputDialog, QActionGroup)
from PyQt5.Qt import (QWidget, QFileDialog, QVBoxLayout, QApplication, QMenu, QClipboard, QInputDialog, QActionGroup, QTextOption, QFont)
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDockWidget
from PyQt5.QtWidgets import QDockWidget, QLabel, QPlainTextEdit
from astropy.io import fits as pyfits
from astropy.wcs import WCS
from astropy.io.fits import Header
Expand Down Expand Up @@ -91,6 +92,8 @@ def __init__(self, *args):
self._repopulateMenu()
self.signalShowMessage = None
self.signalShowErrorMessage = None
# FITS header preview pane
self.fits_info = QPlainTextEdit()

def close(self):
dprint(1, "closing Manager")
Expand All @@ -107,6 +110,25 @@ def setShowErrorMessageSignal(self, _signal):
def setMainWindow(self, _mainwin):
self.mainwin = _mainwin

def FITSHeaderPreview(self, fname):
"""Loads information for the FITS header preview pane.
Connected via the QFileDialog currentChanged signal.
"""
if os.path.isfile(fname):
name = os.path.basename(fname)
split_name = os.path.splitext(name)
if split_name[1].startswith(tuple(FITS_ExtensionList)):
try:
with pyfits.open(fname) as hdu:
hdu.verify('silentfix')
hdr = hdu[0].header
self.fits_info.setPlainText(
"[File size: " + str(round(hdu._file.tell()/1024/1024, 2)) + " MiB]\n" + hdr.tostring(sep='\n', padding=True))
except:
self.fits_info.setPlainText("Error Reading FITS file")
else:
self.fits_info.clear()

def loadImage(self, filename=None, duplicate=True, to_top=True, model=None):
"""Loads image. Returns ImageControlBar object.
If image is already loaded: returns old ICB if duplicate=False (raises to top if to_top=True),
Expand All @@ -118,10 +140,31 @@ def loadImage(self, filename=None, duplicate=True, to_top=True, model=None):
if not self._load_image_dialog:
dialog = self._load_image_dialog = QFileDialog(self, "Load FITS image", ".",
"FITS images (%s);;All files (*)" % (" ".join(
["*" + ext for ext in FITS_ExtensionList])))
["*" + ext for ext in FITS_ExtensionList])),
options=QFileDialog.DontUseNativeDialog)
dialog.setFileMode(QFileDialog.ExistingFile)
dialog.setModal(True)
dialog.filesSelected['QStringList'].connect(self.loadImage)
layout = dialog.layout()
if layout:
# FITS header preview pane
dialog.currentChanged.connect(self.FITSHeaderPreview)
self.fits_info.setMinimumWidth(263)
dialog.setMinimumWidth(dialog.width() + self.fits_info.minimumWidth())
self.fits_info.setWordWrapMode(QTextOption.NoWrap)
self.fits_info.setLineWrapMode(QPlainTextEdit.NoWrap)
self.fits_info.setTabStopWidth(40)
f = QFont()
f.setFamily("Monospace")
f.setPointSize(10)
f.setFixedPitch(True)
self.fits_info.setFont(f)
self.fits_info.setReadOnly(True)
_flabel = QLabel("FITS File Information")
_flabel.setAlignment(Qt.AlignHCenter)
layout.addWidget(_flabel, 0, 3)
layout.addWidget(self.fits_info, 1, 3, 3, 1)
dialog.setLayout(layout)
self._load_image_dialog.exec_()
return None
if isinstance(filename, QStringList):
Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/RenderControl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
6 changes: 3 additions & 3 deletions TigGUI/Images/SkyImage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -239,7 +239,7 @@ def draw(self, painter, xmap, ymap, rect, use_cache=True):
yp1, yp2, ydp, ys1, ys2, yds = yinfo = ymap.p1(), ymap.p2(), ymap.pDist(), ymap.s1(), ymap.s2(), ymap.sDist()
dprint(5, "draw:", rect, xinfo, yinfo)
self._current_rect = QRectF(QPointF(xs2, ys1), QSizeF(xds, yds))
self._current_rect_pix = QRect(QPoint(*self.lmToPix(xs1, ys1)), QPoint(*self.lmToPix(xs2, ys2))).intersected(
self._current_rect_pix = QRectF(QPointF(*self.lmToPix(xs1, ys1)), QPointF(*self.lmToPix(xs2, ys2))).toRect().intersected(
self._bounding_rect_pix)
dprint(5, "draw:", self._current_rect_pix)
# put together tuple describing current mapping
Expand Down Expand Up @@ -338,7 +338,7 @@ def draw(self, painter, xmap, ymap, rect, use_cache=True):
self._cache_qimage[self._image_key] = self.qimg.copy()
# now draw the image
t0 = time.time()
painter.drawImage(xp1, yp2, self.qimg)
painter.drawImage(QPointF(xp1, yp2), self.qimg)
dprint(2, "drawing took", time.time() - t0, "secs")
# when exporting images to PNG cache needs to be cleared
if not use_cache:
Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
Loading

0 comments on commit bdfe29a

Please sign in to comment.