;; add this into your idl path pro read_csoRadio, files, header, data,tt, freq, obsdate ; file 是字符串 fits 路径 ; header 文件头 /structure ; data 数据 一般为三维数组 [nt, nf, np] [时间,频率,偏振] ; tt 为秒偏移量,相对于 观测日期 obsdate 的 00:00:00 ; freq 频率 单位 MHz ; obsdate 观测日期,北京时间 ;;; 读主表格和 头文件 data = readfits( files, head ) header = fitshead2struct( head ) ;;;查看有几张扩展表 fits_info, files, SILENT=1, N_ext=n_ext, extname=extname ;; /textout ;; 输出信息 ;print,'all ', n_ext,' table in the fits...' ;; 共 n_ext 张表 bnum = 1 ;;=======读数据=====读第一个扩展表的数据; FXBOPEN, lun, files, bnum, BINhead colnum = fxpar(binhead,'TFIELDS') ;; 扩展表格中存在几列数据; rownum = fxpar(binhead,'NAXIS2') ;; 扩展表格中存在几行数据; TTYPE1 = fxpar(binhead,'TTYPE1') TTYPE2 = fxpar(binhead,'TTYPE2') FXBREAD, lun, tt, 1, 1 ;;; 读出频率值 FXBREAD, lun, freq, 2, 1 FXBCLOSE, lun obsdate = strmid( header.date_BEG, 0, 10 ) if tt[0] < 0 then begin CALDAT, JULDAY(long(strmid(obsdate,5,2)),long(strmid(obsdate,8,2)),long(strmid(obsdate,0,4))) + 1, Month, Day, Year obsdate =string(year,format='(I04)') + '-'+string(Month,format='(I02)') + '-' + string(day,format='(I02)') endif end