Friday, June 17, 2016

Import, export FITS

There are some new features that I've implemented since my last posts, let's see them!
FITS tables can be imported to spreadsheets now. Let's see how it works:

FITS table imported to a spreadsheet
As before, I compare my results with the results of FV (FITS Verify). I set the column comments to the units defined for the columns in the FITS if they're available.

You can now export your matrices to FITS images! If the file exists, it just appends a new image extension, if not, it creates a new FITS file, check out the header of an exported matrix, and the tree of the file:

Header keywords of the exported matrix

You can export your spreadsheets to FITS tables too!

Currently the export dialog for FITS files

And then you can check out your file's header:

Header of the exported FITS file
 Great, isn't is?! If the file didn't exist yet, it creates one with an empty primary array, and appends an ASCII table. It still needs more improvements of course.

And then let's import back our exported spreadsheet:

The exported spreadsheet imported

There are still plenty of things to fix, and others to implement of course :)

Friday, June 10, 2016

Let's modify your FITS files

Another great step for the project, now you can add new keywords, or remove them from the extensions!
There are some restrictions:
  • you're not allowed to remove mandatory keywords (still needs some polishing)
  • you're not allowed to add mandatory keywords, since those must be available when you create the extension
  • no duplicates
Take a look at the newly added keywords, the DATE keyword proves, that it was written to the file, since cfitsio has a special method for adding DATE keywords, which sets the value and comment fields:

The new keywords
There are still many things to do, to refine:)

Thursday, June 2, 2016

Strong kickoff

Ever since I've connected with my mentor (Stefan) I've worked on LabPlot. Even before the community bonding period I have implemented LaTeX exporting support for spreadsheets and matrices. You can export now your datas in LaTeX tables, this is the export's dialog:

LaTeX export options

And then you can create some nice looking pdf's, like:

Exported LaTeX file converted to a PDF

In the community bonding period I did some modifications on it and just a few days after my project got accepted I started working on my project as my mentor suggested, because I was already familiar with the code and I had everything set up. My project's main goal is to enable importing of FITS images and tables in LabPlot.
In extra I had some ideas:
  • have a widget for editing (or just listing) the content of a FITS primary header or extension's  header unit. 
  • hopefully, if there will be time, export to FITS
I've done some of them already, but of course everything is changing yet.
The header edit dialog can be accessed through the Tool -> Edit FITS file header menu. This is how it looks like now:

FITS header preview

Currently you can open files, and for every file a nice tree is created, showing separately the Image and Table (ASCII table, binary table) extensions. In the table you can see the keywords of the currently selected header. I know the layout needs some improvements, soon that will be fixed too. It will be possible here to modify the entries, add new ones, or remove some. I've added some standard keywords from the FITS standard to be accessible from the "Key" KTextEdit. Adding a new keyword:

Dialog for adding a new keyword

After clicking on "Add keyword" you can see the newly added keyword:

Keyword added to the header's preview table

Currently the modifications appear only in the dialog, soon implementing the saving of the changes to the files.
Other thing I have achieved is that it's possible to import already FITS images. As you can see I use the same tree as in the header edit dialog. This is how the import dialog for FITS files looks now:

FITS import dialog - Image preview
The preview works nicely for FITS tables too:

FITS import dialog - Table preview
And then you can import some cool images from FITS files, like:

Imported FITS image
I compare my results with the results of FITS Liberator 3, as you can see, they are pretty the same.
The importing of FITS tables will work soon nicely too, but I think these are already some big steps for the project.

Have fun other GSoC participants!