Graphic representation of data (list x,y)
viktor wrote on Jul 20, 2008
I work in surface-chemistry and use IRAF for the photometric measurements. I have written a small script, that extracts the intensity from the electron difflaction pictures (bright spot, like a star!) with help of xgphot and txdump (FLUX value). I would like to represent the intensity value against picture number in real-time graphically. How can it be done? With graph or sgraph?
Many Thanks!!
Many Thanks!!
Mike Fitzpatrick wrote on Jul 20, 2008
Either GRAPH or SGRAPH will work, they just have different features and parameters so you should check the help pages for details.
If I understand your question: You want to build up the graph as the script executes? This can still be done, just be sure to set the 'append' parameter as you plot each new point for each image. You may also want to set the initial bounds of the plot to cover the expected range of values.
Cheers,
-Mike
If I understand your question: You want to build up the graph as the script executes? This can still be done, just be sure to set the 'append' parameter as you plot each new point for each image. You may also want to set the initial bounds of the plot to cover the expected range of values.
Cheers,
-Mike
viktor wrote on Jul 20, 2008
Yes! I would like to plot the points while the skript still works (there is an while-loop). Waht does "append" mean? Can I simply pipe "|" each point to graph? Danke!
Mike Fitzpatrick wrote on Jul 20, 2008
Actually, yes you can pipe in values. Here's an example script that shows how to do it:
-Mike
procedure foo ()
begin
util # load util package
set clobber = yes
urand (200, 1, scale=1000.0, > "/tmp/points"); # generate data
# initialize graph
print ("0. 0.") | graph ("STDIN", wx1=0.0, wx2=200.0, wy1=0.0, wy2=1000.0)
# Read the list and plot the points one at a time, appending the plot.
list = "/tmp/points"
x = 0.0;
while (fscan (list, y) != EOF) {
printf ("%f %f\n", x, y) | graph ("STDIN", append+, point+, box-)
x = x + 1.0;
}
gflush () # flush graphics buffer
end
-Mike
viktor wrote on Jul 20, 2008
Thank You very match! I will try your suggestion tomorrow. I am sure that it will work.
Thanks!!
Thanks!!
Last post on Jul 20, 2008