HDF4 C API SD Interface. Why sdsetdimstrs and sdgetdimstrs don't match

Hello,

I am writing a program to read all of the information from the SD interface.
It prints out all of the file and data set info, including all of the
attributes for these (in XML format). I am trying to get it to also print
all of the information for the dimensions. Everything seems to be working
except for getting the dim strings. Unfortunately I was not getting anything
from SDgetdimstrs from any of my test files (I have a bunch of MODIS files I
am working with). All of the dim strings were printing out blank.

So, I wrote a program that creates a data set with 3 dimensions and sets the
dim strings for one of the dimensions using SDsetdimstrs. Then I use my
reader program and try to use SDgetdimstrings to print them out. They are
still printing out blank! And not only that, the dimension strings that I
set are each showing up as dimension attributes! For example, the dim string
"label" becomes an attribute of the name "long_name". The data type for the
attribute is char8, and the value is the string that I set the dim to in the
first place (in my case "label 999").

Is this a known problem with HDF4? Is it the same case for everyone? Please
let me know! Thanks.

Sulimon,

Could you please submit your example code (and file sample) to help@hdfgroup.org?

Thank you!

Elena

ยทยทยท

On Sep 3, 2010, at 3:19 AM, Sulimon Sattari wrote:

Hello,

I am writing a program to read all of the information from the SD interface. It prints out all of the file and data set info, including all of the attributes for these (in XML format). I am trying to get it to also print all of the information for the dimensions. Everything seems to be working except for getting the dim strings. Unfortunately I was not getting anything from SDgetdimstrs from any of my test files (I have a bunch of MODIS files I am working with). All of the dim strings were printing out blank.

So, I wrote a program that creates a data set with 3 dimensions and sets the dim strings for one of the dimensions using SDsetdimstrs. Then I use my reader program and try to use SDgetdimstrings to print them out. They are still printing out blank! And not only that, the dimension strings that I set are each showing up as dimension attributes! For example, the dim string "label" becomes an attribute of the name "long_name". The data type for the attribute is char8, and the value is the string that I set the dim to in the first place (in my case "label 999").

Is this a known problem with HDF4? Is it the same case for everyone? Please let me know! Thanks.
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org