Sunday, August 24, 2014

Mosstack 0.5 - Mikko's Open Source Stacker for astronomical images

Finally a new version and a new unimaginative name.

What's new?

  • Name! PyAstroStack was only a temporary name I came up with when I created a directory for the source code. The py prefix and camel case started to annoy me so I wanted to change it now.
  • Multithreading in Gui. Most operations can run in parallel utilizing more than one core from CPU
  • Settings in Gui. Command line is not required anymore, but I'm not going to drop it.
  • Icon and shortcut in your desktop environments menu
  • Packages for Debian Jessie and Sid
  • Lot of changes under the hood making mosstack a lot stable than the older versions.
You can get the program from https://bitbucket.org/mikko_laine/pyastrostack/downloads. On Ubuntu I suggest using the ppa archive:

sudo add-apt-repository ppa:mikko-laine/pyastrostack

The repository is still under the old name. After this update sources and install package mosstack.

Next I'll start working on some kind of a manual. If you're familiar with the stacking process (know lights, darks, flats and biases) the program should be quite straightforward to use.

Friday, August 22, 2014

AstroStack: Closing on 0.5 release and roadmap to future releases

No, there's no new name. I didn't come up with anything. The name is now AstroStack and executable is astrostack with no CamelCase. I'll also change distribution package names and Gentoo and Ubuntu releases to lowercase.

Since there's a graphical user interface now I thought it would be nice to have an icon as well. I'm not sure if my graphic skills even match my coding skills, but here it is:
I'm also including a .desktop file so AstroStack will be found in the menu of desktop environments that support these files. My understanding is that they all should.

A release candidate (RC3) is already uploaded in BitBucket and Launchpad. The program itself is working fine on RC3 (at least it seems so...), but lacks documentation, .desktop file has some problems and the icons are in wrong format. I hope I have enough time to finalize this on the weekend. Now that I go to work again after one year of child care leave, my time on this project is more limited.

Roadmap to future releases:

Some planned features:

0.6

  • A manual
  • Frame information table on Gui. There's already a place holder for it but no functionality. Click a frame from the list and this should show all the extracted info.
  • Have command line interface use the same methods on class Frame the Gui uses
  • Setting for choosing memory limits for stacking. I have no idea how to limit by megabytes, but I can choose how many pieces the stack is split into. This could somehow depend on the setting.

0.7 or later

  • Show frame when clicked. Maybe as a pop up window.
  • Choose the reference frame which the rest are aligned to.
  • Choose cropping from the reference frame. This will save a lot of time and memory during the stacking process.

Wednesday, August 6, 2014

Problem of giving a name for software

PyAstroStack was supposed to be a temporary name I gave to the directory holding the code. I planned to change that before uploading anything to a public repository. Then after 0.1 I decided 0.2 is going to have a proper name, but no...

Now I'm planning the same for 0.5. I'm also planning on moving the public repo from BitBucket to Github so the name should be decided before that. I'm just out of ideas.

What do I want from the name?

The most important thing is simplicity of writing it. Even with Bash's autocomplete with tab, difficult commands are a pain to type. The current name is quite good from this point of view but I have to drop the capitals from command names. What was I thinking when I named the executable "AstroStack"?

Secondly I'd like the name to be relevant in some way. The program stacks astronomical images, yes, current name seems to work here as well. I've been thinking names of star constellations, nebulae, galaxies and so on, but haven't found anything sufficient. Different versions are currently being named after constellations. 0.2 was Andromeda, 0.4 was Orion and 0.5 is Cassiopeia. This name is only visible at the git branch at the moment, but maybe I'll put it in a more visible place in the future.

Third thing is, I don't want the name to be boring like pyAstroStack. I've been thinking an acronym, like so many other open source software have, but I lack the imagination for this. Also the acronym should form some relevant word.

Maybe I'm too stuck with the word stacker. All my ideas seem to include that. I should try something completely different. Or maybe I'll stick with this after all. In that case I'll drop the py prefix.

Any ideas?

Thursday, July 31, 2014

pyAstroStack: Multithreading vision and status

The GUI of pyAstroStack works reasonably well (for such a limited gui that is...) in version 0.4, but my original plan was a little different. Now that I have time to code again after summer, I'm finally getting my vision to work.

Here's a screenshot of current 0.5dev


Vision

I want the list of files to be more interactive. First column shows the file path, second is frame type, but the rest are what I'm working on. Decoded means reading the RAW file and decoding it to FITS. Numbers 0, 1 and 2 are place holders for "Not started", "Working..." and "Done". I'm not sure if I want some kind of icons or rolling animations there, but for now only the place holders.

The moment you select some images and click OK, the program starts decoding them on background. Gui will be responsive all this time and you can select more files while it's working. You can also set parameters for full process while it's working on background.

Status

My problem was that even I had multithreading set up, the gui stayed unresponsive and didn't update. I searched and read lots of tutorials and stackoverflow questions, but no help. Finally I found it! I had

threadpool = QThreadPool()

but instead it should have threadpools parent as an argument. I changed it into

