Table row to SED?

Mark Taylor m.b.taylor at bristol.ac.uk
Mon Sep 15 18:47:57 CEST 2014


On Mon, 15 Sep 2014, Ivan Zolotukhin wrote:

> Hi,
> 
> >> Couple of workarounds exactly for this case which I use myself:
> >>
> >>  - any decent diagram plotting service on the web like Google Charts
> >> (can show my example custom TOPCAT activation action command)
> >
> > yes please, can you give a bit more detail?
> 
> Details are usually ugly and bulky. Here's the example of custom
> activation action in TOPCAT that does line plot through Google Charts
> API of 4 profiles stored in array columns in current row:
> 
> displayBasicImage("Line profiles",
> "https://chart.googleapis.com/chart?cht=lc&chdl=Forbidden|Allowed|Forbidden_sm|Allowed_sm&chco=676767,0000FF,000000,00A5C6&chtt=Line+profiles|"
> + NAME + "&chd=t:" + toString(LINE_LOSVD_FORBIDDEN[0]) + "," +
> toString(LINE_LOSVD_FORBIDDEN[1]) + "," +
> toString(LINE_LOSVD_FORBIDDEN[2]) + "," +
...

OK I get the idea, it's verbose.

> I'm sure you can make simpler example for few SED columns, just look
> at the Google Charts API docs. I must also admit that Google Charts
> only works for basic stuff, so recently I switched to deploying myself
> custom plotters on the web to visualize complex plots upon each click
> in TOPCAT, and even these quite serious efforts worth it because all
> collaborators do appreciate the resulting research tool.
> 
> >>  - own tiny SAMP client in a language like Python with simple graphics
> >> libraries (I use unreleased Octopus for this if you remember)
> >
> > I also thought of a tiny SAMP client to receive table.load.votable
> > and subsequent table.highlight.row messages and translate them to
> > spectrum.load.ssa-generic messages to pass on to SPLAT/Iris/whatever.
> > Good solution for experts, not really feasible for general astronomer
> > usage.
> 
> Don't look at the problem as if it is only related to SED. There is
> multitude of various (row) plotting that researchers want in their

pros and cons - in the use case I was thinking of, the user might
want to go on and actually do spectral things with the result,
for instance view alongside model SEDs.  But I take the point that
a more general capability has its uses.

> domains while going through a table in TOPCAT. There's hence better
> and more consistent alternative I've been asking you since couple of
> years: extend support for custom activation actions. Allow user
> scripts there (and include one basic example to the docs) and give
> users basic debug tools (for now it's just almost impossible to
> debug).

This is already possible.  The (various forms of the) "exec"
activation function (filed under "System" in Activation Functions)
let you run a script from topcat with command-line arguments
supplied from column values.  I admit the documentation is
terse, but the Example listed says:

   exec("do_stuff.py " + RA + " " + DEC)

which should give the idea.  You just need a python script called
"do_stuff.py" (or a shell script or whatever) on your path which
takes RA and DEC command-line arguments, and every time you click
on a row/point, it will get run with the RA and DEC column values
supplied to it on the command line.

If you're a java enthusiast you can also write java custom activation
functions, but I don't expect that will apply to most astronomers.

Debugging: print statements are your friend.

Does this cover your requirements?

--
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-9288776  http://www.star.bris.ac.uk/~mbt/


More information about the apps mailing list