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

Home » Public Forums » archive » Problem with ASSOC,/PACKED
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
Problem with ASSOC,/PACKED [message #19250] Tue, 29 February 2000 00:00
bjackel is currently offline  bjackel
Messages: 10
Registered: September 1993
Junior Member
Greetings

I've run across a bug(?) using ASSOC,/PACKED
This appears under v5.3 for Win9x, and v5.2 on
SGIs.

If anyone has spare time, could you look
at the following demonstration script to see if
I'm doing anything obviously wrong. Tests
on other architectures or versions would also
be welcome.




;2000/02/29 Brian Jackel University of Calgary
bjackel@phys.ucalgary.ca
;
;This IDL script demonstrates a problem with ASSOCiated I/O,
;probably due to a largeish (4516 byte) structure.


PRINT,!version


PRINT,'Start with a small test structure '
test= {TEST_STRUCTURE, utime:0.0, data:FLTARR(75) }
HELP,/STR,test
PRINT,' '

PRINT,'Write it to a file'
data= REPLICATE({TEST_STRUCTURE},10)
data.utime= FINDGEN(10)
OPENW,1,'test.dat'
WRITEU,1,data
CLOSE,1
PRINT,' '

PRINT,'Check out the times, should be 0,1,2...'
dat= {TEST_STRUCTURE}
OPENR,1,'test.dat'
READU,1,dat & PRINT,dat.utime
READU,1,dat & PRINT,dat.utime
READU,1,dat & PRINT,dat.utime
CLOSE,1
PRINT,' '


PRINT,'Try using ASSOC,/PACKED (should give same result, does)
OPENR,1,'test.dat'
dat= ASSOC(1,{TEST_STRUCTURE},/PACKED)
PRINT,(dat[0]).utime
PRINT,(dat[1]).utime
PRINT,(dat[2]).utime
CLOSE,1
PRINT,' '



PRINT,'Make a bigger structure '
windii_data= {WINDII_DATA, emission_rate:0.0,
sigma_emission_rate:0.0, $
wind_speed:0.0, sigma_wind_speed:0.0,
$
temperature:0.0, sigma_temperature:0.0}

windii_l2fd_redgreen= {WINDII_L2FD_REDGREEN, $
juldate:0.0, utime:0.0, dtime:FLTARR(2), $
altitude:FLTARR(75), latitude:FLTARR(75), $
longitude:FLTARR(75), $
red:REPLICATE({WINDII_DATA},75), $
green:REPLICATE({WINDII_DATA},75) }

HELP,/STR,{WINDII_L2FD_REDGREEN}
PRINT,' '

PRINT,'Write it to a file'
data= REPLICATE({WINDII_L2FD_REDGREEN},10)
data.utime= FINDGEN(10)
OPENW,1,'test.dat'
WRITEU,1,data
CLOSE,1
PRINT,' '


PRINT,'Read using standard I/O, times should be 0,1,2,3...'
OPENR,1,'test.dat'
dat= {WINDII_L2FD_REDGREEN}
READU,1,dat & PRINT,dat.utime
READU,1,dat & PRINT,dat.utime
READU,1,dat & PRINT,dat.utime
CLOSE,1
PRINT,' '


PRINT,'Use ASSOC,/PACKED (should be same, isn''t)'
OPENR,1,'test.dat'
dat= ASSOC(1,{WINDII_L2FD_REDGREEN},/PACKED)
PRINT,(dat[0]).utime
PRINT,(dat[1]).utime
PRINT,(dat[2]).utime
CLOSE,1
PRINT,' '


END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: xmanager does not block
Next Topic: IDL and 3D Image

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

Current Time: Fri Oct 10 01:50:13 PDT 2025

Total time taken to generate the page: 0.71725 seconds