Pharo and Astronomy?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Pharo and Astronomy?

Alexandre Bergel
Hi!

I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Luc Fabresse
Hi Alex, 

 I am also very interested in interoperability with Python to be able to script Blender (http://wiki.blender.org/index.php/Robotics:Contents) from Pharo. 
 However, Blender is only scriptable in Python. 
 So, if you have something, please let me know.

Thanks,

#Luc


2010/11/4 Alexandre Bergel <[hidden email]>
Hi!

I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

YossiDM
In reply to this post by Alexandre Bergel
I haven't used astronomy packages, but I've played around with interop with other languages. I am assuming your goal is that you don't want to replace your libraries, rather just make use of them.

In general, there are a few strategies that also apply to python, but I have never done direct integration:

-Web Services - IMO, the best option if possible and all you want is to send/receive results and super speed is not an issue or calls can be done in logical batches or something. It will depend how your application works if this is an option. We've done this for example with WPF applications consuming Smalltalk code and data in C# as there's no magic bridge between C# and Pharo that I am aware of yet.

-C libraries to act as a bridge (FFI/Alien in Pharo)

-Shell Scripting

-Process calls/integration/shell (OSProcess and the like in Pharo, Piping and such in Python).

-Persistent Store - send data to a persistent store or location and have python or pharo receive push or pull notifications or integration with any of the above. Could be the file system, database, or something else.
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

SergeStinckwich
In reply to this post by Luc Fabresse
On Fri, Nov 5, 2010 at 5:18 AM, Luc Fabresse <[hidden email]> wrote:
> Hi Alex,
>  I am also very interested in interoperability with Python to be able to
> script Blender (http://wiki.blender.org/index.php/Robotics:Contents) from
> Pharo.
>  However, Blender is only scriptable in Python.
>  So, if you have something, please let me know.

Hum, i have the same needs ;-)
Did you start to work on something. I would like to propose a project
for a group of students on this.
Regards,
--
Serge Stinckwich
UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
Every DSL ends up being Smalltalk
http://doesnotunderstand.org/

Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Schwab,Wilhelm K
In reply to this post by Alexandre Bergel
Alexandre,

I don't have any direct experience with astronomy, but we no doubt share some requirements.  I started purging Numerical Recipes from my arsenal long ago, in part over licensing and mostly because so much of the code suffers from Fortran-confusion-syndrome.  What do I mean by that?  Referring to their C book, look at their theoretical development of the Fourier Transform (kinda nicely done), its very natural use of zero based offsets in the theory; note the unit offset code.  Take in the early section in which they attempt to "free" the reader "from the zero based thinking that C encourages, but does not require."  Who did they think they were going to fool with that nonsense?  They had Fortran code and did not want to change it - nothing more.

GSL is not too much better, but they have a working Levenberg-Marquardt fit.  Squeak's lack of callbacks haunts us here.  So far, I have gotten it to run by writing C functions for the model functions of interest to me.  GSL seems to almost randomly require or ignore (often at the wrong times) use of their vectors and matrices.  They have good Fourier and Wavelet transforms.  Squeak/Pharo do not have a Double Array class.  I have gotten around that, but so far at some cost to robustness; I have described many double* arguments void* to allow FFI to make the calls.

The biggest problem with GSL is the license.  Do you have a strategy for releasing code that links to it?  I am perfectly willing to have others use my code.  I would prefer that they be able to make money if they wish.  I will not be told that I cannot make money from it.  A recent thread contains a suggestion for using a "GPL-compatible" license.  Any ideas?

Didier Bessert has been kind enough to release his code under MIT.  To be blunt, I didn't buy the book originally because I was not enamored with the idea of doing numerics in Smalltalk (most/some of it belongs in C for speed), and his selection of topics is not a very good match to my interests.  However, it might be worth considering as a way to avoid GPL code.

For plotting, I have been using PLplot.  You will find many astronomers hanging around PLplot.

Bill



________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
Sent: Thursday, November 04, 2010 3:14 PM
To: Pharo Development
Subject: [Pharo-project] Pharo and Astronomy?

Hi!

I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Alexandre Bergel
Thanks Bill. I am at the stage of convincing Astronomers to use Pharo to do their soft, but this is not easy

Cheers,
Alexandre


On 5 Nov 2010, at 02:57, Schwab,Wilhelm K wrote:

> Alexandre,
>
> I don't have any direct experience with astronomy, but we no doubt share some requirements.  I started purging Numerical Recipes from my arsenal long ago, in part over licensing and mostly because so much of the code suffers from Fortran-confusion-syndrome.  What do I mean by that?  Referring to their C book, look at their theoretical development of the Fourier Transform (kinda nicely done), its very natural use of zero based offsets in the theory; note the unit offset code.  Take in the early section in which they attempt to "free" the reader "from the zero based thinking that C encourages, but does not require."  Who did they think they were going to fool with that nonsense?  They had Fortran code and did not want to change it - nothing more.
>
> GSL is not too much better, but they have a working Levenberg-Marquardt fit.  Squeak's lack of callbacks haunts us here.  So far, I have gotten it to run by writing C functions for the model functions of interest to me.  GSL seems to almost randomly require or ignore (often at the wrong times) use of their vectors and matrices.  They have good Fourier and Wavelet transforms.  Squeak/Pharo do not have a Double Array class.  I have gotten around that, but so far at some cost to robustness; I have described many double* arguments void* to allow FFI to make the calls.
>
> The biggest problem with GSL is the license.  Do you have a strategy for releasing code that links to it?  I am perfectly willing to have others use my code.  I would prefer that they be able to make money if they wish.  I will not be told that I cannot make money from it.  A recent thread contains a suggestion for using a "GPL-compatible" license.  Any ideas?
>
> Didier Bessert has been kind enough to release his code under MIT.  To be blunt, I didn't buy the book originally because I was not enamored with the idea of doing numerics in Smalltalk (most/some of it belongs in C for speed), and his selection of topics is not a very good match to my interests.  However, it might be worth considering as a way to avoid GPL code.
>
> For plotting, I have been using PLplot.  You will find many astronomers hanging around PLplot.
>
> Bill
>
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
> Sent: Thursday, November 04, 2010 3:14 PM
> To: Pharo Development
> Subject: [Pharo-project] Pharo and Astronomy?
>
> Hi!
>
> I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Alexandre Bergel
In reply to this post by YossiDM
Thanks for this summary

Cheers,
Alexandre


On 4 Nov 2010, at 20:58, YossiDM wrote:

>
> I haven't used astronomy packages, but I've played around with interop with
> other languages. I am assuming your goal is that you don't want to replace
> your libraries, rather just make use of them.
>
> In general, there are a few strategies that also apply to python, but I have
> never done direct integration:
>
> -Web Services - IMO, the best option if possible and all you want is to
> send/receive results and super speed is not an issue or calls can be done in
> logical batches or something. It will depend how your application works if
> this is an option. We've done this for example with WPF applications
> consuming Smalltalk code and data in C# as there's no magic bridge between
> C# and Pharo that I am aware of yet.
>
> -C libraries to act as a bridge (FFI/Alien in Pharo)
>
> -Shell Scripting
>
> -Process calls/integration/shell (OSProcess and the like in Pharo, Piping
> and such in Python).
>
> -Persistent Store - send data to a persistent store or location and have
> python or pharo receive push or pull notifications or integration with any
> of the above. Could be the file system, database, or something else.
> --
> View this message in context: http://forum.world.st/Pharo-and-Astronomy-tp3027615p3027979.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Schwab,Wilhelm K
In reply to this post by Alexandre Bergel
Alexandre,

What numerical techniques are important to you?  How large are the typical data sets, grids, etc?  I do a lot of processing on 500,000 sample signals, so Smalltalk is out for most of that number crunching (FFT, DWT, norms, etc.) and visualization.  So far, I could probably get away with Smalltalk curve fitting, but that won't always be the case.  One option would be to tell NR and GSL "thanks but no thanks" and find or start an MIT numerics library.  In my mind, it should be C-callable C++; the trick to that is proper use of extern "C".

Just to make it clear, I have large parts of GSL mapped into Pharo.  My concern now is how to release that w/o being adversely affected by GPL; help with understanding "GPL compatible licenses" would be appreciated.  Like I said, I don't care what anyone else does with the code, but I won't have years of my work rendered useless to me for commercial interests.  Nothing in GSL is worth taking that risk.  There should not be any problem releasing the function definitions; the question is over how much, if any, of the wrappers I can release w/o losing it all to GPL.

Bill


________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
Sent: Friday, November 05, 2010 7:24 AM
To: [hidden email]
Subject: Re: [Pharo-project] Pharo and Astronomy?

Thanks Bill. I am at the stage of convincing Astronomers to use Pharo to do their soft, but this is not easy

Cheers,
Alexandre


Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Alexandre Bergel
> What numerical techniques are important to you?  

I am not sure exactly. As I said, I am trying to convince Astronomers :-)
I will forward your post to them.

