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

Home » Public Forums » archive » Re: How can I know all the information of a CDF 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: How can I know all the information of a CDF file? [message #66146] Thu, 16 April 2009 16:20
russell.grew is currently offline  russell.grew
Messages: 74
Registered: February 2005
Member
If you want a softer approach I suggest downloading CDAWlib and
playing around with some of the routines in there.

The CDFx GUI is a nice graphical way [you Matlab users like GUI's
right?] of coming to terms with the contents of a given CDF quickly.

I have also found some the Berkeley CDF routines useful. They can be
found in the IDL libraries for various missions [FAST, THEMIS etc]

Cheers.
Re: How can I know all the information of a CDF file? [message #66149 is a reply to message #66146] Thu, 16 April 2009 11:56 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
litongmu@gmail.com writes:

> I am not sure whether there is anyone who is working on CDF files. But
> if there is, I want to ask how you get the variable information, like
> the variable name. I know how to do that in Matlab. But as to
> manipulating CDF files, Matlab is not as powerful as IDL. So I want to
> switch to IDL. But I do not want to use them both. Because one of my
> machine do not have a Matlab license. So please tell me if you know
> the answer.

I've not done this, but I think you would do
it something like this:

PRO CDFVARNAME
fID = CDF_Open(filename)
info = CDF_Inquire(fID)
nvars = info.nvars
FOR j=0,nvars-1 DO BEGIN
varInfo = CDF_VarInq(fID, j)
Help, varInfo, /Structure
Print, 'Variable Name: ', varInfo.name
ENDFOR
CDF_Close, fID
END

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: How can I know all the information of a CDF file? [message #66150 is a reply to message #66149] Thu, 16 April 2009 11:54 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
litongmu@gmail.com writes:

> I am not sure whether there is anyone who is working on CDF files. But
> if there is, I want to ask how you get the variable information, like
> the variable name. I know how to do that in Matlab. But as to
> manipulating CDF files, Matlab is not as powerful as IDL. So I want to
> switch to IDL. But I do not want to use them both. Because one of my
> machine do not have a Matlab license. So please tell me if you know
> the answer.

I've not done this, but I think you would do
it something like this:

fID = CDF_Open(filename)
info = CDF_Inquire(fID)
nvars = info.nvars
FOR j=0,nvars-1 DO BEGIN
varInfo = CDF_VarInq(fID, j)
Help, varInfo, /Structure
Print, 'Variable Name: ', varInfo.name
ENDFOR
CDF_Close, fID

Cheers,

David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: bug or feature?
Next Topic: Reading in data question

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

Current Time: Thu Oct 09 14:49:52 PDT 2025

Total time taken to generate the page: 1.28086 seconds