[time-nuts] web presentation of data

John Ackermann N8UR jra at febo.com
Mon Aug 6 12:57:00 EDT 2012

I think there are now a couple of threads going on about this topic, 
which I started by a clumsy attempt to use the "WIDTH" and "HEIGHT" 
attributes in HTML. :-)

For what it's worth, I usually scale web graphics to no larger than 750 
pixels horizontal or 550 pixels vertical.  That goes back to the days of 
lower resolution monitors, but still works well with the page layout I 
use at febo.com.

The challenge in this case was that using the default settings in John's 
TimeLab program, I'm getting plots that are about 1350 pixels wide and 
(as PNGs) are ~130kB in size.  When down-sampled, it can become 
difficult to read the fine data.  The best way to handle that, I think, 
is to create a scaled version of the image and use that as a link to the 
full-size version.  Something like:

<A HREF="image.big"><IMG SRC="image.small"></A>

But that's extra work that I haven't gotten around to automating yet, so 
I thought I'd try using the HTML size options:

<IMG SRC="image.big" WIDTH=50% HEIGHT=50%>

The viewer can then right-click on the image and via the "view image" or 
similar menu open up the full-sized version for the fine detail.  That 
worked on my browser and monitor, but apparently not on some other 
combinations.  So, it's back to the drawing board.

Moving to the second thread on plot generation generally, apart from 
TimeLab I do most of my data capture and analysis in Linux.  I typically 
break the two into separate pieces:

1.  A single-purpose program (usually written in Perl because I make 
slightly fewer errors with it than other languages) that talks via GPIB 
or serial port and outputs a data file with typically MJD and phase or 
frequency information.

2.  A graphing tool that reads the data file.  For this, I'm quite fond 
of a program called "Grace" (http://plasma-gate.weizmann.ac.il/Grace/) 
that provides a WYSIWIG graphics interface and saves plot information in 
an ASCII format that's pretty easy to muck around with.  Grace is 
packaged with Debian-based Linux distributions; I don't know if there's 
a Windows version available.

I've also done some automatic plot generation to go from data file to 
regularly updated web page.  This involves some fairly ugly text 
processing taking advantage of Grace's batch mode, but the result is a 
tool that will read the data file, do whatever statistics are desired, 
combine with the Grace command file, run Grace in batch mode, and create 
an output PNG file that's uploaded to the web.  It's actually fairly 
easy to do once you figure out the appropriate black magic...


On 8/6/2012 11:34 AM, Jim Lux wrote:
> what would be useful is to have some sort of "plotting engine" that is a
> canned webpage (or stored locally on the user/client computer) that can
> ingest fairly raw data from a URL..
> something, conceptually, like this:
> <BODY>
> *invocation of plotting engine*
> data value 1
> data value 2
> data value 3
> </BODY>
> that way, a relatively dumb controller (think arduino-ish) could talk to
> the instrument and build a web page on the fly without having to do much
> formatting.  The java/javascript/whathaveyou would do all the plotting
> work on the client side (where, presumably, they have a display and some
> computational horsepower to drive it)
> A low end microcontroller has no problem serving readonly pages from
> flash/SD, it just has a tough time doing graphics.
> And, if you wanted the raw data, you serve up a page called "raw.html"
> or something that just has the raw data.
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.

More information about the time-nuts mailing list