Skip to content

Commit

Permalink
Merge pull request #91 from ska-sa/tigger-lsm-divorce
Browse files Browse the repository at this point in the history
Tigger lsm divorce
  • Loading branch information
gijzelaerr authored Apr 3, 2018
2 parents 011a893 + 62d441b commit f0c984a
Show file tree
Hide file tree
Showing 75 changed files with 134 additions and 6,338 deletions.
17 changes: 3 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,17 @@ Installing Tigger
Ubuntu package
--------------

Enable the
`radio astro launchpad PPA <https://launchpad.net/~radio-astro/+archive/ubuntu/main>`_
and install the python-tigger package.
Enable the KERN repository and install the tigger package.


from pypi or from source
------------------------

requirements:

* Assorted python packages: PyQt4, PyQwt5, pyfits, numpy, scipy, astLib.
With the exception of astLib, these are already present in most Linux
distros. astLib may be downloaded here: http://astlib.sourceforge.net/

* Purr/Kittens. Easiest to install the purr package from a MeqTrees binary
distribution (see http://www.astron.nl/meqwiki/Downloading). Alternatively,
check it out from svn (see below), and make sure the parent
of the Kittens directory is in your PYTHONPATH.
Requirements: PyQt4, PyQwt5. These are already present in most Linux distros.

To obtain on ubuntu you can run::

$ sudo apt-get install python-kittens python-pyfits python-astlib python-scipy python-numpy python-qt4 python-qwt5-qt4 libicu48
$ sudo apt-get install python-qt4 python-qwt5-qt4 libicu48

now from pip::

Expand Down
21 changes: 9 additions & 12 deletions Tigger/AboutDialog.py → TigGUI/AboutDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# or write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from Tigger import release_string,svn_revision_html,pixmaps
from TigGUI import release_string,svn_revision_html,pixmaps

import os.path
import time
Expand Down Expand Up @@ -63,12 +63,12 @@ def __init__(self,parent=None,name=None,modal=0,fl=None):

lo_logos = QHBoxLayout(None)
lo_top.addLayout(lo_logos);
for logo in ("astron",):
icon = QLabel(LayoutWidget)
icon.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed);
icon.setPixmap(getattr(pixmaps,logo+"_logo").pm());
icon.setAlignment(Qt.AlignCenter)
lo_logos.addWidget(icon)
# for logo in ("astron",):
# icon = QLabel(LayoutWidget)
# icon.setSizePolicy(QSizePolicy.Fixed,QSizePolicy.Fixed);
# icon.setPixmap(getattr(pixmaps,logo+"_logo").pm());
# icon.setAlignment(Qt.AlignCenter)
# lo_logos.addWidget(icon)

lo_mainbtn = QHBoxLayout(None)
lo_mainbtn.addItem(QSpacerItem(20,20,QSizePolicy.Expanding,QSizePolicy.Minimum))
Expand Down Expand Up @@ -96,11 +96,8 @@ def languageChange(self):
self.setWindowTitle(self.__tr("About Tigger"))
self.title_label.setText(self.__tr( \
"""<h3>Tigger %s</h3>
<p>(C) 2010-2012 Oleg Smirnov & ASTRON<br>(Netherlands Institude for Radioastronomy)<br>
Oude Hoogeveensedijk 4<br>
7991 PD Dwingeloo, The Netherlands<br>
http://www.astron.nl<br>
<br>Please direct feedback and bug reports to [email protected]</p>
<p>(C) 2010-2017 Oleg Smirnov & Rhodes University & SKA SA<br>
<br>Please direct feedback and bug reports at https://github.com/ska-sa/tigger</p>
"""%(release_string) \
));

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
from Kittens.utils import curry,PersistentCurrier
from Kittens.widgets import BusyIndicator

from Tigger.Images import SkyImage,Colormaps
from Tigger import pixmaps
from Tigger.Widgets import FloatValidator,TiggerPlotCurve,TiggerPlotMarker
from TigGUI.Images import SkyImage,Colormaps
from TigGUI import pixmaps
from TigGUI.Widgets import FloatValidator,TiggerPlotCurve,TiggerPlotMarker

from RenderControl import RenderControl,dprint,dprintf

Expand Down
13 changes: 4 additions & 9 deletions Tigger/Images/Controller.py → TigGUI/Images/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,10 @@
dprint = _verbosity.dprint;
dprintf = _verbosity.dprintf;

from Tigger.Images import SkyImage,Colormaps
from Tigger.Models import ModelClasses,PlotStyles
from Tigger.Coordinates import Projection,radec_string;
from Tigger.Models.SkyModel import SkyModel
from Tigger import pixmaps
from Tigger.Widgets import FloatValidator

from Tigger.Images.RenderControl import RenderControl
from Tigger.Images.ControlDialog import ImageControlDialog
from TigGUI import pixmaps
from TigGUI.Widgets import FloatValidator
from TigGUI.Images.RenderControl import RenderControl
from TigGUI.Images.ControlDialog import ImageControlDialog

