Re: skip_lun question [message #65937] |
Tue, 31 March 2009 14:04 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
llo writes:
> I've a question with the skip_lun function.
>
> Looks the following example:
> I've a .dat file that contains a BYTARR(180,240,24) and I want to read
> a 180x240 matrix on the 7th position ([*,*,7])
>
> I tried something like that:
>
> openr, un$lun, file, /get_lun
> skip_lun, un$lun, (180.*240.*7)
> data=bytarr(180,240)
> readu, un$lun, data
> ------------------------------------------------------------ ----
> Now I verify the reading......
>
> point_lun, un$lun, 0
> all_data=bytarr(180,240,24)
> readu, un$lun, all_data
>
> print, total(abs(all_data[*,*,7]-data))
> IDL> 6.71223e+06
>
> The result is so different and I don't know why.
> Any suggestions? Does anybody knows how is the information saved in a
> DAT file.
SKIP_LUN!? That's a new one for me. :-)
First of all, [*,*,7] is the *eighth* position. I presume this
isn't your problem is it? The *seventh* position is [*,*,6].
Anyway, I would do this with an associated variable:
Openr, lun, file, /Get_lun
data = Assoc(lun, Bytarr(180,240,24))
Then, if I wanted the 7th frame of data:
thisframe = data[6]
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|