Labels

APPLE (1) IDL (4) LSD (2) Mac (2) astro (1) life (2) linux (5) teaching (1) volleyball (2) work (1)

Wednesday, July 22, 2009

[VI] find and replace

Find the 'txt': /txt (forward searching)
?txt (backward searching)
/\ (searching for the whole word 'txt')

Get rid of the highlighting after search:
:set nohlsearch
Enable highlighting searching:
:set hlsearch

Find the replace:
:s/word/replacement/ ( once )
:s/word/replacement/g ( all at once on a single line )
:.,.+Ns/word/replacement/g ( all at once on the current line and
the next N lines )
:%s/word/replacement/g ( all at once the whole text )
:s/word/replacement/cg ( you need confirm whether or not to
replace )
:s/word/replacement/gi ( case insensitive )
:set ic ( case insensitive )
:set noic ( case sensitive )
:%//g ( remove all tab characters )

ref: http://www.linux.ie/articles/tutorials/vi2.php

Thursday, March 19, 2009

[IDL] How to save IDL plots

1. How to save an IDL plot as a jpeg file

After you made your plot in IDL you can type the following:
IDL> im=tvrd() ; im is the matrix for the image
IDL>write_jpeg,'filename.jpeg',im ; a file named filename.jpeg is stored in the current IDL working directory

2. How to make a PostScript plot


IDL> set_plot,'ps'
IDL> device,filename='name.ps'
IDL> {set of instructions to make desired plot}
IDL> device, /close
IDL> set_plot,'x'