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 #54501 is a reply to message #49280] Tue, 19 June 2007 07:16 Go to previous messageGo to previous message
Vince Oliver is currently offline  Vince Oliver
Messages: 8
Registered: June 2007
Junior Member
we are maybe on the good way. I wrote this


OpenR, lun, data, /Get_Lun, /F77_UNFORMATTED

specnr=2
nlen=7323
n=2*nlen
specoff=(n+1)*specnr*4l ; this is letter L not number 1
spectra = Assoc(lun, Fltarr(n),specoff)

aSpectra = spectra[0]

for i = 0l, 10, 2 do begin
print, aSpectra[i], aSpectra[i+1]
endfor

the output is:


1.00407e-021 8.20937e-041
8.20937e-041 91.0000
2.39148e-009 94.0000
3.81471e-009 96.0000
5.10172e-009 98.0000
2.44573e-008 100.000

Should be like

91. 2.39147746E-09
94. 3.81470944E-09
96. 5.10172171E-09
....

> From where these 3 numbers are on the begining? I can put

for i = 3l, 10, 2 do begin
print, aSpectra[i], aSpectra[i+1]
endfor

but the point is that I miss 3 last numbers at the end because of
these numbers.






On Jun 19, 3:06 pm, Wox <nom...@hotmail.com> wrote:
>> I have no experience with this, but what happens if you use (e.g. for
>> 3rd spectrum):
>
>> specnr=2
>> nlen=7323
>> n=2*nlen+1
>> specoff=n*specnr*4
>> spectra = Assoc(lun, Fltarr(n),specoff)
>
> Sorry, this:
>
> specnr=2
> nlen=7323
> n=2*nlen
> specoff=(n+1)*specnr*4
> spectra = Assoc(lun, Fltarr(n),specoff)
>
> I assume here that the data is: DWORD|fltarr(n)|DWORD|fltarr(n)...
[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: Fri Oct 10 04:49:49 PDT 2025

Total time taken to generate the page: 0.24024 seconds