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

Home » Public Forums » archive » Library/Functions to write configuration file for application
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
Library/Functions to write configuration file for application [message #74745] Mon, 31 January 2011 11:05 Go to next message
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
Hi,

I've written a fairly complex piece of modelling software in IDL, and
the model requires a number of parameters to run (input and output files
as well as various numerical parameters).

I want to be able to run this model from a batch file, and would like to
have a configuration file in which I specify all of these parameters and
then all I have to do is give the model the name of the configuration file.

What I was wondering is whether there are any libraries/sets of
functions in IDL that would help with reading and writing these
configuration files? I know that a number of programming languages
either have inbuilt functions for writing configuration files or some
add-ons which do that - do any of these exist for IDL?

I could knock up some simple file reading/writing code, but that would
make it rather difficult if I changed the order/number of variables in
the file, as I'd probably have to read some lines as strings and some as
floats, ints etc, and I could see it getting very complicated and
difficult to maintain.

Any ideas?

Cheers,

Robin

------------------
Robin Wilson
A PhD student studying complexity in remote sensing
www.rtwilson.com/academic
Re: Library/Functions to write configuration file for application [message #74781 is a reply to message #74745] Wed, 02 February 2011 06:55 Go to previous messageGo to next message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
> Just one minor problem: my university hasn't yet got IDL 8, so I don't
> have access to hashes (I believe they were introduced in version 8).
> I'll have a look at the code tomorrow and see if I can convert it to use
> anonymous structures.

Here's another possibility - gm_read_textstructure - it reads this
kind of file into a structure. As well as scalar values, it can handle
appropriately formatted vectors, tables and structure arrays.

gm_read_textstructure from here: http://hrscview.fu-berlin.de/idl.html

There's a sample text file in the directory to show the different data
structure formats.

Greg
Re: Library/Functions to write configuration file for application [message #74822 is a reply to message #74745] Thu, 03 February 2011 05:43 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Am 31.01.2011 20:05, schrieb Robin Wilson:
> Hi,

In the ICG library there are some routines which may be interesting

for reading:
*
http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dbase/read_ini_dbase.pro.html


*
http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dbase/read_ini_file_dbase.pro.html


and writing:
*
http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dbase/write_ini_dbase.pro.html


cheers
Reimar

>
> I've written a fairly complex piece of modelling software in IDL, and
> the model requires a number of parameters to run (input and output files
> as well as various numerical parameters).
>
> I want to be able to run this model from a batch file, and would like to
> have a configuration file in which I specify all of these parameters and
> then all I have to do is give the model the name of the configuration file.
>
> What I was wondering is whether there are any libraries/sets of
> functions in IDL that would help with reading and writing these
> configuration files? I know that a number of programming languages
> either have inbuilt functions for writing configuration files or some
> add-ons which do that - do any of these exist for IDL?
>
> I could knock up some simple file reading/writing code, but that would
> make it rather difficult if I changed the order/number of variables in
> the file, as I'd probably have to read some lines as strings and some as
> floats, ints etc, and I could see it getting very complicated and
> difficult to maintain.
>
> Any ideas?
>
> Cheers,
>
> Robin
>
> ------------------
> Robin Wilson
> A PhD student studying complexity in remote sensing
> www.rtwilson.com/academic
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Coyote Graphics Update, Wed 2 Feb
Next Topic: Re: Writing an efficient array operation in IDL

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

Current Time: Wed Oct 08 15:23:23 PDT 2025

Total time taken to generate the page: 0.00471 seconds