Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: Editing data in an existing HDF5 file and rewriting the fixed file, in IDL
On Feb 5, 4:46 pm, Andy Sayer <iamandysa...@gmail.com> wrote: > Unfortunately this is not working properly--when I try to write back > out to the dataset (using the same id I used to read it in) I get an > error message like this: > > H5D_WRITE: can't write data: Object ID:402653184 > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > ; Load relevant bits of file ; > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > id = h5f_open(l2file) Open the file with write permission: id = h5f_open(l2file,/write) Start from here, I haven't checked the rest of your code. Maarten
On 5 Feb, 16:37, sav...@nsidc.org wrote: > Andy Sayer <iamandysa...@gmail.com> writes: >> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >> ; Load relevant bits of file ; >> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > >> id = h5f_open(l2file) >> id_g1=h5g_open(id,"ORACoutput") > > Andy, > > I'm not an expert, but are you using an IDL version < 6.2? (that's when the > keyword /WRITE was added to the h5f_open call) > > id = h5f_open(l2file, /write) > > WRITE > If set the file is open for both reading and writing. The default is to open > the file in read_only mode. > > Matt > > -- > Matthew Savoie - Scientific Programmer > National Snow and Ice Data Center > (303) 735-0785 http://nsidc.org Hi, Thanks very much both--you were indeed correct! Due to a local problem our IDL help has been unavailable recently--we're using IDL 7.0 but the help files I could access were for 6.0, before this keyword was presumably added. As they say the stupid questions are easiest to answer. All appears to be working now. (In case anyone stumbles upon this later, I found a couple more bugs I needed to fix: my final calls should be h5g_close and h5f_close, as opposed to more h5d_close). Andy