SAMP in SkyView
Luigi Paioro
luigi at lambrate.inaf.it
Thu Nov 6 05:02:35 PST 2008
Hello!
I have attached a Python script I have just written, that should perform
what you suggested in the mail reported here below.
The only difference is that -mtype has been replaced with --mtype or -m
to and -action with --action or -a. This script receives only
_notification_ messages. Notice that it starts an inner Hub if it cannot
find another Hub already alive.
Here an example of usage:
### Terminal 1 ###
shell >./messageListener -m 'test' -a 'echo $msg'
Listening
on test notifications
to execute echo $msg
Action => echo Hello world!
Hello world!
### Terminal 2 ###
shell >java -jar jsamp-0.2.jar messagesender -mtype 'test' -param msg
"Hello world!" -mode notify
This script requires SAMPy [*] and Python >= 2.5.
I hope this is what you were looking for and that it will be useful.
Regards,
Luigi
[*] http://cosmos.iasf-milano.inaf.it/luigi/projects/vo/samp/latest/
Tom McGlynn ha scritto:
> The demonstrations of SAMP in scripting environments at the IVOA were
> pretty impressive. I was motivated to put in a SAMP capability into the
> standalone version of SkyView. It was pretty easy to add in using
> Mark's JSAMP package. All that it does is generate
> image.load.fits messages whenever SkyView generates an image. E.g.,
> if there's a SAMP hub and the SAMPified version of Aladin running
> one can just enter
>
> skyview survey=2massh,2massk,2massj position=abell1656 samp=true
>
> and the three 2MASS images will pop into Aladin. SkyView is primarily an
> image generation tool, so that seems like the natural way to use SAMP
> internally.
>
> I'd also thought about adding a listener capability into SkyView, so
> that, e.g., one would click on an image in some other application and
> have SkyView generate images. On reflection I've decided that's
> probably not the right way to go. It seems to me that it would be
> better to have build a more generic listener that invokes a command as
> needed. E.g.,
>
> messageListener -mtype coord.pointAt.sky \
> -action 'skyview position=$ra,$dec survey=dss size=0.05 pixels=100'
>
> where the idea is that the the $ra and $dec are parameters of the mtype.
> Every time the listener gets a message it spawns off a new process.
> Seems like this is just a more sophisticated version of Mark's snooper
> and a natural complement to messageSender. With messageSender and
> messageListener, I could SAMPify lot's of tools using simple scripts.
>
> Has anyone already implemented such a thing? Does that seem like the
> right approach?
>
> Regards,
> Tom McGlynn
--
Luigi Paioro
INAF - IASF Milano
Via Bassini 15, I-20133 Milano, Italy
Phone (+39) 02 23 699 470
Fax (+39) 02 26 660 17
Site http://www.iasf-milano.inaf.it/luigi/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: messageListener
URL: <http://ivoa.cacr.caltech.edu/pipermail/apps-samp/attachments/20081106/2f3aafc7/attachment-0001.ksh>
More information about the apps-samp
mailing list