Calculate Rotaion for referenceframe

Hello, I would like to determine the 3 rotation parameters from the 2 given files (each with different frequenzcy bands) Unfortunately I always got the value zero. The files have the same size and the respective sources are in the same array position. The required right ascension α (Var5 in the file) and declination δ (Var8) are given in hours and degrees. I have a problem with the adjustment calculation and currently the dimension from the two arrays dosent match. I also have to determine the Uncertainty for the respective rotation parameter.The given equation is ∆α cos δ = R1 cos α sin δ + R2 sin α sin δ − R3 cos δ. I already prepared the data and filtered the sources.
data1 = readtable('Sources_in_SX_filtered_XKA_with_SX.csv');
data2 = readtable('Sources_in_XKA_filtered_XKA_with_SX.csv');
alpha1 = data1.Var5;
delta1 = data1.Var8;
alpha2 = data2.Var5;
delta2 = data2.Var8;
% arcsec
alpha1_arcsec = alpha1 * 15 * 3600; % right ascension data 1 in arsec
delta1_arcsec = delta1*3600; % declination data 1 in arcsec
alpha2_arcsec = alpha2* 15 * 3600; % right ascension data 2 in arsec
delta2_arcsec = delta2*3600; % declination data 2 in arcsec
% coordinate differences
delta_alpha_cos_delta_arcsec = cos(delta1_arcsec) .* (alpha2_arcsec - alpha1_arcsec);
% linear adjustment calculation for the rotation
A = [sin(alpha1_arcsec) .* sin(delta1_arcsec), cos(alpha1_arcsec) .* sin(delta1_arcsec),-cos(delta1_arcsec)];
L = delta_alpha_cos_delta_arcsec';
% solve
X = pinv(A) * L; % wrong dimensions for matrix multiplication 556x3 * 556x1 not possible
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.
% ectract rotation parameter
R1_arcsec = X(1);
R2_arcsec = X(2);
R3_arcsec = X(3);

回答 (1 件)

Voss
Voss 2023 年 8 月 23 日

0 投票

data1 = readtable('Sources_in_SX_filtered_XKA_with_SX.csv');
data2 = readtable('Sources_in_XKA_filtered_XKA_with_SX.csv');
alpha1 = data1.Var5;
delta1 = data1.Var8;
alpha2 = data2.Var5;
delta2 = data2.Var8;
% arcsec
alpha1_arcsec = alpha1 * 15 * 3600; % right ascension data 1 in arsec
delta1_arcsec = delta1*3600; % declination data 1 in arcsec
alpha2_arcsec = alpha2* 15 * 3600; % right ascension data 2 in arsec
delta2_arcsec = delta2*3600; % declination data 2 in arcsec
% coordinate differences
delta_alpha_cos_delta_arcsec = cos(delta1_arcsec) .* (alpha2_arcsec - alpha1_arcsec);
% linear adjustment calculation for the rotation
A = [sin(alpha1_arcsec) .* sin(delta1_arcsec), cos(alpha1_arcsec) .* sin(delta1_arcsec),-cos(delta1_arcsec)];
% no transpose (or do transpose here, then transpose L in the next step)
L = delta_alpha_cos_delta_arcsec;
% solve
X = pinv(A) * L % correct dimensions for matrix multiplication 3x556 * 556x1
X = 3×1
1.0e-03 * -0.3587 0.1166 -0.1078
% ectract rotation parameter
R1_arcsec = X(1);
R2_arcsec = X(2);
R3_arcsec = X(3);

1 件のコメント

Jakob
Jakob 2023 年 8 月 26 日
Thank you for your help but i just recognized that i calculated the parameters wrong.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeAerospace Applications についてさらに検索

製品

リリース

R2023a

質問済み:

2023 年 8 月 23 日

コメント済み:

2023 年 8 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by