PRO read_calipso_altitudes ; This routine demonstrates reading the altitude data stored ; in a CALIPSO Lidar Level 1B, Lidar Level 2 Aerosol Profile, ; or Lidar Level 2 Cloud Profile data file. The altitudes are ; stored in an HDF vdata (table) structure named "metadata". ; One field (column) in the table is named "Lidar_Data_Altitudes". ; The table contains only one row, and the value in that row under ; the "Lidar_Data_Altitudes" column is an array of the altitude ; values. ; There are no input or output parameters. The CALIPSO file is ; specified through a file selection dialog box, and any errors ; are reported in pop-up message dialog boxes. cfile = DIALOG_PICKFILE(TITLE="Select CALIPSO file") fid = HDF_OPEN(cfile,/READ) IF (fid eq -1) THEN BEGIN msg_text = "Problem opening file " + filename GOTO, error ENDIF vdref = HDF_VD_FIND(fid,"metadata") IF (vdref eq 0) THEN BEGIN msg_text = "Can't find vdata metadata in file " + filename GOTO, error ENDIF vdid = HDF_VD_ATTACH(fid,vdref,/READ) IF (vdref eq 0) THEN BEGIN msg_text = "Problem attaching vdata " + vdname GOTO, error ENDIF status = HDF_VD_READ(vdid,altitudes,FIELDS="Lidar_Data_Altitudes") IF (status NE 1) THEN BEGIN msg_text = "Problem reading altitude field in vdata" GOTO, error ENDIF PRINT,altitudes HDF_VD_DETACH,vdid HDF_CLOSE,fid RETURN ; error handler error: status = DIALOG_MESSAGE(msg_text,/INFORMATION,TITLE='read_vdata message') vdata_struc = 0 END