IDL tips for the Weeks Lab

A collection of various emails from Gianguido and others.

Lab Home -- People -- Experimental facilities -- Publications -- Experimental pictures -- Links

NOTE: Some of these programs are only available within the Weeks Lab, they are not part of our general IDL distribution. If you have a crucial need for one of these programs, contact Gianguido or Eric.

gmovie4

From gianguido.cianci / gmail.com Wed Dec 19 16:59:00 2007

I have (very slightly) modified a program I found online and called it gmovie4. It has two main advantages over other 'movie.pro procedures:

1) if you click with a mouse on the scroll bar, you can then choose what frame to look at, or use the left/right arrows on the keyboard to go one frame at a time in each direction. It's like a super version of flick.pro

2) click on Window->Toolbars->Delay Bar and 3 boxes pop up on the bottom where you can set the time between frames and the time the first and last frames are shown when looping.

Note that there are other features too, like left clicking zooms in while the movie is playing and the middle button allows you to drag the movie around while it is playing too... If you explore the menus, you'll see that it also allows to export a movie to various formats thogh we do not currently have the mpeg license. Also note that it starts up by playing the movie once really fast as it loads it.


fover3dto2d

From gianguido.cianci / gmail.com Wed Dec 19 16:59:00 2007

On a separate note: fover3dto2d is similar to its ancestors and should be familiar to you. But, it takes a single 3D stack and treats the x, y or z(default) axis as if it were time. What that does is rather than draw 3d white blobs over your colloids, it will draw a disc (or circle if you use /circ) only when the center of the colloid in on screen. I like it better this way. Give it a try if you want.


gplotp & gplott

From gianguido.cianci / gmail.com Mon Jan 7 16:28:49 2008

gplotp, tr

is identical to plotp, only each particle ID is plotted with a different color. Also,

gplott, tr

or

gplott, pt, /pretrack

is identical to plotp but plots positions with colors from red to blue which represent time. Note that you need /pretrack for pretrack arrays!

Let me know if you have any problems or suggestions.

ps: unfortunately, if you surround these with the (g)aprint/bprint/cprint commands, it does not seem to work :-(

ps2: like the original plotp, these procedures accept all the options you could pass to an ordinary (inbuilt) plot command, like /iso or /nodata or title='my title' .


n_params

From kdesmond / moses.physics.emory.edu Mon Feb 11 15:03:05 2008

Here is an example of n_params.

FUNCTION rodfeatures, image,  thres, vol_range, squeezefac =
squeezefac, micperpix = micperpix, outputfile = outputfile

IF n_params() EQ 0 THEN BEGIN

   print, 'rodfeatures, image,  thres, vol_range, squeezefac =
squeezefac, micperpix = micperpix, outputfile = outputfile'

   return, -1

ENDIF


fsc_color

From gianguido.cianci / gmail.com Fri Dec 14 15:45:39 2007

This works nicely on my mac, haven't tried it yet on linux (can somebody try and let me know?). I can get both color plots on the screen and in postscript files!!

Basically you need to use color=fsc_color('colorname')

(And you might need to use /color with aprint.pro for color postscript images)

;;To see what colors are available:

print, fsc_color(/names), format='(6A18)'


;;A simple example:

i=indgen(100)/10.
gaprint ;for PS output, optional

plot, i, cos(i), /nodata
oplot, i, cos(i), color=fsc_color('red'), thick=3
oplot, i, sin(i), color=fsc_color('green'), thick=3

cprint ;only if you did gaprint


;;Somewhat fancier...

gaprint

n=50.
z=dist(n)
surface, cos(z/n*5), color=fsc_color('red'), /lower_only, /noerase, /save
surface, cos(z/n*5), color=fsc_color('blue'), /upper_only, /noerase
surface, cos(z/n*5), /nodata, /noerase, xthick=2, ythick=2, zthick=2, charth=2
contour, z, /noerase, /t3d, zvalue=1, color=fsc_color('green'), nlevels=10

cprint


ver & hor

From kedmond / physics.emory.edu Fri Jun 6 15:18:39 2008

I thought that I should let you all know about two simple programs that I've been using for the past couple of years. They're called "ver.pro" and "hor.pro". They are programs for IDL that simply draw vertical or horizontal lines onto an existing plot. They're located in spicysquid:/home/kedmond/idl/

To use them, just type "ver, 10" and a vertical line will appear at 10, on the x-axis. "hor.pro" works in the same way. You can also do things like this:

var, 10, color=fsc_color('green'), thick=3, line=3

That will draw a dashed line that is green at x=10 with a thickness of 3. Anyways, I thought they're super simple programs, but can be helpful when plotting results. Have fun!


addheader

From kdesmond / moses.physics.emory.edu Thu Jun 12 18:39:58 2008

To add a header to your code simply type the following in IDL.

If the first line of your program is the call sequence to run your program, then type

IDL> addheader, 'program name'

If the first line of your program is not the call sequence to run your program, then type

IDL> addheader, 'program name', line = line number
note line number is the line in your program where the call sequence is written.