Cheers,
Alexandre

> How large are the typical data sets, grids, etc?  I do a lot of processing on 500,000 sample signals, so Smalltalk is out for most of that number crunching (FFT, DWT, norms, etc.) and visualization.  So far, I could probably get away with Smalltalk curve fitting, but that won't always be the case.  One option would be to tell NR and GSL "thanks but no thanks" and find or start an MIT numerics library.  In my mind, it should be C-callable C++; the trick to that is proper use of extern "C".
>
> Just to make it clear, I have large parts of GSL mapped into Pharo.  My concern now is how to release that w/o being adversely affected by GPL; help with understanding "GPL compatible licenses" would be appreciated.  Like I said, I don't care what anyone else does with the code, but I won't have years of my work rendered useless to me for commercial interests.  Nothing in GSL is worth taking that risk.  There should not be any problem releasing the function definitions; the question is over how much, if any, of the wrappers I can release w/o losing it all to GPL.
>
> Bill
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
> Sent: Friday, November 05, 2010 7:24 AM
> To: [hidden email]
> Subject: Re: [Pharo-project] Pharo and Astronomy?
>
> Thanks Bill. I am at the stage of convincing Astronomers to use Pharo to do their soft, but this is not easy
>
> Cheers,
> Alexandre
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Sean P. DeNigris
Administrator
In reply to this post by Alexandre Bergel
To use Ruby's Mechanize gem, I just wrote a small Ruby script that allows messages to be sent to Ruby objects.  It runs an augmented XMLRPC server that caches non-XMLRPC Ruby objects and passes back an identifier to Smalltalk.

