;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; program read_pr-2_lev1b_hdf.pro ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; PURPOSE: An IDL Procedure for reading a JPL PR-2 data file. ; DATA FORMAT: Please refer to "User's guide to CAMEX-4 PR-2 data" for ; details. ; ;Copyright (C) 2002, California Institute of Technology. U.S. Government ;Sponsorship under NASA Contract NAS7-1270 is acknowledged. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pro read_pr-2_lev1b_hdf, filen, zhh_ku, ldr_ku, vel_ku, zhh_ka, $ look_vector, range0, isurf, sequence, vsurf, $ vsurfdc8, no_av, fileheader, scantime, alt_r, lat, lon ; Open the file for read and initialize the Vdata interface file_handle = hdf_open(filen,/read) ; get the fileheader Vdata vdata_ID = hdf_vd_find(file_handle,'fileheader') vdata_H = hdf_vd_attach(file_handle,vdata_ID) hdf_vd_get,vdata_H,name=name,fields=raw_field nscan = hdf_vd_read(vdata_H, fileheader) hdf_vd_detach, Vdata_H ; get the scantime vdata vdata_ID = hdf_vd_find(file_handle,'scantime') vdata_H = hdf_vd_attach(file_handle,vdata_ID) nscan = hdf_vd_read(vdata_H, scantime) hdf_vd_detach, Vdata_H ; get the alt_r vdata vdata_ID = hdf_vd_find(file_handle,'alt_r') vdata_H = hdf_vd_attach(file_handle,vdata_ID) nscan = hdf_vd_read(vdata_H, alt_r) hdf_vd_detach, Vdata_H ; Find the scantime vdata vdata_ID = hdf_vd_find(file_handle,'lat') vdata_H = hdf_vd_attach(file_handle,vdata_ID) nscan = hdf_vd_read(vdata_H, lat) hdf_vd_detach, Vdata_H ; Find the scantime vdata vdata_ID = hdf_vd_find(file_handle,'lon') vdata_H = hdf_vd_attach(file_handle,vdata_ID) nscan = hdf_vd_read(vdata_H, lon) hdf_vd_detach, Vdata_H ; Close the hdf file hdf_close,file_handle ; Initialize the scientific data set interface (hdf_sd* routines) sdsfileid = hdf_sd_start(filen,/read) sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'zhh14')) hdf_sd_getdata, sds_id, zhh_ku sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'ldr14')) hdf_sd_getdata, sds_id, ldr_ku sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'vel14')) hdf_sd_getdata, sds_id, vel_ku ka_begin= fileheader(16) ka_end = fileheader(17) if( (ka_begin ge 0) and (ka_end gt ka_begin) ) then begin sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'zhh35')) hdf_sd_getdata, sds_id, zhh_ka endif sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'look_vector')) hdf_sd_getdata, sds_id, look_vector sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'range0')) hdf_sd_getdata, sds_id, range0 sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'isurf')) hdf_sd_getdata, sds_id, isurf sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'sequence')) hdf_sd_getdata, sds_id, sequence sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'v_surf')) hdf_sd_getdata, sds_id, vsurf sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'v_surfdc8')) hdf_sd_getdata, sds_id, vsurfdc8 sds_id = hdf_sd_select(sdsfileid,hdf_sd_nametoindex(sdsfileid, 'no_av')) hdf_sd_getdata, sds_id, no_av hdf_sd_end, sdsfileid return end