class ImageController (QFrame):
"""An ImageController is a widget for controlling the display of one image.
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions Tigger/Images/Manager.py → TigGUI/Images/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
from Kittens.utils import curry,PersistentCurrier
from Kittens.widgets import BusyIndicator

from Tigger.Images.Controller import ImageController,dprint,dprintf
from TigGUI.Images.Controller import ImageController,dprint,dprintf

from Tigger.Images import SkyImage
from Tigger.Images import FITS_ExtensionList
from TigGUI.Images import SkyImage
from TigGUI.Images import FITS_ExtensionList

class ImageManager (QWidget):
"""An ImageManager manages a stack of images (and associated ImageControllers)"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
dprint = _verbosity.dprint;
dprintf = _verbosity.dprintf;

from Tigger.Images import SkyImage,Colormaps
from Tigger import pixmaps,ConfigFile
from Tigger.Widgets import FloatValidator
from TigGUI.Images import SkyImage,Colormaps
from TigGUI import pixmaps,ConfigFile
from TigGUI.Widgets import FloatValidator

import Kittens.config
ImageConfigFile = Kittens.config.DualConfigParser("tigger.images.conf");
Expand Down
4 changes: 2 additions & 2 deletions Tigger/Images/SkyImage.py → TigGUI/Images/SkyImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
pyfits = Kittens.utils.import_pyfits();

from Tigger.Coordinates import Projection
from Tigger.Images import Colormaps
from Tigger.Images import FITSHeaders
from TigGUI.Images import Colormaps
from Tigger.Tools import FITSHeaders

DEG = math.pi/180;

Expand Down
File renamed without changes.
21 changes: 10 additions & 11 deletions Tigger/MainWindow.py → TigGUI/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

from Tigger import *
from TigGUI import *

import os
import os.path
Expand All @@ -39,15 +39,15 @@
import Kittens.utils
from Kittens.utils import PersistentCurrier

from Models import ModelClasses
from Models import SkyModel
from Models.Formats import ModelHTML
from Tigger.Models import ModelClasses
from Tigger.Models import SkyModel
from Tigger.Models.Formats import ModelHTML
import Widgets
import AboutDialog
from SkyModelTreeWidget import *
from Plot.SkyModelPlot import *
from Images.Manager import ImageManager
import Tigger.Tools.source_selector
import TigGUI.Tools.source_selector

_verbosity = Kittens.utils.verbosity(name="mainwin");
dprint = _verbosity.dprint;
Expand Down Expand Up @@ -363,14 +363,14 @@ def _deleteSelection (self):
self.model.emitUpdate(SkyModel.UpdateAll,origin=self);

def _showSourceSelector (self):
Tigger.Tools.source_selector.show_source_selector(self,self.model);
TigGUI.Tools.source_selector.show_source_selector(self, self.model);

def _updateModelSelection (self,num,origin=None):
"""Called when the model selection has been updated.""";
self.emit(SIGNAL("hasSelection"),bool(num));

import Tigger.Models.Formats
_formats = [ f[1] for f in Tigger.Models.Formats.listFormatsFull() ];
_formats = [f[1] for f in Tigger.Models.Formats.listFormatsFull()];

_load_file_types = [ (doc,["*"+ext for ext in extensions],load) for load,save,doc,extensions in _formats if load ];
_save_file_types = [ (doc,["*"+ext for ext in extensions],save) for load,save,doc,extensions in _formats if save ];
Expand Down Expand Up @@ -433,15 +433,14 @@ def _mergeFileCallback (self):
return;

def openFile (self,filename=None,format=None,merge=False,show=True):
from Models import ModelClasses
# check that we can close existing model
if not merge and not self._canCloseExistingModel():
return False;
if isinstance(filename,QStringList):
filename = filename[0];
filename = str(filename);
# try to determine the file type
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename,format);
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename, format);
if import_func is None:
self.showErrorMessage("""Error loading model file %s: unknown file format"""%filename);
return;
Expand Down Expand Up @@ -529,7 +528,7 @@ def saveFile (self,filename=None,confirm=False,overwrite=True,non_native=False):
else:
warning = '';
# try to determine the file type
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename,None);
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename, None);
if export_func is None:
self.showErrorMessage("""Error saving model file %s: unsupported output format"""%filename);
return;
Expand Down Expand Up @@ -601,7 +600,7 @@ def saveSelectionAs (self,filename=None,force=False):
self.showErrorMessage("""You have not selected any sources to save.""");
return;
# try to determine the file type
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename,None);
filetype,import_func,export_func,doc = Tigger.Models.Formats.resolveFormat(filename, None);
if export_func is None:
self.showErrorMessage("""Error saving model file %s: unsupported output format"""%filename);
return;
Expand Down
2 changes: 1 addition & 1 deletion Tigger/Plot/MouseModes.py → TigGUI/Plot/MouseModes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from Tigger import *
from TigGUI import *
from PyQt4.Qt import *
import Kittens.utils
from Kittens.utils import curry,PersistentCurrier
Expand Down
6 changes: 3 additions & 3 deletions Tigger/Plot/SkyModelPlot.py → TigGUI/Plot/SkyModelPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
dprint = _verbosity.dprint;
dprintf = _verbosity.dprintf;

from Tigger import pixmaps,Config,ConfigFile
from TigGUI import pixmaps,Config,ConfigFile
from Tigger.Models import ModelClasses,PlotStyles
from Tigger import Coordinates
from Tigger.Coordinates import Projection
from Tigger.Models.SkyModel import SkyModel
from Tigger.Widgets import TiggerPlotCurve,TiggerPlotMarker
from Tigger.Plot import MouseModes
from TigGUI.Widgets import TiggerPlotCurve,TiggerPlotMarker
from TigGUI.Plot import MouseModes

# plot Z depths for various classes of objects
Z_Image = 1000;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions Tigger/Tools/add_brick.py → TigGUI/Tools/add_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
import os.path

from Kittens.widgets import BusyIndicator
from Tigger.Widgets import FileSelector
from TigGUI.Widgets import FileSelector
from Tigger.Models import SkyModel,ModelClasses
from Tigger.Tools import Imaging

DEG = math.pi/180;

Expand Down Expand Up @@ -176,5 +175,5 @@ def add_brick (mainwin,model):
# show dialog
return dialog.exec_();

from Tigger.Tools import registerTool
from TigGUI.Tools import registerTool
registerTool("Add FITS brick to model...",add_brick);
4 changes: 2 additions & 2 deletions Tigger/Tools/export_karma.py → TigGUI/Tools/export_karma.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import math
import os.path
from Kittens.widgets import BusyIndicator
from Tigger.Widgets import FileSelector
from TigGUI.Widgets import FileSelector

DEG = math.pi/180;

Expand Down Expand Up @@ -146,5 +146,5 @@ def export_karma_annotations (mainwin,model):
# show dialog
return dialog.exec_();

from Tigger.Tools import registerTool
from TigGUI.Tools import registerTool
registerTool("Export Karma annotations...",export_karma_annotations);
4 changes: 2 additions & 2 deletions Tigger/Tools/make_brick.py → TigGUI/Tools/make_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import traceback

from Kittens.widgets import BusyIndicator
from Tigger.Widgets import FileSelector
from TigGUI.Widgets import FileSelector
from Tigger.Models import SkyModel,ModelClasses
from Tigger.Tools import Imaging

Expand Down Expand Up @@ -309,5 +309,5 @@ def make_brick (mainwin,model):
# show dialog
return dialog.exec_();

from Tigger.Tools import registerTool
from TigGUI.Tools import registerTool
registerTool("Make FITS brick from selected sources...",make_brick);
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
import os.path

from Kittens.widgets import BusyIndicator
from Tigger.Widgets import FileSelector
from Tigger.Models import SkyModel,ModelClasses
from TigGUI.Widgets import FileSelector
from Tigger.Tools import Imaging

DEG = math.pi/180;
Expand Down Expand Up @@ -208,5 +207,5 @@ def restore_into_image (mainwin,model):
# show dialog
return dialog.exec_();

from Tigger.Tools import registerTool
from TigGUI.Tools import registerTool
registerTool("Restore model into image...",restore_into_image);
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

from Kittens.widgets import SIGNAL,BusyIndicator
from Kittens.utils import curry
from Tigger.Widgets import FileSelector
from TigGUI.Widgets import FileSelector
from Tigger.Models import SkyModel,ModelClasses
from Tigger import SkyModelTreeWidget
from TigGUI import SkyModelTreeWidget

import Kittens.utils

Expand Down Expand Up @@ -293,5 +293,5 @@ def show_source_selector (mainwin,model):
dialog.show();
dialog.raise_();

#from Tigger.Tools import registerTool
#from TigGUI.Tools import registerTool
#registerTool("Source selector...",show_source_selector);
File renamed without changes.
58 changes: 58 additions & 0 deletions TigGUI/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- coding: utf-8 -*-
#
#% $Id$
#
#
# Copyright (C) 2002-2011
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>,
# or write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

import sys

import Kittens.config
import os.path
import Tigger
from Tigger import import_pyfits, nuke_matplotlib


__version__ = "1.4.0"

release_string = __version__
svn_revision_string = __version__
svn_revision_html = __version__

# initializes GUI-related globals. Only called from the viewer
def init_gui():
from Kittens.widgets import BusyIndicator
import Kittens.pixmaps
import Kittens.utils
global pixmaps, Config, ConfigFile, ConfigFileName
pixmaps = Kittens.pixmaps.PixmapCache("TigGUI")
ConfigFileName = ".tigger.conf"
ConfigFile = Kittens.config.DualConfigParser("tigger.conf",["/usr/lib/TigGUI", os.path.dirname(__file__)])
Config = Kittens.config.SectionParser(ConfigFile,"Tigger")


startup_dprint = startup_dprintf = lambda *dum:None
_verbosity = Kittens.utils.verbosity(name="tiggui")
dprint = _verbosity.dprint
dprintf = _verbosity.dprintf


File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit f0c984a

Please sign in to comment.