📄 find_inv_igpmask.m
字号:
function inv_IGPmask=find_inv_IGPmask(IGPmask)%*************************************************************************%* Copyright c 2001 The board of trustees of the Leland Stanford *%* Junior University. All rights reserved. *%* This script file may be distributed and used freely, provided *%* this copyright notice is always kept with it. *%* *%* Questions and comments should be directed to Todd Walter at: *%* twalter@stanford.edu *%*************************************************************************%%FIND_INV_IGPMASK create a matrix to determine IGP number given lat and lon%INV_IGPMASK=FIND_INV_IGPMASK(IGPMASK)% Given an Ionospheric Grid Point (IGP) mask containing nIGPs latitudes% (first column) and longitudes (second column) in IGPMASK(nIGPs,2), this% function creates a 35x72 matrix that points back to the IGP number. % The matrix is latitude divided by 5 deg + 18 for rows and longitude % (0 to 355) divided by 5 for columns. The matrix entries are the index for% the corresponding IGP or NOT_IN_MASK if the IGP is not activated.%% See also: GRID2UIVE IGPFORIPPS INTRIANGLE CHECKIGPSQUARE %2001Feb28 Created by Todd WalterNOT_IN_MASK=-12;IGPmask_min_lat=-85;IGPmask_max_lat=85;IGPmask_min_lon=0;IGPmask_max_lon=355;IGPmask_increment=5;%set all values as not being in the maskinv_IGPmask=ones(length(IGPmask_min_lat:IGPmask_increment:... IGPmask_max_lat), length(IGPmask_min_lon:... IGPmask_increment:IGPmask_max_lon))*NOT_IN_MASK;%convert the latitudes and longitues to 5 degree integer valuesmask_idx=round(IGPmask(:,1:2)/IGPmask_increment);%make sure the longitudes run 0 to 360 degreesmask_idx(:,2)=mod(mask_idx(:,2),360/IGPmask_increment)+1;% adjust the latitude indicies to run from 1 to Nmask_idx(:,1)=mask_idx(:,1)-IGPmask_min_lat/IGPmask_increment + 1;%set the IGP numbersnum_IGP=length(IGPmask);%create the inverse maskinv_IGPmask(sub2ind(size(inv_IGPmask),mask_idx(:,1),mask_idx(:,2)))=... (1:num_IGP)';%Repeat matrix to handle wrap around at 360inv_IGPmask = [inv_IGPmask inv_IGPmask(:,1:18)];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -