Giter Club home page Giter Club logo

ginga's Introduction

GINGA

Ginga Logo

Powered by Astropy Badge Documentation Status Github Actions CI Status

Ginga is a toolkit designed for building viewers for scientific image data in Python, visualizing 2D pixel data in numpy arrays. It can view astronomical data such as contained in files based on the FITS (Flexible Image Transport System) file format. It is written and is maintained by software engineers at the National Astronomical Observatory of Japan (NAOJ), the Space Telescope Science Institute (STScI), and other contributing entities.

The Ginga toolkit centers around an image display object which supports zooming and panning, color and intensity mapping, a choice of several automatic cut levels algorithms and canvases for plotting scalable geometric forms. In addition to this widget, a general purpose "reference" FITS viewer is provided, based on a plugin framework. A fairly complete set of standard plugins are provided for features that we expect from a modern FITS viewer: panning and zooming windows, star catalog access, cuts, star pick/FWHM, thumbnails, etc.

COPYRIGHT AND LICENSE

Copyright (c) 2011-2024 Ginga Maintainers. All rights reserved. Ginga is distributed under an open-source BSD licence. Please see the file LICENSE.txt in the top-level directory for details.

BUILDING AND INSTALLATION

The current release of Ginga can be downloaded and installed from pip using:

$ pip install ginga

From source code, you should also use pip, e.g.:

$ cd ginga
$ pip install -e .

The program can then be run using the command "ginga".

For further information, please see the detailed installation instructions in the documentation.

DOCUMENTATION

It is online at http://ginga.readthedocs.io/en/latest/ (dev) and http://ginga.readthedocs.io/en/stable/ (latest release).

CODE OF CONDUCT

See CODE_OF_CONDUCT.md.

FOR DEVELOPERS

