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

Home » Public Forums » archive » NetCDF4 problem
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: NetCDF4 problem [message #93007 is a reply to message #93003] Fri, 08 April 2016 08:22 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/8/16 6:37 AM, deathknight wrote:
> 在 2016年4月8日星期五 UTC+8上午1:03:28,Mike Galloy写道:
>> On 4/7/16 8:36 am, Paul van Delst wrote:
>>> On 04/07/16 09:52, deathknight wrote:
>>>> Hi,
>>>>
>>>> I'm using IDL 7.1. How can I read the NetCDF4 files using this version
>>>> of IDL?
>>>
>>> NetCDF4 support wasn't added until v8.0 so the best (only?) way is to
>>> upgrade your IDL install.
>>
>> I think that is correct.
>>
>>> Similarly, HDF5 support wasn't added until v8.3 (?) so that route is a
>>> no go.
>>
>> HDF5 support has been in IDL since 5.6:
>>
>> http://harrisgeospatial.com/docs/H5_OPEN.html
>>
>> I would read the NetCDF 4 file using the HDF 5 routines. If you want
>> simpler routines than the low level interface, check out my HDF 5 routines:
>>
>> https://github.com/mgalloy/mglib/tree/master/src/hdf5
>>
>> The routine to use is MG_H5_GETDATA. You will need the files in that
>> directory (plus at least objects/idl_object__define.pro to run on IDL 7.1).
>>
>
> Could you please show me more about how to use these routines on IDL 7.1?
> I added all the .pro files from your website into the /lib and run:
> IDL> result=mg_h5_getdata('E:\netcdf4.nc')
> and I got the error: MG_H5_GETDATA: no variable requested
>
> Thank you very much!
>

Yes, you have to specify the variable/attribute that you want:

IDL> var = mg_h5_getdata('E:\netcdf4.nc', 'group/myvar')
IDL> attr = mg_h5_getdata('E:\netcdf4.nc', 'group/myvar.attr')

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: READ array from a file
Next Topic: Re: Problems on the Savitzky-Golay smoothing filter

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

Current Time: Wed Oct 08 17:30:17 PDT 2025

Total time taken to generate the page: 0.00432 seconds