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


Saturday, February 22, 2014

pyAstroStack: First alpha release!

First I have to say that this project was a lot bigger than I thought. Even on the limited functionality it has now there was a lot more work I was prepared to. And all that work was surprisingly mostly user interface and saving the temporary files. I'll write a bigger post on all the problems I ran into and let this post be the announcement of the first released version of pyAstroStack.

No, I really haven't come up with a better name...

PyAstroStack 0.1


PyAstroStack is an open source stacking software for astronomical images taken with DSLR. This first version includes basic functionality such as subtracting and dividing images, debayering, registering and stacking. Supported image formats are limited to Canon EOS 1100D CR2 and similar. Don't expect anything spectacular. I'm not very experienced programmer.

Here's an example image what pyAstroStack can do. This is a median stack of about 30 exposures.

Image stacked with pyAstroStack. Full size in http://www.flickr.com/photos/96700120@N06/12621177443/

Features

  • Command line user interface
  • CFA to RGB conversion on OpenCL which makes it quite fast
    • Bilinear
    • LaRoche-Prescott
    • Variable Number of Gradients
  • Registering
    • SExtractor and method from http://adsabs.harvard.edu/abs/1986AJ.....91.1244G
  • Aligning
    • Affine transformations by ImageMagick
  • Stacking
    • Mean value
    • Median value

Supported cameras

  • Canon EOS 1100D
  • Everything else from Canon that has Bayer filter RGGB

Usage

  • Command line only. You really need to read the manual to use this. The software could really be user friendlier.
  • There might be a GUI in the future

Installation

Download and extract source package. See INSTALL.txt.

Help needed!

I have only access to one camera. Also my data isn't too good, I'm aware of that. That of course limits my test runs. What I would really appreciate is some raw photo sets that allows me to run tests on different features. 
  • Set of some light frames and proper flat frames. I'm bad at taking flats whenever I even bother to take them. This has made it quite difficult to implement flat frame calibrations properly.
  • Single example images from different cameras. This is just to make sure my program recognizes them and is able to debayer them properly. These images don't even have to be astronomical. Just something with recognizable colors.
If you would like to help, please contact via Google+

Wednesday, February 19, 2014

Moon for scale: Part 2

I did some comparison of apparent sizes of deep sky objects and the Moon (http://mikkolaine.blogspot.fi/2014/01/size-of-deep-sky-objects-compared-to.html) and that seems to be the most visited page on my blog so time for another one. These were actually made the same time with Andromeda and Orion Nebula, but for some reason I didn't include them in that post.

Flame Nebula and Horsehead Nebula

Names for these nebulae are quite describing. Flame nebula is easily visible and Horsehead a bit fainter. That red color is mostly filtered by digital cameras. With a modded camera that has the filter removed all the red details would be a lot brighter. Most people have seen photos of the Horshead nebula, but here's the size illustrated:

Bigger version: http://www.flickr.com/photos/96700120@N06/12630499714/

Jupiter

It's not a deep sky object, but interesting whatsoever. With naked eye Jupiter seems just like a star, but even a small telescope or binocular can show that it's not. Here's a composite picture comparing Jupiter and the Moon.

Bigger version: http://www.flickr.com/photos/96700120@N06/12630057315/

That's about it...

I don't think I have any more interesting photos to show. There hasn't been too many nights this winter to shoot any astrophotos... Too bad.