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

Home » Public Forums » archive » Re: How to make an input parameters file??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: How to make an input parameters file?? [message #80135] Mon, 30 April 2012 05:56
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
Try this routine (take all three files):

http://hrscview.fu-berlin.de/mex4/software/idl/gm_read_texts tructure/

It reads named parameters from a text file - single values, arrays and structures - into a single structure

e.g. a=gm_read_textstructure("sample_structured_textfile.txt")

The parameter names will occur as tag names in the resulting structure, e.g.

IDL> print,a.scalar
10
IDL> print,a.xy_pair
600 800
IDL> print,a.plain_table
0.897916 0.558249 0.766930
0.589101 0.0603181 0.973112
0.0378892 0.218058 0.142394

Greg
Re: How to make an input parameters file?? [message #80138 is a reply to message #80135] Mon, 30 April 2012 01:15 Go to previous message
Vincent Sarago is currently offline  Vincent Sarago
Messages: 34
Registered: September 2011
Member
On Saturday, April 28, 2012 9:52:46 AM UTC+2, DooZer wrote:
> Hi!
>
> I'm writing a program for reading and processing LIDAR data output.
> The program is divided in some subroutine and each sub use some of the
> parameter i use to specify in the main routine. My pourpose is to
> remove all the paramenters from the main routine and store them in an
> ancillary .txt file, in order for the users of the program to modify
> only the txt file to run their own different experiment setup (the
> program itselk makes only calculus and should not be modified). I have
> thought to write another subroutine, called, for example,
> 'parameters.pro', where i'll store all the parameters and then i call
> it at the beginning of the main routine, but the number of out
> parameter in the calling sequence is big and the risk is to have a
> messy code.
> An suggestion???
> Thank you!

Hello,
As you said the risk is to have a messy code,
anyway you can have a look to the CALL_PROCEDURE or CALL_FUNCTION routines.
as it, you can just write a wrapping procedure that test the input txt file and 'calls' your program with the inputs keyword and parameters chosen by the user.

Again, the main problem will be to get an txt file as clear as possible.

Vincent
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Writing a 4D array to a HDF file
Next Topic: Re: simplest contour & .png

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

Current Time: Wed Oct 08 15:53:06 PDT 2025

Total time taken to generate the page: 0.00512 seconds