全球电离层图目前应用非常广泛,目前提供该数据产品的单位包括CODE、CAS、UPC、WHU等等。国内推荐中科院空天院李子申、王宁波团队的产品:ftp://ftp.gipp.org.cn/product/,包括IONEX、BDGIM、ION文件、DCB文件等。

下面提供IONEX数据读取的matlab代码,采用正则式进行读取,非常简洁高效。

function [ION,TimeTk] = readionexfile(ionfile)
str = fileread(ionfile);
ca1 = regexp(str, '(?<=START OF TEC MAP).+?(?=END OF TEC MAP)', 'match');
ca1 = ca1(1:end-1);
ION = nan( 73, 71, length(ca1) );
lat2ix  = @(lat) round((lat+87.5)/2.5)+1;
% lon2ix  = @(lon) round((lon+180)/5.0)+1;
for jj = 1 : length( ca1 )
    buf = regexp( ca1{jj}, '\n', 'split', 'once' );
    buf = regexp( buf{2} , '\n', 'split', 'once' );
    ut  = textscan( buf{1}, '%*f%*f%*f%f%*[^\n]' );
    ut  = ut{1};
    ca2 = regexp( buf{2}, 'LAT/LON1/LON2/DLON/H', 'split' );
    pos = ca2{1};
    for kk = 2 : length( ca2 )
        lat = textscan( pos,'%f%*[^\n]' );
        lat = lat{1};
        num = sscanf( ca2{kk}(1:end-60), '%f' );
        pos =  strtrim( ca2{kk}(end-60+1:end) );
        ION(:,lat2ix(lat),jj) = num;
    end
end
TimeTk = zeros(length(ca1),6);
for k = 1:length(ca1)
    TimeTk(k,:) = str2num(ca1{k}(1:60));
end

 

 

 

 

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