Here's a snippet of my post to squeak-dev.  All of the messages return proxies to Ruby objects, except the last, which returns an array of strings.  Check the "Wrapping Ruby libraries - what is the best way?" thread for more info...
...run the following code in Squeak:
agent := Mechanize new.
loginPage := agent get: 'https://www.[a site here].com/home'.
loginForm := loginPage formWith: #action -> '/login'.
loginForm set: 'username' fieldTo: 'username'.
loginForm set: 'password' fieldTo: 'password'.
homePage := loginForm submit.
mailPage := agent get: 'https://www.[a site here].com/messages'.
messageLinks := mailPage linksWith: #href -> 'messages\?readmsg=true&threadid='.
messages := messageLinks collect: [ :link | link click body ].

All of those messages were handled by the generic server code on the Ruby side except for mailPage linksWith:, which passes a Ruby regex, which is not supported by XMLRPC.

Todo:
* still deciding how much info to bring over to Squeak and when e.g. just the id, the inst vars, etc.
* extending XMLRPC to handle Squeak/Ruby common types, like symbols
* toying with the idea of using DNU to dynamically create the methods on the ST side (hand-written for now)
* thinking about whether to look at OMeta or PetitParser

HTH,
Sean

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Schwab,Wilhelm K
In reply to this post by Alexandre Bergel
Alexandre,

