help, cannot create hdf-sd string array variable [message #34326] |
Thu, 06 March 2003 08:43 |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
Hopefully someone can give me a quick pointer.
(as a favor) I am transferring data written in idl, to another computer
to be read by matlab. I chose hdf to make it "easier". I don't actually
know any hdf, hence the question.
My problem is that I create 3 arrays in the hdf file,
one of which is a 2D string array. When I try to write it (string array),
I get the follow error message:
% HDF_SD_ADDDATA: Cannot write 13 elements. The data area is not that big.
% Execution halted at: HDF_RADAR_WRITE
Here is the relevant code:
..... snip .......
headersize = size(header_array)
sds_header_id=HDF_SD_CREATE(sd_id,'Header',[headersize[1],he adersize[2]],/string)
HDF_SD_SETINFO,sds_header_id,LABEL='header thing', $
UNIT='nadda'
; Write labels to each of the dimensions
HDF_SD_DIMSET,HDF_SD_DIMGETID(sds_header_id,0),NAME='headwid e',LABEL='label head tall'
HDF_SD_DIMSET,HDF_SD_DIMGETID(sds_header_id,1),NAME='headtal l',LABEL='label head tall'
; Create and write the data
HDF_SD_ADDDATA, sds_header_id, header_array
; Done Close down the SDS
HDF_SD_ENDACCESS,sds_header_id
..... snip .......
Now, when I change this (header_array and the sd_create call) to float (for instance)
everthing works fine.
So what is the problem with this? It seems specific to the string variable type.
Where does "13 elements" come from?
Note: header_array = string(findgen(10,2)+100)
Chees,
bob stockwell
|
|
|