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

Home » Public Forums » archive » Re: reading portions of a large binary file
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: reading portions of a large binary file [message #74268] Sat, 08 January 2011 07:41
oxfordenergyservices is currently offline  oxfordenergyservices
Messages: 56
Registered: January 2009
Member
On Jan 8, 3:38 pm, geoff <oxfordenergyservi...@googlemail.com> wrote:
> On Jan 8, 3:00 pm, David Fanning <n...@dfanning.com> wrote:
>
>> geoff writes:
>>> if the answer I am looking for is read_binary, then I've found it!
>
>> The answer could well be Read_Binary, but the method
>> underlying that would be the associated variable method
>> of reading the data. See the ASSOC command in IDL.
>
> thanks.  i used
>
> strip=read_binary('bin',data_start=na*4,data_type=4,data_dim s=[n2-
> n1+1])
>
> which seems to work fine except when na gets too big (my offset is 3
> billion or so)
>
> I assume I'll have the same problem in assoc because long ints don't
> go that high?
>
> i'm assuming this is not possible then for an offset greater than max
> of long?

ahh! long64. all working! thanks David
Re: reading portions of a large binary file [message #74269 is a reply to message #74268] Sat, 08 January 2011 07:38 Go to previous message
oxfordenergyservices is currently offline  oxfordenergyservices
Messages: 56
Registered: January 2009
Member
On Jan 8, 3:00 pm, David Fanning <n...@dfanning.com> wrote:
> geoff writes:
>> if the answer I am looking for is read_binary, then I've found it!
>
> The answer could well be Read_Binary, but the method
> underlying that would be the associated variable method
> of reading the data. See the ASSOC command in IDL.
>

thanks. i used

strip=read_binary('bin',data_start=na*4,data_type=4,data_dim s=[n2-
n1+1])

which seems to work fine except when na gets too big (my offset is 3
billion or so)

I assume I'll have the same problem in assoc because long ints don't
go that high?

i'm assuming this is not possible then for an offset greater than max
of long?
Re: reading portions of a large binary file [message #74270 is a reply to message #74269] Sat, 08 January 2011 07:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
geoff writes:

> if the answer I am looking for is read_binary, then I've found it!

The answer could well be Read_Binary, but the method
underlying that would be the associated variable method
of reading the data. See the ASSOC command in IDL.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: reading portions of a large binary file [message #74271 is a reply to message #74270] Sat, 08 January 2011 05:17 Go to previous message
oxfordenergyservices is currently offline  oxfordenergyservices
Messages: 56
Registered: January 2009
Member
On Jan 8, 12:59 pm, geoff <oxfordenergyservi...@googlemail.com> wrote:
> Hi
>
> I have a large (4GB file) which is basically a large 2-D matrix of
> elevations.  I want to read just some portion of this file
> (representing a lat/long box).  I could read in the whole file line by
> line (because it is too big for RAM) and just take out the relevant
> bits, or preferably I want it to only read off the disc the relevant
> bits of the file.  Is this possible in IDL?  I vaguely remember this
> being possible in fortran but can't find it by googling.
>
> Thanks

if the answer I am looking for is read_binary, then I've found it!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: reading portions of a large binary file
Next Topic: Re: Read large ascii file quickly

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

Current Time: Wed Oct 08 22:10:52 PDT 2025

Total time taken to generate the page: 0.80544 seconds