threadpool = QThreadPool(self)

and everything started working. This might be obvious for more experienced PyQt programmers, so I can understand why no tutorial emphasized the importance of it. Maybe now I remember that all QWidgets require the parent as an argument.

Decoding works with 5 simultaneous threads, but with 10 there are random errors. I wonder if the threads are trying to use same files at the same time. If so, it has to be fixed. The rest of the program is currently broken (on 0.5dev, on 0.4.1 it works of course) because I had to do significant changes to the frame handling to get multithreading to work.

Thursday, April 17, 2014

PyAstroStack: Now with easier installation for Ubuntu 14.04 and Gentoo

Installing with python setup.py install is fairly easy but taking care of the dependencies can sometimes be ugly. I always wanted this program to be easy to install and now that's happening; for Gentoo and newest Ubuntu 14.04.


Gentoo: Science overlay

Most Gentoo users are familiar with layman, overlays and unmasking masked packages. For most, that's the reason to use Gentoo. Easy installation for almost everything. Stuff that isn't on Portage tree can be added for easy emerge with overlays and layman takes care of them. I wrote an ebuild for pyAstroStack and it was accepted in the science overlay.

If you're not that familiar with all that, this will probably help:

# emerge layman
# layman -a science
# emerge --autounmask-write -v pyAstroStack
# dispatch-conf
# emerge pyAstroStack

The --autounmask-write creates unmasking configurations and dispatch-conf or etc-update integrates them into /etc. This will install Python 2 and/or Python 3 versions according to your PYTHON_TARGETS variable in /etc/portage/make.conf.

Ubuntu 14.04

I know there's Launchpad and apt-repository for community packages but I'm not there yet. Maybe soon, but for now there's only a .deb file to download and install.

Download pyastrostack_0.3.0-3_amd64.deb from https://bitbucket.org/mikko_laine/pyastrostack/downloads and

# sudo dpkg -i pyastrostack_0.3.0-3_amd64.deb
# sudo apt-get -f install

First line will mark the package to install but the installation will fail due to missing dependencies. Second line fixes all that and installs everything required including the software itself.

Other Linux distributions

Of course I'd like to support everything. The .deb I made does not necessarily require Ubuntu so it most likely will work on Mint and other Ubuntu derivatives. It also might work on Debian, but that's more uncertain. Debian specific package will be ready in near future.

Python's distutils support creating RPM's but I haven't tested those at all so I will not distribute them.

For everything else I recommend the python setup.py install line and manual installation of all the dependencies.

Tuesday, April 8, 2014

pyAstroStack 0.3.0 - Lots of speedups and OpenCL no longer required

I released 0.2.1 just about a week ago and now I'm about to push 0.2.5 out. First the updates were indeed minor, but they grew and became quite important considering the whole program. After finishing 0.2.5 and hunting down its bugs I decided this version should be 0.3.0 instead.

Installation still requires Python-pip on Ubuntu 13.10, but I'm already targeting this on soon to be released 14.04. There might even be a deb-package or repository on Launchpad if I figure them out.

Here's a summary of changes:

  • Bilinear and Variable Number of Gradients (VNG ) debayering algorithms. This makes PyOpenCL not required. With OpenCL the methods are a bit faster but the difference is about 10-20%.
  • PyAstroStack will work on Ubuntu 14.04 without too much hassle. There are a lot of packages to install but everything seems to be on package manager.
  • Fixed a huge memory leak on registering operations.
  • Registering speedups on 
    • correctly Cythonizing _step2.pyx
    • changing ImageMagick to Scikit-image
    • not requiring SExtractor and star matching if registering (aligning) same batch again
Full list of changes in distribution package on in Git repository.


Prints from AstroStack

Saturday, March 29, 2014

pyAstroStack 0.2.1 - Now it might even work!

Should I say it once more? I really don't have experience on working with any programming projects this big. I seem to learn everything the hard way. Before releasing the first alpha, the biggest problems were with writing the user interface. Something I've never done properly. Everything has been my own little programs so I always could edit the source. No need for UI then...

But even that was something I just needed to work on. After 0.1.0 it came to my knowledge that the program is too difficult to install. Not pyAstroStack itself but its requirements. Some libraries I used were on Gentoo's Portage, which I use for coding and testing, but they're missing even on Ubuntu or Debian. That could be circumvented with Pip. A bigger problem was OpenCl. My debayering algorithms rely on pyOpenCl and the program is quite useless without it. On Gentoo it worked if I had just the right version of Nvidia drivers, but on Ubuntu it didn't. It was possible to hack it working, but I'd rather have it easier.

On Ubuntu 14.04 things seem to work better. I haven't tested everything yet but at least OpenCl works after installing Nvidia's proprietary drivers.

Version 0.2 doesn't have any new features. There are rewritten classes, some speed improvement, things work a lot differently under the hood... Most changes were preparing to write a graphical user interface. I've chosen PySide with QML for implementing it. Now I just have to learn how to write QML. :)

Here's a link once more to download pyAstroStack: PyAstroStack on BitBucket