Author Topic: Blind Solver  (Read 44217 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6782
    • View Profile
    • http://pixinsight.com/
Re: Blind Solver
« Reply #15 on: 2010 April 23 02:08:41 »
Another possibility would be writing a PixInsight module with the astronomy.net code (or the relevant part of it) embedded and adapted to the PCL. I don't know if their license terms would allow this, but of course the PI module would be published under GPL. If there is visible energy here to work in this direction, I can contact astronomy.net's authors asking for permission to start this project. Of course, something like this cannot be done without the direct blessings from the authors.

I don't know either how difficult this embedding task could be, but if the code is C and/or C++, it can be done for sure. The only thing that we need is a group of volunteer developers seriously interested. I would be part of that group very happily. My relativistic time line would limit my contributions though, but you could count with me for any advisory, documenting and helping tasks.

There's no need to explain the huge and rich functionality that the PixInsight platform would gain with this project, is it?
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #16 on: 2010 April 23 02:40:24 »
Hmm, 534 .c files, not all of them in the main program (some are libraries like cfitsio, others are demos etc). 278 header files. Not an easy walk, neither something that can not be done  - IF somebody has the time. The license of the code is GPL, so you can use it, as soon as you release your final product under GPL also.

I did not had the time to dig inside PCL, I'm new in the PI world (a fanatic though), and so far I was trying to find my way just on how to use it :  porting something like this to PCL means Javascript ?

John
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6782
    • View Profile
    • http://pixinsight.com/
Re: Blind Solver
« Reply #17 on: 2010 April 23 03:02:00 »
Hi John,

Welcome to PixInsight Forum by the way.

534 .c files... the PixInsight Core application has currently 479 .cpp files (not counting modules and external libraries) so this scares me but not too much :) If the astronomy.net application is reasonably self-contained, then the embedding work should not be really difficult IMO.

PCL is exclusively ISO C++ code; no other languages at all, including JavaScript. For documentation on the current version see:
http://pixinsight.com/developer/pcl/doc/html/
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #18 on: 2010 April 23 03:28:53 »
Thank you Juan for the welcome - I waited a few months before start posting.

Hmm, I think it will be more difficult to organize a port to be in the "PI (PCL) way" (OO oriented etc), than just to port the code :)

Thank you for the pointer. Although my time is also extremely limited, I'm intrigued and may took a look in this project. Any example of code available for newbies in PCL ? PCL's documentation is extended, but in a magnitude that can scare a hell of a newbie - no matter the professional experience behind :)

John
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2131
    • View Profile
Re: Blind Solver
« Reply #19 on: 2010 April 23 03:47:43 »
Wow, you guys are fast...

Since this licensing discussion has come up, a few words on this (written in my lunch break, more tonight):

- The Blind Solver software itself is published under GPL v2, see http://www.astrometry.net/use.html. As I understand GPL, it would not be ok to link this (or derived work) with a close sourced product. And PI is closed source... . According to GPL it would be ok to  package the (standalone) executables with PI, but I think even this should not be done without the author's blessing.

- Calling an external GPL program from some other program also is ok according to the GPL. And this is what my script currently does. I will not provide databases or Blind Solver executables. You will have to build and/or download these yourself.

- The pre-build databases provided by astrometry.net are based on a cleaned version of the USNO-B catalog. The astrometry team apparently gives non-commercial users access if you ask them. The use conditions are formulated in http://trac.astrometry.net/browser/trunk/src/astrometry/GETTING-INDICES. The key sentence here is:

Code: [Select]
NOT-FOR-COMMERCIAL-USE: Because the indexes represent a re-release of
36    data originating in the USNO-B Catalog, the indexes may not
37    be used for any commercial purpose whatsoever without prior written
38    consent from our team.  Our consent will only be granted to
39    commercial users for use in public, not-for-profit projects they
40    are engaged in or supporting.


As I understand this, it is unlikely that those databases can be redistributed with PI.

- Blind Solver also provides the tools to create databases from star catalogs, but this is something I have not done,  so I dont really know how complicated this is. The license conditions for such a database would probably depend on the license conditions of the original data.

