% ------------------------------------------------------------------- %
% ------------------------------ PC_cal ----------------------------- %
% ------------------------------------------------------------------- %

function [P] = PC_cal(UTsec,lon,Lat)

%          Value of PCs 1-5 at a specifed latitude and local time   
%          PCTc 1-5 are the matrixes of PCs 1-5 
                load('PC_para.mat')
                LT = mod(UTsec(:)/3600+lon(:)/15,24);
                
                P  = ones(5,numel(LT));
                
                P(1,:)     = griddata(LTx,Laty,PCTc1',LT,Lat(:));
                P(2,:)     = griddata(LTx,Laty,PCTc2',LT,Lat(:));
                P(3,:)     = griddata(LTx,Laty,PCTc3',LT,Lat(:));
                P(4,:)     = griddata(LTx,Laty,PCTc4',LT,Lat(:));
                P(5,:)     = griddata(LTx,Laty,PCTc5',LT,Lat(:));

end