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

Home » Public Forums » archive » How do I save parameters for next run?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
a simple hack!Re: How do I save parameters for next run? [message #38909 is a reply to message #38836] Mon, 05 April 2004 14:17 Go to previous messageGo to previous message
Yunxiang Zhang is currently offline  Yunxiang Zhang
Messages: 19
Registered: October 2003
Junior Member
Folks,

Thanks for all your input here. I was trying to look into Craig's
library and see if I can come up with a solution. But it turned to be
a little bit complicated for me. Today, I finally did it with a simple
hack by appending the default data to the end of the .sav file. The code
will read itself, the .sav file, to get the default value and after user
input it will update the data appended. The only drawback is you can't run
the program before you generate the .sav file and append the default data
to the end of the .sav file. Here's how the code looks like,

PRO MYPRO
...
values=fltarr(n_para)
openr,lun,'mypro.sav',/append,/get_lun
point_lun,-lun,lunpos
point_lun,lun,lunpos-4*n_para
readu,lun,values
free_lun,lun

;function that returns user input parameters
finput=InputBoxes(title=mytitle,$
prompts=prompts, values=values, labelsize=160)

openu,lun,'mypro.sav',/append,/get_lun
point_lun,-lun,lunpos
point_lun,lun,lunpos-4*n_para
writeu,lun,float(finput)
free_lun,lun
...
END

Cheers,
Yunxiang

On Thu, 1 Apr 2004, Yunxiang Zhang wrote:

>
> Hi,
>
> Sorry for the confusion. I just want my stand alone application to have a
> small "memory" interactively. For example, I have a program, say,
> 'mypro.sav' and needs user to input a series of parameters, say p1, p2
> ...pn through an input gui. Then the program runs perfect. But then if
> the next run the user only need to change a small fraction of the
> parameters, it would be nice that my program can have a small memory so
> that my gui displays the parameters input last time and the user need
> only change maybe one parameter and press 'enter' to continue the
> rest of the calculations.
>
> The idea comes from my colleagues and I still can't think of a way without
> creating some additional log file. Maybe somebody can tell me how to hack
> the .sav file so that i can dock some data into a specific region without
> breaking the .sav file.
>
> Thanks,
>
> Yunxiang
>
> On Thu, 1 Apr 2004, Reimar Bauer wrote:
>
>> Craig Markwardt wrote:
>>
>>>
>>> Reimar Bauer <R.Bauer@fz-juelich.de> writes:
>>>> > Folks,
>>>> >
>>>> > I am wondering if I can save the user input parameters for the next
>>>> > run of my program without creating additional files for it's "memory".
>>>> >
>>>> > Is it possible? Thanks.
>>>> >
>>>> > Yunxiang
>>>> >
>>>>
>>>> Take a look on save and restore
>>>
>>> But he asked about not creating additional files. Not too many
>>> options for that. If running on Unix, it's possible to wrap IDL in a
>>> script, either Perl or Bourne shell or whatever, and then establish a
>>> protocol for the script to capture your crucial outputs. Not elegant
>>> but it could work.
>>>
>>> Craig
>>
>> I read twice things not right. He asked for user input parameters.
>>
>> But I can't answer how to do it without writing to a file.
>>
>> Did you know the idl journal command?
>>
>>> idl
>>
>> IDL> journal, 'my_user_journal.pro' start the journal file and
>> IDL> a=10
>> IDL>
>> IDL> journal ends recording the user inputs.
>> IDL> exit
>>
>>
>> Afterwards this file could be called again by @my_user_journal from the IDL>
>> prompt, And print,a gives 10.
>>
>>
>> Reimar
>>
>>
>>
>
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Callable IDL on Fedora 1
Next Topic: Widget Objects

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

Current Time: Wed Oct 08 19:23:25 PDT 2025

Total time taken to generate the page: 0.00457 seconds