- from the technical point of view: Blind Solver is a collection of executables that work with each other to do the job. These cannot go into one DLL or something. It is also likely be a lot of work to get Blind Solver going on non-UNIX systems (i.e. Windows), although this is not impossible.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #20 on: 2010 April 23 04:29:25 »
Yap, Georg is absolutely right, we lost sight  :-[

Any "porting" can not be embedded , GPL is not like the BSD license.
But if it is in a form of stand-alone, shelf included program, and the sources are available, and the release license is still GPL, then it can be used from any program. But then, again Georg has a point: why to "embed" ? in this case, under Linux/Unix, it is just use the program as it is, maybe via a script. The only problem is for environments that does not exist (ie Windows).

Indexes are out of question, you can not redistribute them - either you agree with astrometry.net license or you built yours - period.

John
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline vicent_peris

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 986
    • View Profile
    • http://www.astrofoto.es/
Re: Blind Solver
« Reply #21 on: 2010 April 23 04:39:48 »
Hi,

this is an extremely interesting new project. As I understand, this is a similar case as GREYCstoration. In that case, there was no problem as PI has a modular architecture, so the code of the GREYC module was not directly linked to any other module nor the main app. Then it was suffice publishing the GREYC module code.

Could be done in the same way for astrometry.net?


V.

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Blind Solver
« Reply #22 on: 2010 April 23 04:46:07 »
Hi John

Wellcome to PCL development ;)
Take a look at the source folder in PixInsight's one. There you'll find a lot of examples of code. Sandbox is the "easier" of them, providing a perfect example for beginners.


PS: If you need a hand developing it, here are mine. Although, I'm warning you that I have two left ones ;) VBG Seriously, I can help with the PCL style, but not that much with all that cross platform stuff, and advanced programing.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #23 on: 2010 April 23 07:34:49 »
Thank you guys, even though I'm not sure if I'm the correct person to be welcomed to a developers team.
Too many years out of the development and too limited time  :(
OK, today the boss was not looking, so I upgraded my 4 years old Cygwin port with the newest, included gcc, make, automake and everything related to cairo, netpbm, libpng, libjpeg, python and numpy, as in astrometry.net's README and run make. It seems to compile up to the point that it is trying to make the extra "eye candy" stuff, ie cairo, netbpm etc. I guess I have to do it from the scratch, but use some trick like:

CC="gcc -I /usr/include/cairo -I /usr/include/netpbm" make

to pass - stay tuned. The issue is that I now have a working solve-field.exe which seems to work, but I have to test from home (I do not have the indexes with me and it is a pain to download again).

A bravo to both Cygwin and astrometry.net guys, they have done a great job  8)

So I guess, this is a fast solution for Windows users and it is up to Georg and his script ?

John
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2131
    • View Profile
Re: Blind Solver
« Reply #24 on: 2010 April 23 09:39:42 »
...
A bravo to both Cygwin and astrometry.net guys, they have done a great job  8)
...

Bravo John,

you are faster than I am in writing the articles and the script.

Regarding Windows: If you can get the blind solver compiled on Windows/Cygwin, I don't think it will be too difficult to get my script running there as well. A few "if(Windows)" statements in the JavaScript code should do the trick (path names, tmp directories, things like these). I currently also need a small PCL/C++ module http://pixinsight.com/forum/index.php?topic=1791.0 that should not be difficult to port to Windows, or that even can be replaced with pure JavaScript with slightly reduced functionality http://pixinsight.com/forum/index.php?topic=1791.msg10924#msg10924. If you want to have the labels (and not only the WCS coordinates), your probably need to get the "eye candy stuff" (netpbm etc.) working on Windows as well.

