Программа для перевода значений магнитного поля, измеренного на спутнике, в систему координат, где полное магнитное поле направлено по оси Z земного магнитного поля.
Описание таких координат:
"Phase skipping and Poynting flux of continuous pulsations"
P. J. Chi and C. T. Russell
J. Geophys. Res. Vol. 103, No. A12, p. 29,479, 1998
http://www-ssc.igpp.ucla.edu/personnel/ … node3.html
The field-aligned coordinates are defined as
b = B/ mod(B) - field aligned,
e = (b*r) / mod(b*r) - eastward,
n = e * b - outward,
where r - is in the radial direction.
A schematic diagram of this field-aligned coordinate system is shown in Fig 1a. (Картинка в самом низу)
Программа на MATLABе
% Transformation B in field-aligned coordinates
% Data(1, : ) - Bx component of B
% Data(2, : ) - By component of B
% Data(3, : ) - Bz component of B
% Data(4, : ) - X in GSE
% Data(5, : ) - Y in GSE
% Data(6, : ) - Z in GSE
% avg_time - averaging time for B
%------------------------------------------------
function T_Data = TRANSFORM_DATA_for_SolTerr( Data, avg_time )
if( avg_time ~= 0)
B(1, : ) = smooth( Data(1, : ), avg_time, 'lowess' );
B(2, : ) = smooth( Data(2, : ), avg_time, 'lowess' );
B(3, : ) = smooth( Data(3, : ), avg_time, 'lowess' );
else
B = Data(1:3, : );
end;
XYZ(1:3, : ) = Data(4:6, : );
size_buf = length(B);
b = zeros( 3, size_buf );
e = zeros( 3, size_buf );
n = zeros( 3, size_buf );
T_Data = zeros( 3, size_buf );
T_matx = zeros(3,3);
%Definition of the field-aligned coordinates
for( j = 1 : size_buf )
b(:, j) = B(:, j)/norm(B(:, j));
cros = cross(XYZ(:, j), B(:, j));
e(:, j) = cros/norm(cros);
n(:, j) = cross(e(:, j), b(:, j));
end;
%Transformation
for ( j = 1 : size_buf )
T_matx = [[n(1,j),n(2,j),n(3,j)]; ...
[e(1,j),e(2,j),e(3,j)]; ...
[b(1,j),b(2,j),b(3,j)]];
T_Data(1:3, j) = T_matx * Data(1:3, j);
end;
%------------------------------------------------