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

Home » Public Forums » archive » Editing data in an existing HDF5 file and rewriting the fixed file, in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Editing data in an existing HDF5 file and rewriting the fixed file, in IDL [message #65020] Thu, 05 February 2009 07:46
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
Dear all,

I was hoping someone might be able to offer some advice about an IDL
problem my group have been having, and we have not been able to solve
or find the answer to online. David Fanning suggested that this group
might help; I've searched the archives but not found an answer, so I
thought I should just ask! I hope I'm not breaking any etiquette with
this post.

As part of our work we generate data in the HDF5 format (it's not HDF-
EOS, in case that matters), and following the completion of our
processing we have found a bug in one of the datasets contained within
these files. To fix this we are writing some IDL code to load in an
HDF5 file, fix the variables concerned, and write the correct values
back into the HDF5 file.

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

This Object ID value is the value of the dataset I read the 'wrong'
data from and am trying to write the 'right' data to. I am using IDL
7.0 on Ubuntu and have the appropriate permissions to be able to read
and write the file.

I would appreciate any suggestions you may have--we are all stumped
but presumably there is some sensible way to achieve this? I am happy
to post all of my code (106 lines) if this would be of help; the
relevant bits are here:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Load relevant bits of file ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

id = h5f_open(l2file)
id_g1=h5g_open(id,"ORACoutput")

id_d1=h5d_open(id_g1,"cloud data")
cloud_data=h5d_read(id_d1)

id_d2=h5d_open(id_g1,"cloud error")
cloud_error=h5d_read(id_d2)

id_d3=h5d_open(id_g1,"iteration")
iteration=h5d_read(id_d3)

id_d4=h5d_open(id_g1,"phase")
phase=h5d_read(id_d4)

(The section of code where the bad variables--parts of cloud_data and
cloud_error are altered--is omitted.)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Write back out and close file ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

h5d_write,id_d1,cloud_data
h5d_write,id_d2,cloud_error

h5d_close,id_d1
h5d_close,id_d2
h5d_close,id_d3
h5d_close,id_d4
h5d_close,id_g1
h5d_close,id

Does anyone have any ideas where I'm going wrong?

Many thanks,

Andy

--------------------------------------------
Andy Sayer
Atmospheric, Oceanic and Planetary Physics,
Department of Physics
University of Oxford, Clarendon Laboratory,
Parks Road, Oxford, OX1 3PU, U.K.
Tel: +44 (0)1865 272915
Fax: +44 (0)1865 272923
Email: sayer@atm.ox.ac.uk (or a.sayer1@physics.ox.ac.uk)
Web: http://www.atm.ox.ac.uk/user/sayer/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: fsc_field double
Next Topic: Java Bridge Help

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

Current Time: Wed Oct 08 17:41:04 PDT 2025

Total time taken to generate the page: 0.00553 seconds