See examples/*/example{1,2}_*.py . There is more information for developers in the manual.

ON THE WEB

http://ejeschke.github.com/ginga

ETYMOLOGY

"Ginga" is the romanized spelling of the Japanese word "銀河" (hiragana: ぎんが), meaning "galaxy" (in general) and, more familiarly, the Milky Way. This viewer was originally written by software engineers at Subaru Telescope, National Astronomical Observatory of Japan; thus the connection.

Pronunciation

Ginga the viewer may be pronounced "ging-ga" (proper japanese) or "jing-ga" (perhaps easier for Western tongues). The latter pronunciation has meaning in the Brazilian dance/martial art capoeira: a fundamental rocking or back and forth swinging motion. Pronunciation as "jin-ja" is considered poor form.

ginga's People

Contributors

astrofrog avatar austinbeauch avatar bsipocz avatar cadair avatar cdeil avatar chyan26 avatar dependabot[bot] avatar ejeschke avatar eteq avatar hcferguson avatar matthewbakerthompson avatar mkb0517 avatar mkelley avatar mwcraig avatar nabobalis avatar olebole avatar pllim avatar profxj avatar rajul avatar rayplante avatar rirze avatar rupak0577 avatar sergiopasra avatar simonkrughoff avatar sosey avatar stscieisenhamer avatar supersandra avatar teuben avatar xtnchang avatar zhouyaoji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ginga's Issues

Ungraceful exit when FITS file not found

Currently, when user attempts to open a FITS image and then press Cancel, the GUI exits ungracefully as follows:

$ python example2_qt.py
No handlers could be found for logger "example2"
Traceback (most recent call last):
  File "example2_qt.py", line 156, in open_file
    self.load_file(fileName)
  File "example2_qt.py", line 144, in load_file
    image.load_file(filepath)
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/AstroImage.py", line 97, in load_file
    naxispath=naxispath)
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/util/io_fits.py", line 124, in load_file
    fits_f = pyfits.open(filepath, 'readonly')
  File ".../lib/python2.7/site-packages/astropy/io/fits/hdu/hdulist.py", line 121, in fitsopen
    raise ValueError('Empty filename: %s' % repr(name))
ValueError: Empty filename: u''

I was expecting the GUI to still be up and running, instead of crashing like this.

PEP8: change package names to snake_case?

PEP8 suggests to use snake_case for package and module names and CamelCase for class names.
I find that very convenient because when reading code it's clear what's an imported module and what's a class name ... ginga in many places uses CamelCase for both, i.e. I have to scroll up and check the imports to be able to know if AstroImage is the module or the class.

I realise changing this would be a complete break in backwards compatibility and thus painful for your users, but I think in the long run worth it ... Ginga as the astro image viewer of the next decade or two with a clean Python codebase!

(Obviously, feel free to just close this issue if you don't want to do this!)

Contents listing order

I just noticed that the file listing order in Contents are sorted

d
c
b
a

and not

a
b
c
d

Is this intentional? I was expecting alphabetically ascending order.

Bug in Qt Contents plugin?

In qtw/plugins/Contents.py

    def recreate_toc(self):
        self.logger.debug("Recreating table of contents...")
        toclist = list(self.nameDict.keys())
        toclist.sort()

        self.treeview.clear()

        for key in toclist:
            chitem = QtGui.QTreeWidgetItem(self.treeview, [chname])
            chitem.setFirstColumnSpanned(True)
            self.treeview.addTopLevelItem(chitem)

chname is undefined. Is this a bug?

Catalog server

I can't select neither a Image server nor Catalog server can't be selected; do I need to setup something before ?

WCS not being recognized

Loading a FITS file the WCS is not recognized and the stderr shows some messages as follow:

2014-09-25 09:12:16,245 | W | example2_qt.py:158 (motion) | Bad coordinate conversion: 'NoneType' object has no attribute 'all_pix2world'

2014-09-25 09:12:25,277 | W | example2_qt.py:158 (motion) | Bad coordinate conversion: RA (2165.552846) > 360.0

Find examples at ftp://ftp.iaa.es/pub/jmiguel/osn.

MultiDim errors out on PrimaryHDU

I use MultiDim on multi-extension FITS as such

0    Primary Header
1    SCI
2    ERR
3    DQ

When I select Extension 0, I get
Error loading FITS HDU #1: 'NoneType' object has no attribute 'shape'

Would be nice if it just displays the header and some sort of filler value for image display (grey? black? white?) instead of throwing an error. Primary header with no image data in Extension 0 is widely used by STScI. And the header has a lot of useful information, so it would be nice for Ginga to show it.

Errors when Contents global plugin is disabled

So, for my own reasons, I decided to disabled the built-in Contents global plugin and write my own modified version. I disabled it like this:

from ginga import main as gmain

def main():
    # stuff

    for plg in gmain.global_plugins:
        if plg['tab'] == 'Contents':
            plg['start'] = False

    # more stuff

Then, I notice error messages in the log file, as follow (I am only reporting the errors that seem relevant to my change above):

2015-02-03 13:09:41,450 | I | main.py:428 (main) | Entering mainloop...
2015-02-03 13:09:41,484 | I | Control.py:474 (load_image) | Loading image from image1.fits
2015-02-03 13:09:41,493 | I | Control.py:474 (load_image) | Loading image from image2.fits
2015-02-03 13:09:41,953 | E | Callback.py:86 (make_callback) | Error making callback 'add-image': 'Contents' object has no attribute 'treeview'
2015-02-03 13:09:41,955 | E | Callback.py:87 (make_callback) | Traceback:
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/misc/Callback.py", line 70, in make_callback
    res = method(*cb_args, **cb_kwdargs)

  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/qtw/plugins/Contents.py", line 128, in add_image
    chitem = QtGui.QTreeWidgetItem(self.treeview, [chname])

2015-02-03 13:09:41,964 | I | Control.py:798 (_switch_image) | Update image start
2015-02-03 13:09:41,965 | I | Control.py:803 (_switch_image) | Setting image...
2015-02-03 13:09:42,070 | I | Control.py:822 (_switch_image) | Large image update: 0.1044 sec
2015-02-03 13:09:42,485 | E | Callback.py:86 (make_callback) | Error making callback 'add-image': 'Contents' object has no attribute 'treeview'
2015-02-03 13:09:42,487 | E | Callback.py:87 (make_callback) | Traceback:
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/misc/Callback.py", line 70, in make_callback
    res = method(*cb_args, **cb_kwdargs)

  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/qtw/plugins/Contents.py", line 128, in add_image
    chitem = QtGui.QTreeWidgetItem(self.treeview, [chname])

Your documentation claims that Ginga is very flexible and I should be able to enable/disable any plugins I wish. So, why am I getting these errors? How do I fix this? Thanks.

First cut levels not applied when typed in Info plugin, first time only

Affects: reference viewer

When Ginga is first started and an image is loaded, typing a value for one of the cut levels in the Info plugin box and pressing enter does not apply the value. Pressing a second time applies the value, and it appears that any subsequent values entered or pressed are applied correctly.

From looking at the log, it appears that for this initial case, the value is applied, but then reset.

Allow mosaicking of HDUs based on WCS

This may be a lot of work, so feel free to consider this a "long-term" issue.

One of the useful features I'm accustom to in ds9 is the option of loading mosaic-style fits files. For example, multi-ccd instruments will often put each CCD in its own HDU with separate physical (pixel) WCS info. The idea is that you can then use the WCS info in each HDU to place the chips in the right place relative to each other.

One could also use the same functionality to mosaic two sky-coordinate WCSs on top of each other, although that might be more work given the reprojection that might be needed.

SAMP integration

Adding SAMP support will allow ginga to receive directives from other applications (either in a web browser or on the desktop) to load particular datasets.

ImportError: No module named misc.Bunch

I see this error with the latest version from git master:

$ python -c 'import ginga'
$ ginga.py 
Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/bin/ginga.py", line 52, in <module>
    from ginga.misc.Bunch import Bunch
  File "/Users/deil/Library/Python/2.7/bin/ginga.py", line 52, in <module>
    from ginga.misc.Bunch import Bunch
ImportError: No module named misc.Bunch

Can you reproduce?

grc load argument does not work

I started ginga with the following argument
ginga --modules=RC

Then, the first example in grc to create channel worked without any problem.
grc ginga add_channel FOO

But the next example to load an image did not work.
grc ginga load FOO nzstvj120102.fits

It gave the following error


Traceback (most recent call last):
File "/usr/bin/grc", line 74, in
main(options, args)
File "/usr/bin/grc", line 38, in main
res = method(_args)
File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in call
return self.__send(self.__name, args)
File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
return self._parse_response(h.getfile(), sock)
File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in parse_response
return u.close()
File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
raise Fault(
*self._stack[0])
xmlrpclib.Fault: <Fault 1: "<type 'exceptions.AttributeError'>:'Ginga' object has no attribute 'load'">


Going through the source code, it looked like indeed there was no load defined!!

So i tried,
grc ginga load_file nzstvj120102.fits

It said, it couldn't find the image.
So i gave the full path to image and it worked.
grc ginga load_file /home/fullpath/to/this/image/nzstvj120102.fits

The above command loaded the image to ginga without any issue.

fail to load FITS image

When I try to load fits image there is following message and nothing happens. What kind of additional information may I provide to fix that?

python-scipy-0.10.1-11.2.i586
python-numpy-1.6.1-3.1.2.i586
python-pyfits-3.0.6-1.2.i586

Traceback (most recent call last):
  File "/home/matwey/src/ginga/gtkw/FileSelection.py", line 18, in file_ok_sel
    self.callfn(filepath)
  File "/home/matwey/src/ginga/Control.py", line 322, in load_file
    raise FitsViewError(errmsg)
Control.FitsViewError: Failed to load file '/home/matwey/temp/flat.480.exp500.r2.s200.fits': 'NoneType' object has no attribute 'shape'

Add option for vertical or horizontal line in Cuts plugin

Right now the "Cuts" plugin draws freehand lines. It would be nice if there was an option that could be toggled to make it draw purely vertical or purely horizontal lines (a la the 'r' and 'c' keys from IRAF imexam). Maybe just holding down the shift or alt keys when right-clicking?

Python error with qt/example1_video.py

This example doesn't work with Python 3:

$ python3.4 ./qt/example1_video.py 
Traceback (most recent call last):
  File "./qt/example1_video.py", line 36, in <module>
    import Queue
ImportError: No module named 'Queue'

ginga seg fault with missing ginga_config

In the current master version (2.1.20141220052723) in RHEL 6.6 (Santiago) 64-bit, I get segmentation fault and the traceback complains of a missing ginga_config. I checked out the source from GitHub and installed it with python setup.py install --prefix=LOCAL_DIR command. Am I missing something?

2015-01-16 20:47:36,600 | W | main.py:298 (main) | failed to set WCS package preference: 
2015-01-16 20:47:36,600 | W | main.py:310 (main) | failed to set FITS package preference: 
2015-01-16 20:47:36,691 | E | main.py:339 (main) | Error importing Ginga config file: No module named ginga_config
2015-01-16 20:47:36,692 | E | main.py:340 (main) | Traceback:
  File ".../lib/python2.7/site-packages/ginga-2.1.20141220052723-py2.7.egg/ginga/main.py", line 327, in main
    import ginga_config

grc doesn't work with Python 3

I tried running grc with Python 3 and it fails like this:

$ grc
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/grc", line 4, in <module>
    __import__('pkg_resources').run_script('ginga==2.1.20141207082012', 'grc')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1435, in run_script
    code = compile(source, script_filename, 'exec')
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/ginga-2.1.20141207082012-py3.4.egg/EGG-INFO/scripts/grc", line 42
    print res
            ^
SyntaxError: Missing parentheses in call to 'print'

When I fix this it fails like this:

$ grc
Traceback (most recent call last):
  File "/Users/deil/Library/Python/3.4/bin/grc", line 4, in <module>
    __import__('pkg_resources').run_script('ginga==2.1.20141207082012', 'grc')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 517, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 1436, in run_script
    exec(code, namespace, namespace)
  File "/Users/deil/Library/Python/3.4/lib/python/site-packages/ginga-2.1.20141207082012-py3.4.egg/EGG-INFO/scripts/grc", line 23, in <module>
    import xmlrpclib
ImportError: No module named 'xmlrpclib'

Could you please make grc work with Python 3?

Add File -> Open Example to ginga

Would it be possible to add a File -> Open Example option to ginga that contains a handful of nice images (one RADEC, one Galactic, one Allsky, one very wide, one that looks better with log scale)?
Then ginga would simply download the images from the web, i.e. they wouldn't be part of ginga itself.

This is very nice to have for new users to try out ginga quickly to see what it can do. E.g. FIJI is doing this and then using the same images for the tutorials (see screenshot below).

Screen Shot 2013-04-18 at 11 51 54 AM

Pan plugin shows bad compass for galactic and ecliptic coordinates

When selecting "galactic" or "ecliptic" from the "WCS Coords" preferences, the compass does not adjust accordingly (as, for example, in ds9). This is because the endpoints of the arms are being calculated from a straight WCS conversion using the normal header of the image. So if the image header is RA---TAN, DEC--TAN type projection the arms will follow these in straight RA and DEC.

I suppose the idea would be to create a galactic or ecliptic projection and use that header to orient the arms.

Tons of warnings from ImageViewGtk.py

When I start ginga -t gtk on Mac I get a flood of warnings on the console everytime I move the mouse over the main window from ImageViewGtk.py line 121:

$ ginga  -t gtk

** (process:61518): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:61518): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:61518): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
No handlers could be found for logger "ginga"
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/ImageViewGtk.py:121: Warning: g_source_remove: assertion 'tag > 0' failed
  gobject.source_remove(self._defer_task)
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/plugins/Contents.py:70: GtkWarning: gtk_tree_view_set_fixed_height_mode: assertion 'gtk_tree_view_column_get_sizing (c) == GTK_TREE_VIEW_COLUMN_FIXED' failed
  self.treeview.set_fixed_height_mode(True)
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/ImageViewGtk.py:121: Warning: Source ID 30 was not found when attempting to remove it
  gobject.source_remove(self._defer_task)
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/plugins/Header.py:141: GtkWarning: gtk_tree_view_set_fixed_height_mode: assertion 'gtk_tree_view_column_get_sizing (c) == GTK_TREE_VIEW_COLUMN_FIXED' failed
  treeview.set_fixed_height_mode(True)
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/ImageViewGtk.py:121: Warning: Source ID 19 was not found when attempting to remove it
  gobject.source_remove(self._defer_task)
/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/gtkw/ImageViewGtk.py:121: Warning: Source ID 38 was not found when attempting to remove it
  gobject.source_remove(self._defer_task)
...

Is this a bug in Ginga or a problem with my Gtk installation?

Ctrl+digit bad for OS X

Currently, ginga uses "ctrl+digit" to go to fractional zoom levels. This is problematic on a mac, because ctrl+digit defaults to changing which desktop/"space" is open. Can this be changed to "shift+digit" or possibly "alt+digit"?

How to access raw image data in Ginga?

I wish to use Ginga for data visualization, but at the same time, I also need to modify the data when user interacts with the GUI. For example, user clicks on a bad pixel on the image display and select "fix bad pixel", and my program will apply some kind of correction algorithm, and display the corrected data on screen. Once user is satisfied, user can choose to save the modified data to a new file without changing the input image. Is this possible with Ginga architecture? If so, do I have to write my own basic rendering class in a new program (as mentioned in your docs) or can I simply use plugins? Your advise would be greatly appreciated. Thank you.

Make package installable

At the moment, Ginga does not appear to follow the conventional layout for a Python package. It would be nice if you could make it more 'standard' and have a setup.py script for instance that would install the package and any scripts into the standard locations.

One benefit of this is that Ginga could then be included in package repositories (for example I can add it to MacPorts on Mac).

ZeroDivisionError when starting ginga.

I see this error on Mac:

$ ./ginga.py 
No handlers could be found for logger "ginga"
ws args= [[('Info', ['vpanel', {}, ['ws', {'show_tabs': False, 'name': 'uleft', 'height': 300}], ['ws', {'show_tabs': False, 'name': 'lleft', 'height': 430}]])]]
ws args= [[('Dialogs', ['ws', {'name': 'dialogs'}])]]
Traceback (most recent call last):
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageQt.py", line 277, in _redraw
    super(FitsImageQt, self).redraw(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 344, in redraw
    self.redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageCanvasQt.py", line 38, in redraw_data
    super(FitsImageCanvas, self).redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 350, in redraw_data
    rgbobj = self.get_rgb_object(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 376, in get_rgb_object
    self._imgwin_wd, self._imgwin_ht)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 470, in get_scaled_cutout
    res = image.get_scaled_cutout(x1, y1, x2, y2, scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 279, in get_scaled_cutout
    scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 251, in get_scaled_cutout_basic
    iscale_x = float(old_wd) / float(new_wd)
ZeroDivisionError: float division by zero
pan focus cb: chname=Image
Channel is Image
Current channels are ['Image']
Switched page to 0
Traceback (most recent call last):
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageQt.py", line 277, in _redraw
    super(FitsImageQt, self).redraw(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 344, in redraw
    self.redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageCanvasQt.py", line 38, in redraw_data
    super(FitsImageCanvas, self).redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 350, in redraw_data
    rgbobj = self.get_rgb_object(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 376, in get_rgb_object
    self._imgwin_wd, self._imgwin_ht)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 470, in get_scaled_cutout
    res = image.get_scaled_cutout(x1, y1, x2, y2, scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 279, in get_scaled_cutout
    scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 251, in get_scaled_cutout_basic
    iscale_x = float(old_wd) / float(new_wd)
ZeroDivisionError: float division by zero
pan focus cb: chname=Ginga
Channel is Ginga
Current channels are ['Image', 'Ginga']
Switched page to 1
1076 1076
Traceback (most recent call last):
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageQt.py", line 277, in _redraw
    super(FitsImageQt, self).redraw(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 344, in redraw
    self.redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageCanvasQt.py", line 38, in redraw_data
    super(FitsImageCanvas, self).redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 350, in redraw_data
    rgbobj = self.get_rgb_object(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 376, in get_rgb_object
    self._imgwin_wd, self._imgwin_ht)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 470, in get_scaled_cutout
    res = image.get_scaled_cutout(x1, y1, x2, y2, scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 279, in get_scaled_cutout
    scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 251, in get_scaled_cutout_basic
    iscale_x = float(old_wd) / float(new_wd)
ZeroDivisionError: float division by zero
Traceback (most recent call last):
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageQt.py", line 277, in _redraw
    super(FitsImageQt, self).redraw(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 344, in redraw
    self.redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/qtw/FitsImageCanvasQt.py", line 38, in redraw_data
    super(FitsImageCanvas, self).redraw_data(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 350, in redraw_data
    rgbobj = self.get_rgb_object(whence=whence)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 376, in get_rgb_object
    self._imgwin_wd, self._imgwin_ht)
  File "/Users/deil/code/ginga/ginga/FitsImage.py", line 470, in get_scaled_cutout
    res = image.get_scaled_cutout(x1, y1, x2, y2, scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 279, in get_scaled_cutout
    scale_x, scale_y)
  File "/Users/deil/code/ginga/ginga/BaseImage.py", line 251, in get_scaled_cutout_basic
    iscale_x = float(old_wd) / float(new_wd)
ZeroDivisionError: float division by zero

ImportError for IPython in ginga/qtw/ipg.py

Something changed in IPython ... with the latest dev versions of IPython and Ginga I get this error:

In [1]: from ginga.qtw import ipg
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scikits/__init__.py:1: UserWarning: Module readline was already imported from /Users/deil/Library/Python/2.7/lib/python/site-packages/IPython/utils/rlineimpl.pyc, but /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline is being added to sys.path
  __import__('pkg_resources').declare_namespace(__name__)
ERROR: ImportError: No module named zmq.ipkernel [IPython.core.interactiveshell]
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-ecaa36b963f9> in <module>()
----> 1 from ginga.qtw import ipg

/Users/deil/code/ginga/ginga/qtw/ipg.py in <module>()
     15 
     16 from IPython.lib.kernel import connect_qtconsole
---> 17 from IPython.zmq.ipkernel import IPKernelApp
     18 
     19 STD_FORMAT = '%(asctime)s | %(levelname)1.1s | %(filename)s:%(lineno)d (%(funcName)s) | %(message)s'

ImportError: No module named zmq.ipkernel

Pick operation

It seems to fail on openSUSE 12.2. The Error tab show the next messages:

Plugin UI failed to initialize: global name 'FigureCanvas' is not defined
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/PluginManager.py", line 229, in start_plugin_future
pInfo.obj.build_gui(vbox)
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/plugins/Pick.py", line 140, in build_gui
width=2, height=3, dpi=72)
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/qtw/Plot.py", line 29, in init
PlotBase.init(self, logger, FigureCanvas,

Plugin failed to start correctly: 'Pick' object has no attribute 'tw'
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/PluginManager.py", line 252, in start_plugin_future
pInfo.obj.start()
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/plugins/Pick.py", line 719, in start
self.instructions()
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/plugins/Pick.py", line 488, in instructions
self.tw.set_text("""Left-click to place region. Left-drag to position region. Redraw region with the right mouse button.""")

AstroImage complains about WCS when there is none

I wrote a local plugin based on your Histogram to measure local background value from a user drawn annulus. My test image does not have WCS information. When I inspect the log, I see this:

2015-02-06 16:32:39,166 | W | AstroImage.py:568 (info_xy) | Bad coordinate conversion: RA (-1234.551139) is negative
2015-02-06 16:32:39,177 | W | AstroImage.py:568 (info_xy) | Bad coordinate conversion: RA (-1193.458418) is negative

Is it safe for me to ignore this? Better still, is there a way to tell Ginga that it does not have to convert to RA and DEC?

Thumbs order changes on different runs

For testing purposes, I have been starting Ginga with the same four images like this:

$ ginga image1.fits image2.fits image3.fits image4.fits

I notice that their ordering in Thumbs are not consistent between calls. Would be nice to have it ordered alphabetically or at least consistently.

Make scipy an optional ginga dependency?

In the ginga FAQ it says:

Certain Ginga plugins (or features of those plugins) will not work without the following packages:

python-matplotlib (Pick, Cuts, Histogram)
python-scipy (Pick)
python-webkit (WBrowser (online help))

Is it possible to make scipy an optional ginga dependency in the sense that it is possible to start ginga and view FITS images without having scipy?

This would be useful for ginga testing (pip installing scipy is at the build timeout limit for travis-ci, see #10), but I think non needing scipy would also be nice for normal users.

use astropy.wcs for figuring out WCS

Right now it looks like the WCS solutions come from ginga's own wcs.py. I've run into a number of FITS images that don't work quite right I think just because they have one of the bajillion non-standard WCS forms. I think switching to something like astropy.wcs would make a lot of these work, as it's based on a C library with a long history of supporting poorly-written FITS files...

It also means anyone wanting to write a plugin in another affiliated package only needs to undestand one sort of WCS object.

Open file gives TypeError from GingaQT

Trying to open a file via the menu with QT I get this error with Ginga master on Mac with Python 2.7:

Traceback (most recent call last):
  File "/Users/deil/Library/Python/2.7/lib/python/site-packages/ginga-2.0.20140811184717-py2.7.egg/ginga/qtw/GingaQt.py", line 629, in gui_load_file
    self.load_file(fileNames[0])
TypeError: 'itertools.imap' object has no attribute '__getitem__'

The help tab shows "background image" text instead of an image

When I open the help tab, I think there's supposed to be some sort of image in the background. But all I say is a gray panel with the text "background image" in the upper-left and a question mark in the middle that seems to indicate an image is missing. I tried to figure out what image is supposed to be there, but it was not obvious from the source code...

icons/ directory not copyied while installing

I tried to install latest ginga using command
python setup.py install
But while running ginga after install it was saying the following error and gives a frozen ginga window.
ERROR: GError: Failed to open file '/usr/lib/python2.6/site-packages/ginga/icons/openHandCursor.png': No such file or directory [ginga.gtkw.gtksel]

I could solve this issue, by manually copying ginga/icons directory to /usr/lib/python2.6/site-packages/ginga/

Why didn't python setup.py install automatically do that, if that directory was need as part of installation?

PS: The last commit done on setup.py "Fixes for error messages in setup.py" seems to have removed ginga.icons from packages

Display coordinates in fixed positions

When I move the mouse over an image the coordinates alpha and delta and X and Y update very quickly and move a few pixels left and right all the time.
This is a bit blurry ... can you display them in fixed positions?
Or maybe changing to a fixed-width font solved the issue?

Problem opening FITS file

When I try to open a FITS file from the Ginga GUI on a openSuSE 12.2 (Python 2.7.x and PyQt 4.10.3) I get the next error:

Failed to load file '/home/panic/prueba2.fits': integer division or modulo by zero
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140915194611-py2.7.egg/ginga/Control.py", line 468, in load_image
image.load_file(filepath)

File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140915194611-py2.7.egg/ginga/RGBImage.py", line 75, in load_file
data_np = self.io.load_file(filepath, kwds)

File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140915194611-py2.7.egg/ginga/util/io_rgb.py", line 98, in load_file
return self._imload(filepath, header)

File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140915194611-py2.7.egg/ginga/util/io_rgb.py", line 204, in _imload
data_np = qimage2numpy(qimage)

File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140915194611-py2.7.egg/ginga/util/io_rgb.py", line 332, in qimage2numpy
qimage.bytesPerLine() * 8 / qimage.depth())

Any idea about what it the problem ? I have tried with others FITS files, but I get always the same error.

HDF5 I/O question

Hi, I'm trying to write a file handler for HDF5, via the technique mentioned here:
http://ginga.readthedocs.org/en/latest/manual/internals.html#sec-custom-io
and was hoping to get some clarification on a few things. Firstly, in the example

class MyIOHandler(object):
    def __init__(self, logger):
        self.logger = logger

    def load_file(self, filespec, header, **kwdargs):
        return (data, naxispath)

    def save_as_file(self, path, data, header, **kwdargs):
        pass

What exactly is naxispath? It wasn't clear from the code what to pass.

Also, this method isn't working for me:

from ginga import AstroImage
AstroImage.set_ioClass(MyIOHandler)
...

image = AstroImage.AstroImage()
image.load_file(path)
...
view.set_image(image)

As AstroImage does not appear to have a method set_ioClass. I do see this method under AstroImage.AstroImage.set_ioClass(), but haven't been able to get this method working.

Image Cuts operation

It also seems to fail on my openSuSE 12.2:

Plugin UI failed to initialize: global name 'FigureCanvas' is not defined
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/PluginManager.py", line 229, in start_plugin_future
pInfo.obj.build_gui(vbox)
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/plugins/Cuts.py", line 69, in build_gui
self.plot = Plot.Cuts(self.logger, width=2, height=3, dpi=100)
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/qtw/Plot.py", line 29, in init
PlotBase.init(self, logger, FigureCanvas,

Plugin failed to start correctly: 'Cuts' object has no attribute 'plot'
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/PluginManager.py", line 252, in start_plugin_future
pInfo.obj.start()
File "/usr/local/lib/python2.7/site-packages/ginga-2.0.20140926001201-py2.7.egg/ginga/misc/plugins/Cuts.py", line 241, in start
self.plot.set_titles(rtitle="Cuts")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.