Use of /APPEND keyword [message #80836] |
Fri, 13 July 2012 00:44 |
titan
Messages: 59 Registered: March 2006
|
Member |
|
|
Hi all,
probably I'm doing something stupid but I have this following problem:
I would like to extract from 10 granules of an image (.h5 file) a data set and write a unique file containing all the information from the 10 granules:
FOR i = 0, N_ELEMENTS(granules_vect) - 1 DO BEGIN
longitude_dataset_id=H5D_OPEN(obj_0_group_id, '/'+obj_0_name+'/'+sub_group_0_name+'/Longitude')
longitude=H5D_READ(longitude_dataset_id)
;; Write the LONGITUDE's values in a file
OPENW,long_lun,current_dir+'\'+'longitude.dat', /GET_LUN, /APPEND
WRITEU, long_lun, longitude
FREE_LUN, long_lun
ENDOFOR
H5D_CLOSE, longitude_dataset_id
My problem is that when I run again the code the file .dat starts becoming bigger and bigger like if it is appending the same file to the previous one
could someone help me telling what I'm doing wrong??
thanks a lot
|
|
|