Thursday 21 August 2014

SunPy Database Browser Final Report

It gives me great pleasure to write this post about the SunPy Database Browser, that I developed as part of the Google Summer of Code'14 for the organization SunPy. It has been a wonderful and I feel delighted to say that the first version is ready. I have developed the plug-in as a plug-in with Ginga, an astronomical FITS file viewer, so as to enable side-by-side viewing and manipulation of Solar FITS files. The plug-in is wrapped as a Python package 'ginga-sunpy' which can be easily installed by the following steps:

  1. First install Ginga if you don't have it already.
  2. Download the code (or clone this repo).
  3. To install
    • For general use, from the ginga-sunpy directory run python setup.py install.
    • For developers, from the ginga-sunpy directory run python setup.py develop.
    • Run ginga-sunpy from your command-line and Ginga will open with the SunPy plug-in running.

    The following database parameters are needed by the plug-in to connect to the database:
  • Driver: Database name such as mysql, oracle, postgresql, etc., and driver the name of a DBAPI, such as psycopg2, pyodbc, cx_oracle, etc.”
  • Database Name: Name of the database to which to connect. (Can also specify the path to the database here)
  • User: Username of the user
  • Password: Password of the User

Optional Parameters

  1. Default Wavelength Unit
  2. Set Database as default

Actions

  1. Connect: Connects to a database based on passed arguments. Defaults to sqlite:///sunpydb
  2. Add file to Database: Adds new entries to database based on the selected file from a File Dialog Box
  3. View Database: Opens a new tab with tabular display of database entries
  4. Open Database: Connects to a sqlite database selected from a File Dialog Box
  5. Commit to Database: Commits the new entries added, changes made to the database

Database Table

  • Entries are displayed one-per row
  • The following attributes are displayed
    • id
    • path
    • observation_time_start
    • observation_time_end
    • instrument
    • min_wavelength
    • max_wavelength
    • is_starred
  • On clicking on any database entry's row, the FITS file associated to that entry opens in Ginga
  • Can display only the starred entires by selecting the 'Show starred entries only' checkbox below the table

    The repository can be found at  https://github.com/sunpy/ginga-sunpy

Saturday 5 July 2014

SunPy Database Browser Meeting on 5th July, 2014

Nabil, Stuart and I had discussion regarding the Sunpy Database Browser on the 5th of July, 2014. Various points were discussed during the meeting:
1. EIT files seem to have a problem with being loaded in into the SunPy database. This is because the SunPy database does not apparently allow WAVEUNIT attribute to be None. And the EIT file in the sunpy.data.sample has WAVEUNIT as None. Thus it is not been able to load in the database. This can be due to one of the following two problems:
a. The header of the SunPy's sample EIT file is faulty
b. The SunPy database module apparently does not have the functionality to deal with None WAVEUNIT, and hence EIT files
So, Nabil has assigned me to try and download more of EIT test files and check their headers. If the header of SunPy's sample file is faulty then we will replace the SunPy's test file else we will amend the sunpy.database
2. Stuart has created a pull request for solar co-ordinate handling in Ginga. I shall try to pull in this PR and try to render SunPy's sample, solar FITS files and take screenshots to send to Eric.

3. Start work on the Search Box feature in the Database GUI

Tuesday 24 June 2014

SunPy Ginga Database Browser Status

I have been able to get a local plugin to work in the main inteface of Ginga and it is now able to open a new window and display the database in a separate window. I am attaching a few of the screenshots. I shall also now get to trying to display the database as a Ginga tab, but I am afraid that it will be slightly cluttered if we do that. However, I will try to do that any ways. I shall try to explore the options that if we can easily add a separate side box under the main viewing area of Ginga (like the Debugging box in most IDEs) and use it. So to get the plugin working, follow these instructions:

  1. Copy the file SunPyDatabase.py to $HOME./ginga/plugins
  2. Run from your terminal "sudo ginga --plugins=SunPyDatabase"
  3. The Ginga window opens; select SunPyDatabase by clicking on Operation button, which is present at the bottom of the central Image view area.
I am also attaching a few screenshots that I have obtained.