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

Home » Public Forums » archive » Reading part of a netcdf file?
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 part of a netcdf file? [message #86023 is a reply to message #86016] Tue, 24 September 2013 13:01 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 9/24/13 9:26 AM, rjp23@le.ac.uk wrote:
> I have a very large (22GB) netcdf file and I was hoping there was
> some way to read part of it at a time into IDL but I can't figure out
> how.
>
> For example, I have this variable:
>
> Var FLOAT = Array[144, 72, 17, 32161]
>
> The 4th dimension is time, i.e. the are 32161 timesteps.
>
> Is it possible to read only the first X in one go, then read the next
> X, etc meaning that less is stored in memory at once?
>
> Cheers
>
> Rob
>

You might want to try MG_NC_GETDATA. You can do stuff like:

IDL> data = mg_nc_getdata(filename, 'var[*, *, *, 0:9]')

Get it from the mglib GitHub repo:

https://github.com/mgalloy/mglib/blob/master/src/netcdf/mg_n c_getdata.pro

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading large files with restore
Next Topic: temporary() problem

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

Current Time: Fri Oct 10 04:27:25 PDT 2025

Total time taken to generate the page: 0.71953 seconds