Attached a labeled version of M45 by Harry (http://www.harrysastroshed.com/Image%20html/m45eq120.html, used with kind permission).

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
    • View Profile
Re: Blind Solver
« Reply #25 on: 2010 April 23 10:08:28 »
Actually guys,

It occurs to me tha, perhaps, the BlindSolver team might actually be quite 'keen' to see their hard work put to use as an add-on to the likes of PixInsight. In which case, an opening discussion with Juan, and maybe those of you who better understand what would be needed to implement the code (and satisfy all the licensing agreements), would be a great start.

Obviously, PixInsight - as, and of, itself - does not 'need' a BlindSolver add-in. And exactly the same could be said of BlindSolver itself - it doesn't 'need' the likes of PixInsight in order to survive.

However, I definitely see a 'kindred spirit' between the two applications. Both are born of a desire and are driven by passion. OK, so PixInsight (eventually) 'went commercial', but I very much doubt that Juan was in any great 'rush' to start earning money off his hard work, simply because the moment you 'set a price' you shift your own goal-posts - and generally make life an order of magnitude more complicated for yourself.

Let's see if an exchange of ideas CAN take place - and if nothing can be made to work out, there is no real loss (for either side). After all, PixInsight users can still upload their images to the Flickr site and have them BlindSolved 'on-line'.

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chr├ętien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #26 on: 2010 April 23 10:46:44 »
I can not comment on Niall's post, I'm new here and all these are beyond me.

I managed to fully compile it it under Windows, something compliant with GPL, if anyone is interested read below.

My "porting" is via Cygwin, meaning that you will need both Cygwin's library (libraries ? not sure) and most probably all the standard shell tools, like bash, sed, awk etc that come with , plus the directory tree under c:\cygwin. The developers of astrometry.net warn for the need for shell tools, but I'm not sure if they mean during compilation or during operation of the program. For the same reasons I do not know if a binary distribution has any meaning - without Cygwin it may be unusable. But I may be wrong here , I have years to follow these things. And in any case all these are GPLed, meaning that they can not be included as part of a commercial product, only under the conditions GPL allows. Compiling with the minGW32 compiler may minimize the dependencies on Cygwin libraries, but again I think you will need bash etc., so......

Nevertheless it is fairly easy to have a Cygwin installation just for this. And that means that Georg's script needs the minimum of trimming, basically run the solver via a batch file that will run the program via Cygwin's bash first, or maybe just a "bash -c ...... "will do the trick.
 
Anyway, for those that are interested to compile it for their usage under Cygwin :

1) Download the setup from Cygwin project and start the installation - follow the instructions
2) During the setup, at the package selection be sure that you included the following:

      gcc, sed, gawk, make, automake, pkg-config, python, gzip, bzip2 and all packages related to
      cairo, netpbm, libpng, libjpeg, and numpy  (libraries etc)

I may miss some packages from the above list, since I had the installation already from the past and some packages have been there for years. You have to play it as it goes, and go back to the setup program later to install any missing package(s). WARNING do not trash the setup program after installation exactly for this reason.
The file README in the archive actually have most of the following steps. The command

   df -h

is your friend inside a Cygwin bash shell to help you understand how the different Windows drive letters map to Cygwin's unix-like filesystem.
You will need to remember your command line skills, and at least know how to issue commands like cd or ls.

3) open a Cygwin bash shell and untar the package ie, (assuming that you are in the directory that the astrometry.net's source archive is), run

   tar xjvf astrometry*tar*bz2
 
   cd astrometry*


4) edit the file util/makefile.netpbm (use either wordpad or an editor from inside the cygwin shell, eg vim or nano or mcedit) and change line 17 to be

NETPBM_INC := -I /usr/include/netpbm

4) from the top directory run

   make
   make install
   make install-indexes

(see README)

5) edit your Cygwin $HOME/.profile to add astrometry installation directory in your path.


6) Open a new bash shell, you should have a command solve-field.exe in your $PATH

Enjoy


A word about performance: it is slow comparing to native ports eg under Linux. The following image was solved in about 12 minutes under my Linux box and needed about 30 minutes under Cygwin

Enjoy
John

Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2173
  • Join the dark side... we have cookies
    • View Profile
    • http://www.astrophoto.cl
Re: Blind Solver
« Reply #27 on: 2010 April 23 12:03:30 »
wow... I guess that I'll need a whole weekend for an image in my pentium 3 :D
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
    • View Profile
Re: Blind Solver
« Reply #28 on: 2010 April 23 13:17:53 »
Having just read that post from Ioannis, I reckon that it could take me about 10 YEARS to get BlindSolver installed :'(

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chr├ętien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
    • View Profile
Re: Blind Solver
« Reply #29 on: 2010 April 23 13:31:23 »
Naahh, it is not so difficult, do not let the detail I tried to put in the post to confuse you.
Actually it is more like a 1,2,3,4 procedure.
And - license permitting - can be a zip file that you unzip over a standard out-of-the box
Cygwin installation (just the code, again the data can not be redistributed, each person
should do them after)


John
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)