[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: linking programs/ procedures
- Subject: Re: linking programs/ procedures
- From: "Richard G. French" <rfrench(at)wellesley.edu>
- Date: Fri, 28 Apr 2000 01:58:58 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Wellesley College
- References: <Pine.GSO.4.10.10004260211010.5077-100000@lectura.CS.Arizona.EDU> <39070E9A.DB204B5D@princeton.edu> <MPG.1370c340aa70452989af3@news.frii.com> <390724DD.418FEBA1@astro.cornell.edu> <MPG.1370d6bc2398530f989af6@news.frii.com>
- Reply-To: rfrench(at)mediaone.net
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:19432
I've found another use for the much-maligned '@' symbol.
I often have a program that has the form:
; define a bunch of specific varibles, such as
datafile='saturn.dat'
images_to_plot=[2,4,6,7]
; ***************** END OF USER INPUT **************
;
; now do operations that make use of USER input
; blah
; blah
; blah
I like to separate the specific user input from the generic commands,
but
keep them as a MAIN routine so that I have access to all of the
variables
when I am done.
For example, When I generate figures for a publication, I like to have a
separate procedure
file for each figure - one that takes NO interactive input and simply
makes the
damn plot the right way - guaranteed. SO, I might do something like
this:
; figure1.pro
datafile='saturn.dat'
images_to_plot=[2,4,6,7]
; ***************** END OF USER INPUT **************
@main_program_commands_that_produce_a_plot.pro
end
; figure2.pro
datafile='mars.dat'
images_to_plot=[0,3,4]
; ***************** END OF USER INPUT **************
@main_program_commands_that_produce_a_plot.pro
end
This makes the 'driver' files very short, and it guarantees that
the generic plotting routine is the same for all of the plots.
One of the reason I have not gotten into object graphics and the other
fancy interactive stuff is that, when all is said and done, and I have
a plot I like, I want to be able to generate it again without having to
do any user interaction - I want a file of commands that reproduce the
plot exactly, and which are easily changed if I want to use a different
data file, for example.
I'd be curious to know if others out there are similarly stubborn about
wanting to have command files that are guaranteed to make a SPECIFIC
figure for a publication. It is most of what I end up using IDL for.
Dick French