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

Home » Public Forums » archive » Reading binary files made by Python
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: reading binary files [message #54495 is a reply to message #49280] Tue, 19 June 2007 08:28 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Vince Oliver wrote:
> paul, when I do
>
> spectra = ASSOC(lun,{RecBegin:0L, Data:FLTARR(2,n), RecEnd:0L})
> spectrum = spectra[0]
> print, spectrum
>
> I endeed have:
>
> SPECTRUM STRUCT = -> <Anonymous> Array[1]
> { 58584 91.0000 2.04773e-023
> 94.0000 5.73142e-023
> 96.0000 1.12218e-022
> 98.0000 2.17056e-022
> 100.000 4.00652e-022
> ...}
>
>
> How to get these elements?

The structure components? Use the "." operator to resolve them. Try,

IDL> help, spectrum.data

For example:

IDL> spectrum={rb:-999L, data:findgen(5)+10.0, re:-999L}
IDL> print, spectrum
{ -999 10.0000 11.0000 12.0000 13.0000 14.0000
-999}
IDL> help, spectrum
SPECTRUM STRUCT = -> <Anonymous> Array[1]
IDL> help, spectrum.data
<Expression> FLOAT = Array[5]
IDL> print, spectrum.data
10.0000 11.0000 12.0000 13.0000 14.0000
IDL> print, spectrum.rb, spectrum.re
-999 -999

Check your IDL help for much more info on IDL structures.

cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: extracting specific substrings from a text-file
Next Topic: Re: Error: X does not support locale C.

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

Current Time: Tue Dec 02 04:17:00 PST 2025

Total time taken to generate the page: 4.00106 seconds