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

Home » Public Forums » archive » Re: Question regarding HDF file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Question regarding HDF file [message #55138] Mon, 06 August 2007 08:05 Go to previous message
James Kuyper is currently offline  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.
[Message index]
 
Read Message
Read Message
Previous Topic: Predicting string lengths in widgets
Next Topic: Use IDL6.0 to read Fortran 90 written data

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

Current Time: Wed Oct 08 19:11:35 PDT 2025

Total time taken to generate the page: 0.00449 seconds