Skip to content

Commit

Permalink
Fixes error on calibration matrices storage
Browse files Browse the repository at this point in the history
Since we interpolate calibration matrices received from TC LOAD KCOEFS
we need to store one more for the last frequency bin.

Signed-off-by: Alexis Jeandet <[email protected]>
  • Loading branch information
jeandet committed Oct 21, 2021
1 parent 374f3a5 commit d461c9b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
option('SW_VERSION_N1', type : 'string', value : '3', description : 'N1 FSW Version.')
option('SW_VERSION_N2', type : 'string', value : '3', description : 'N2 FSW Version.')
option('SW_VERSION_N3', type : 'string', value : '0', description : 'N3 FSW Version.')
option('SW_VERSION_N4', type : 'string', value : '0', description : 'N4 FSW Version.')
option('SW_VERSION_N4', type : 'string', value : '1', description : 'N4 FSW Version.')

option('fix-b2bst', type : 'boolean', value : true, description : 'Activate -mfix-b2bst switch to mitigate \"LEON3FT Stale Cache Entry After Store with Data Tag Parity Error\" errata, GRLIB-TN-0009')

Expand Down
16 changes: 12 additions & 4 deletions python_scripts/CalibrationMatricesInit_codeGen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -11,7 +11,8 @@
"F,B,E=jsonpickle.decode(open('../ASM_calibration_default-full-tables_FSW_R3.3_AC_DIFF_G5_or_DC_DIFF_G1_R=0-0-0_kappa=1e-04_2021-09-08.json').read())\n",
"\n",
"START_INDEXES=[16, 5, 6]\n",
"SIZES=[88, 104, 96]\n",
"#+1 on sizes for interpolation with TC LOAD KCOEFS\n",
"SIZES=[88+1, 104+1, 96+1]\n",
"\n",
"decl = \"\"\n",
"for prefix,matrix in ((\"float mag_calibration_matrices_f{freq_index}[{size} * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {{\",B),\n",
Expand All @@ -36,7 +37,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -47,7 +48,7 @@
"#include \"processing/calibration_matrices.h\"\n",
"#include \"lfr_common_headers/fsw_params_processing.h\"\n",
"\n",
"float mag_calibration_matrices_f0[88 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {\n",
"float mag_calibration_matrices_f0[89 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {\n",
" 0.3180653172124821f, 0.34533355304189123f, -0.3390720533129207f, -0.3577615717181845f,\n",
" 0.24298464922670662f, 0.28443564342586913f, -0.3640000438602313f, -0.40002618004304363f,\n",
" 0.006095818883180522f, 0.0027480991277206166f, 0.3638669618258464f, 0.3424604116723766f,\n",
Expand All @@ -60,6 +61,13 @@
"!clang-format --style=file -i ../src/processing/calibration_matrices.c\n",
"!head ../src/processing/calibration_matrices.c"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
30 changes: 18 additions & 12 deletions src/processing/calibration_matrices.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "processing/calibration_matrices.h"
#include "lfr_common_headers/fsw_params_processing.h"

