comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Substituting multiple strings into a program
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Substituting multiple strings into a program [message #81077] Thu, 09 August 2012 12:37 Go to previous message
MightyMrFish is currently offline  MightyMrFish
Messages: 3
Registered: August 2012
Junior Member
You'll have to forgive the lateness of my reply. I have access to the IDL programming software at certain times of the day.
I tried using that code, but issues arose. I couldn't get the graphs to be correct.
I think posting the code I'm using right now will help me explain what I want to do. It uses the READCOL.pro which can be found here: http://idlastro.gsfc.nasa.gov/ftp/pro/misc/readcol.pro


CD, '[FOLDER]'; Replace [FOLDER] with the folder containing the data tables.

name =''
read, 'What is the filename to plot? (Write exactly as it appears.) ',name
; Defining "name" for the READCOL command. The user inputs the name of the
; data table file (so let's say Rex.dat just to be consistant).


READCOL, name, W1, W1Sigma, W2, W2Sigma, W3, W3Sigma, W4, W4Sigma, MJD, FORMAT = 'X,X,X,X,X,X,X,X, D, D, D, D, D, D, D, D, D'
; The W1, W1Sigma, etc. refer to columns of data. The data I'm really using is
; from the WISE obervatory. The W's correspond to wavelengths.

!P.MULTI = [0,0,4,0,1] ; This makes it so there are 4 graphs on a "page".

PLOTERROR, MJD, W1, W1Sigma, psym=1, $
TITLE = 'W1', XTITLE = 'MJD', YTITLE = 'Mag.'
WAIT, .5
PLOTERROR, MJD, W2, W2Sigma, psym=1, $
TITLE = 'W2', XTITLE = 'MJD', YTITLE = 'Mag.'
WAIT, .5
PLOTERROR, MJD, W3, W3Sigma, psym=1, $
TITLE = 'W3', XTITLE = 'MJD', YTITLE = 'Mag.'
WAIT, .5
PLOTERROR, MJD, W4, W4Sigma, psym=1, $
TITLE = 'W4', XTITLE = 'MJD', YTITLE = 'Mag.'
WAIT, .5
; The WAIT isn't needed. The PLOTERROR command gives a plot
; with error bars.

set_plot, "ps"
set_plot, "x"

CD, '..'
CD, '[OUTPUT FOLDER]'
; Replace [OUTPUT FOLDER] with the name of the folder you want
; the graphs to come out of.

filename='~user/name'; Replace 'user' accordingly.
write_png, name, tvrd()

CD, '..'

END



This .pro reads the data table file and spits out graphs according to what I need to be graphed. What I'd like is some way for me to not have to enter the names of each file.
I have a list of the data files. I want to be able to have my .pro read one name off the list, assign it to "name", go through the command I've written to spit out a graph, then repeat with the next name on the list.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: append files
Next Topic: A single title, xtitle and ytitle

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 12:03:41 PDT 2025

Total time taken to generate the page: 1.11972 seconds