In this post I’m going to give some very basic examples on how to get Python and TOPCAT (or other VO/SAMP applications) to talk to each other. The Python
module you’ll need is called SAMPy. This module will eventually be incorporated into the AstroPy package. To install SAMPy:
pip install sampy
(or if you must, use easy_install sampy)
For our first example we’ll get TOPCAT to notify Python when we highlight a point or row in TOPCAT:
Run the above code by putting it in a file named basic_example.py then from the terminal write: python basic_example.py
Open TOPCAT and load a file. Ensure there are 3 icons in the SAMP Clients tab at the bottom of the TOPCAT GUI.
In the “Current Table Properties”, make sure the “Broadcast Row” icon is ticked.