Re: How can I know all the information of a CDF file? [message #66146] |
Thu, 16 April 2009 16:20 |
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  |
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  |
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.")
|
|
|