float mag_calibration_matrices_f0[88 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {
float mag_calibration_matrices_f0[89 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {
0.3180653172124821f, 0.34533355304189123f, -0.3390720533129207f, -0.3577615717181845f,
0.24298464922670662f, 0.28443564342586913f, -0.3640000438602313f, -0.40002618004304363f,
0.006095818883180522f, 0.0027480991277206166f, 0.3638669618258464f, 0.3424604116723766f,
Expand Down Expand Up @@ -398,10 +398,12 @@ float mag_calibration_matrices_f0[88 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_C
0.2048766816015542f, -0.705366929992031f, -0.43290431007551256f, 0.621247923837181f,
0.2543344187422558f, -0.7856387342548593f, 0.004336130391954558f, -0.00020884326526464205f,
-0.2263910725737219f, 0.5772578420495929f, 0.16857583011796418f, -0.4867097640635607f,
0.2958701874611725f, -0.9464791375029841f, 0.3774165159082303f, -0.5121883264952679f
0.2958701874611725f, -0.9464791375029841f, 0.3774165159082303f, -0.5121883264952679f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f
};

float mag_calibration_matrices_f1[104 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {
float mag_calibration_matrices_f1[105 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX] = {
0.3779821425241938f, -1.8107693012091568f, -0.4156954227302341f, 1.9394935075569926f,
0.3114297053584359f, -1.9989013737615606f, -0.4338084134446927f, 2.0722119527732223f,
0.003069166030554314f, -0.03162479128117928f, 0.41188018044645497f, -2.689974570899489f,
Expand Down Expand Up @@ -869,10 +871,11 @@ float mag_calibration_matrices_f1[104 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_
0.3512891026563974f, 0.38330325705585144f, -0.24793873649100123f, -0.30678598273932167f,
0.37659422615718413f, 0.42885885745638f, -0.0062040865931739415f, -0.0028929644127959333f,
-0.37533963104736073f, -0.3674379585337547f, 0.22133563776394244f, 0.26680229458526317f,
0.4526809582106607f, 0.5218225549581134f, 0.18947983457797304f, 0.2492579544906193f
0.4526809582106607f, 0.5218225549581134f, 0.18947983457797304f, 0.2492579544906193f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f
};

float mag_calibration_matrices_f2[96 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX]
float mag_calibration_matrices_f2[97 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_COMPLEX]
= { -70.11937154232844f, -38.743097117431255f, 70.87705527956066f, 40.81020444636759f,
-73.025101341379f, -41.59239974371056f, 80.2652159014471f, 44.24866304347889f,
-1.1798393657040296f, -0.8287740195857741f, -97.84266070371591f, -55.95621901373946f,
Expand Down Expand Up @@ -1304,9 +1307,11 @@ float mag_calibration_matrices_f2[96 * NB_ELEMENTS_MAG_CAL_MATRIX * FLOATS_PER_C
0.9651497186512453f, -1.787300450569563f, -0.87357019079449f, 1.879542288660576f,
1.0265398804756543f, -1.9139122342335828f, -0.01485578296892735f, 0.030717851750089783f,
-1.1685430618862678f, 2.5255628789854456f, 0.6060341576715346f, -1.0915983891648562f,
1.2541788332284571f, -2.2440291104898913f, 0.6827773065421973f, -1.441707641982806f };
1.2541788332284571f, -2.2440291104898913f, 0.6827773065421973f, -1.441707641982806f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f };

float elec_calibration_matrices_f0[88 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
float elec_calibration_matrices_f0[89 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
-0.0f, -0.019133813445225776f, -0.029506268094695722f, -0.019133813445225776f,
-0.029506268094695722f, -0.009566906722612888f, -0.014753134047347861f, 0.0f, -0.0f,
-0.01736722044129592f, -0.030662155091513692f, -0.01736722044129592f, -0.030662155091513692f,
Expand Down Expand Up @@ -1460,9 +1465,9 @@ float elec_calibration_matrices_f0[88 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER
0.0f, 0.0f, 0.00823915440360118f, -0.05501882719847743f, 0.00823915440360118f,
-0.05501882719847743f, 0.00411957720180059f, -0.027509413599238714f, 0.0f, 0.0f,
0.016315199305425403f, -0.05569237347053891f, 0.016315199305425403f, -0.05569237347053891f,
0.008157599652712701f, -0.027846186735269455f };
0.008157599652712701f, -0.027846186735269455f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };

float elec_calibration_matrices_f1[104 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
float elec_calibration_matrices_f1[105 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
-0.0f, -0.03570951950188605f, -0.0006472820700566844f, -0.03570951950188605f,
-0.0006472820700566844f, -0.017854759750943024f, -0.0003236410350283422f, 0.0f, -0.0f,
-0.03560609926916825f, -0.002128046939693694f, -0.03560609926916825f, -0.002128046939693694f,
Expand Down Expand Up @@ -1644,9 +1649,9 @@ float elec_calibration_matrices_f1[104 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PE
0.0f, 0.0f, 0.02280609155287934f, 0.028999541995816218f, 0.02280609155287934f,
0.028999541995816218f, 0.01140304577643967f, 0.014499770997908109f, 0.0f, 0.0f,
0.020011145016875755f, 0.031377361040345365f, 0.020011145016875755f, 0.031377361040345365f,
0.010005572508437878f, 0.015688680520172683f };
0.010005572508437878f, 0.015688680520172683f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };

float elec_calibration_matrices_f2[96 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
float elec_calibration_matrices_f2[97 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER_COMPLEX] = { 0.0f,
0.0f, -0.022933284654492517f, 0.057070246326805116f, -0.022933284654492517f,
0.057070246326805116f, -0.011466642327246259f, 0.028535123163402558f, 0.0f, 0.0f,
-0.028053676802501943f, 0.048089177284147036f, -0.028053676802501943f, 0.048089177284147036f,
Expand Down Expand Up @@ -1814,4 +1819,5 @@ float elec_calibration_matrices_f2[96 * NB_ELEMENTS_ELEC_CAL_MATRIX * FLOATS_PER
0.01901843290186674f, 0.003014215948865848f, 0.0f, 0.0f, 0.03758656635032561f,
0.008753927283683119f, 0.03758656635032561f, 0.008753927283683119f, 0.018793283175162805f,
0.004376963641841559f, 0.0f, 0.0f, 0.03692206879783039f, 0.011548930117454729f,
0.03692206879783039f, 0.011548930117454729f, 0.018461034398915194f, 0.0057744650587273644f };
0.03692206879783039f, 0.011548930117454729f, 0.018461034398915194f, 0.0057744650587273644f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };

0 comments on commit d461c9b

Please sign in to comment.