A possible source of a Levenberg-Marquardt optimizer:

    http://www.ics.forth.gr/~lourakis/levmar/

It's GPL too, so aside from _possibly_ being cleaner than GSL's implementation (there's room for improvement), it's no help.  It appears that they translated the code from Minpack, and perhaps the ultimate answer is to do that "one last time" under MIT.

Another thing I find interesting is their answer to FAQ 32.  Therein find "However, it is possible to obtain a paid license for proprietary commercial use under terms different than those of GPL."  Am I wrong, or can that be translated as "Pay us and you can use the code as you wish."  So much for true freedom.  I'm still suspicious that it is not helpful to someone wanting to release MIT wrappers of GPL code, because they are dual-licensing their code, not a wrapper.

If nothing else, the FAQ looks interesting on topics such as computing and checking the Jacobian.

Bill



________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
Sent: Thursday, November 04, 2010 3:14 PM
To: Pharo Development
Subject: [Pharo-project] Pharo and Astronomy?

Hi!

I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.







Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

Alexandre Bergel
Thanks all for your help on this.

Cheers,
Alexandre


On 12 Nov 2010, at 09:08, Schwab,Wilhelm K wrote:

> Alexandre,
>
> A possible source of a Levenberg-Marquardt optimizer:
>
>    http://www.ics.forth.gr/~lourakis/levmar/
>
> It's GPL too, so aside from _possibly_ being cleaner than GSL's implementation (there's room for improvement), it's no help.  It appears that they translated the code from Minpack, and perhaps the ultimate answer is to do that "one last time" under MIT.
>
> Another thing I find interesting is their answer to FAQ 32.  Therein find "However, it is possible to obtain a paid license for proprietary commercial use under terms different than those of GPL."  Am I wrong, or can that be translated as "Pay us and you can use the code as you wish."  So much for true freedom.  I'm still suspicious that it is not helpful to someone wanting to release MIT wrappers of GPL code, because they are dual-licensing their code, not a wrapper.
>
> If nothing else, the FAQ looks interesting on topics such as computing and checking the Jacobian.
>
> Bill
>
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] On Behalf Of Alexandre Bergel [[hidden email]]
> Sent: Thursday, November 04, 2010 3:14 PM
> To: Pharo Development
> Subject: [Pharo-project] Pharo and Astronomy?
>
> Hi!
>
> I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Reply | Threaded
Open this post in threaded view
|

Re: Pharo and Astronomy?

espin
In reply to this post by Alexandre Bergel
Hi Alex,
I have some (very immature) code for astronomical algorithms:
http://www.squeaksource.com/AdAstra
The main implamentation is the VSOP87D.
This is tested against the very same data coming from
http://cdsarc.u-strasbg.fr/viz-bin/Cat?cat=VI/81

There are utilities classes to compute polinomials (but not
sparse ones, given that in astronomical algorithms you do not
usually meet them...) and angles...

I was not (yet) interested in interfacing with external libraries, but more
on the algorithms themselves.

Have a look and let me know. BEWARE: code is very IMMATURE.
Bye
Enrico


On Thu, Nov 4, 2010 at 20:14, Alexandre Bergel <[hidden email]> wrote:

> Hi!
>
> I am looking for any experience in using Pharo to develop software for Astronomy. Especially regarding interoperability with Python, using Mathematical libraries (www.nr.com, www.gnu.org/software/gsl, matplotlib.sourceforge.net/gallery.html)
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>



--
Enrico Spinielli
"Do Androids dream of electric sheep?"— Philip K. Dick
"Hear and forget; see and remember;do and understand."—Mitchel Resnick