Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Table of contents

  1. Pylipse
  2. How to run
  3. Options
  4. Help
  5. Requirements


A GUI for manual ellipse fitting for Elliptical and Spiral galaxies ...


How to run

        python [options]


        python -j  NGC4037 


        Use the `-h` flag to see all the following options.

         - You need to have at least a FITS file of your galaxy in either u,g,r,i,z bands. 
         - The file name must have this format: <object_name>_<filter>.fits
         - where filter is u, g, r, i, and/or z. 

         - You can also have these images in PNG format: 
          - In that case these images would be used for a colorful display. Otherwise the FITS file is used for the preview display.
          - This program us able to call DS9 program to open FITS files for manual ellipse fitting. 
          - FITS files wiil be also used for their WCS information.

          * To download ds9:

          Note: PNG and FITS files should exactly match and have the same dimestions. 

         - Example: 
            $ python -j pgc57129
              where: "pgc57129_g.fits" and "pgc57129_gri.png" are correscponding g-band FITS and PNG color images.
            $ python -h 
              To see help and all available options.

          -h, --help            show this help message and exit
          -j OBJECT, --object=OBJECT
                                The object name


Mouse Actions

Use mouse middle wheel for scrolling

A) When mouse pointer is on the image

  • scroll-down = zoom-in
  • scroll-up = zoom-outer
  • middle-click = re-center the image

B) When anywhere on the GUI window

  • Ctrl+Scroll_up = increase the semi-major axis

  • Ctrl+Scroll_down = decrease the semi-major axis

  • Shift+Scroll_up = increase the semi-minor axis

  • Shift+Scroll-down = decrease the semi-minor axis

  • Alt+Scroll_up = increase the position angle (PA)

  • Alt+Scroll_down = decrease the position angle (PA)

  • PA increases in clock-wise direction.

  • PA = 0 if semi-major axis is horizontal

  • Step-size is displayed in the box next to the a-/b- and PA-control bars.

  • Left click on the box: increases the step size by one pixel

  • Right click on the box: decreases the step size by one pixel

  • Left/Right double click = choose a new center for the ellipse

  • Middle click or enter-key = re-center the ellipse, if a new center has been already chosen

  • Middle double click` = choose the new center and re-draw the ellipse at once (b7+b8)

  • z+Left_click = choose a new center for the ellipse (b7)

  • Esc = Ignoring the new chosen center

C) When the fits file is displayed (no jpg file)

  • chaning the contrast
  • reset the contrst parameters


This code has been tested using Python 3.7.6. For any later python versions, you may need to modify/adjust a few syntaxes to get all the GUI features to work.

This is the list of major Python packages you need.

       - matplotlib
       - numpy
       - optparse
       - astropy
       - pylab
       - PIL

To install PIL (Pillow):

        pip install pillow

Having the following packages is optional (necessary activate the HELP icon in the GUI):

       - tkinter
       - Pmw

Note: tkinter might not be installed using pip. So, you need to install it on your system separately. On Ubuntu, you can use the following command:

        sudo apt-get install python3-tk

   - - - -    

  • Version : v1.0 (March 2016)
  • Author: Ehsan Kourkchi
  • Copyright 2016: Feel free to distribute and modify for a better performance


A Python GUI for manual ellipse fitting on Elliptical and Spiral galaxies ...






No releases published


No packages published