Re: Question regarding HDF file [message #55138] |
Mon, 06 August 2007 08:05  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
None wrote:
> Hi. I have a problem rewriting the data to the original hdf file
> (i.e., to the same dataset which i had read from, earlier) I am
> getting negetive data values. Also I am getting the same negetive data
> values if i put a dummy array instead of the data in the
The fact that you are getting negative values suggests that you may
have a type conversion problem. What is the HDF data type for the SDS
you're trying to overwrite? What is the IDL type of the rowp array
that you're writing down below?
> HDF_SD_ADDDATA command. I got correct values when I output the result
> to a tiff file, but not able to get the correct values if I write it
> back to the original file. I have posted my code bellow. Can anybody
> please help me with a solution
>
> sdFileID2 = HDF_SD_Start(fname, /RdWr)
> sdsIDsm = HDF_SD_Select(sdFileID2,im[j]); im[j] are different bands
> HDF_SD_ADDDATA, sdsIDsm, rowp, start=[0,0], count=[x[j],y[j]]
> ; rowp is the dataset and is of type float
> ; x,y are the array dimensions
> HDF_SD_EndAccess, sdsIDsm
I just performed a test, and I had no problems overwriting data using
code similar to yours. The one important thing that seems to be
missing from your code is a call to HDF_SD_End, but what you've
written is obviously a code fragment, rather than a complete program,
so I'm not sure whether that procedure call is really missing.
|
|
|