RE: [Tcl-nap-users] writing HDF files
Brought to you by:
dav480,
peter_turner
From: <Pet...@cs...> - 2006-03-10 04:23:44
|
Hi salah, =20 You seem to have sorted out how to write multiple SDSs and attributes.=20 I am not sure if you are aware but you need to be careful mixing NAOs and tcl commands. Your example below is a bit dangerous if you want to use x for anything else. NAOs have a reference count which counts the number of tcl variables pointing at them. If the NAO reference count goes to 0 then the NAO kills itself. In order to create a relationship between the NAO and a tcl variable the nap command needs to be used: nap x =3D [nap_get hdf .......] In the above case the NAO will have a reference count of 1 and be attached to x so that if x gets unset the reference count on the NAO will be decremented and if the reference count is zero it will disappear. In your example, although x points to the NAO the reference count on the NAO will be 0. In this case the NAO is a bit smart an says, hey, you just created me, even though I have a zero reference count I must be needed for something so I will hang around until something happens. In your case you wrote straight back to an HDF file. However, once that event happened the NAO will disappear so trying to do anything further with x/NAO will not work. It is important to understand this, because if you do not you can get into lots of trouble. You cannot get rid of the fillvalue at present using nap. I doubt that this is causing a problem. I would just check the contents of the output file with hdp, I would then use the NAP HDF display utility to have a look at the contents of each file and make sure there is nothing else wrong. Cheers Peter -----Original Message----- From: tcl...@li... [mailto:tcl...@li...] On Behalf Of salah jubeh Sent: Wednesday, 8 March 2006 11:03 PM To: NAP Subject: [Tcl-nap-users] writing HDF files Hi guys =20 I tried to genarate HDF files out of NAOs. =20 set x [nap_get hdf c:/sampels/p14/gdal/p14_4.hdf "3-dimensional Scientific Dataset"] $x hdf sa.hdf sa nap_get hdf -list sa.hdf ------- sa sa:_FillValue I want to ask how i can add SDS to the file like transformation matrix and projection.=20 =20 Regards =20 Yahoo! Mail Use Photomail <http://us.rd.yahoo.com/mail_us/taglines/pmall2/*http://photomail.mail.y ahoo.com> to share photos without annoying attachments. |