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

Home » Public Forums » archive » Re: SAVE/RESTORE problems
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: SAVE/RESTORE problems [message #11231] Thu, 19 March 1998 00:00
rosentha is currently offline  rosentha
Messages: 23
Registered: November 1994
Junior Member
On Thu, 19 Mar 1998 13:07:14 +0000,
R Balthazor <r.balthazor@sheffield.ac.uk> wrote:
> Hello,
>
> I have a pair of routines that worked fine in IDL4.0. The first
> essentially read in some large arrays from a number of datasets, and
> then performed a SAVE,/VARIABLES. The second then performed a RESTORE
> and proceeded to perform various graphical plottings on them. The
> reason it was split into two was that the first routine, reading in the
> variables, took around 15 minutes to read everything in (the many source
> datafiles are HUGE) and I wanted to experiment in the second routine
> with different ways of plotting the output. The size of the idlsave.dat
> file is around 23 Mbytes.
>
> First I .compiled the routines under IDL5.0.2 and ran them. The first
> routine ran fine, loading up the data from the huge datafiles. The
> second crashed out in the following manner.
>
> IDL> TUBEREAD4
> Starting restore...
> % Stopped on unknown instruction(0) at 538298664.
> % Execution halted at: TUBEREAD4 1 tuberead4.pro
>
> The diagnostic "Starting restore..." is a PRINT command immediately
> before the RESTORE, and it doesn't reach the "Ending restore..."
> immediately afterwards so I guess the problem is in RESTORE, even if it
> claims it crashes out at line 1 (which is not the case).
>
> Second try, I simply appended the second routine to the first, removed
> the SAVE,/VARIABLES and the RESTORE (and the spurious END and PRO
> lines), and compiled the whole thing. This ran perfectly, but is less
> than useful because of the time taken to read in before I get any useful
> image/data processing and output done.
>
> I'd be very grateful if anyone can offer any suggestions for how to get
> around this problem.

I've had the same problem. Apparently this is a known bug in IDL v5.x .
The workaround is to ensure that all variables are declared before
the RESTORE command is called. The variables need not be declared with
the correct type or dimensions, just so long as they are assigned some
value e.g. a=0 & b=0 & c=0 etc.

I haven't actually tried this workaround myself, but I have found that
executing the same procedure a second time immediately after the failed
RESTORE will work - presumably because all the variable names have now
been declared. For your huge RESTORE files the other workaround is
probably better.








--
Colin Rosenthal
High Altitude Observatory
Boulder, Colorado
rosentha@hao.ucar.edu
Re: SAVE/RESTORE problems [message #11235 is a reply to message #11231] Thu, 19 March 1998 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
R Balthazor wrote:
> I have a pair of routines that worked fine in IDL4.0. The first
> essentially read in some large arrays from a number of datasets, and
> then performed a SAVE,/VARIABLES.
[description of problems deleted]

Richard,

I've always used the following syntax to SAVE variables:

SAVE, VAR1, VAR2, ..., VARN, /XDR, FILE = 'idl.sav'

and I've never had any problems under IDL 4.0 or 5.0. If you gather your
variables into a structure, then all you have to do is SAVE the
structure itself, e.g.

STRUCT = { Date:VAR1, Time:VAR2, Latitude:VAR3, Longitude:VAR4 }
SAVE, STRUCT, /XDR, FILE = 'idl.sav'

The XDR keyword doesn't seem to add much overhead, and it's tremendously
useful to be able to port the save files between platforms (between SGI
and Linux for example).

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Window Contents Directly to Printer
Next Topic: Font size and printing with TrueType fonts

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

Current Time: Fri Oct 10 22:14:10 PDT 2025

Total time taken to generate the page: 1.27918 seconds