@@ -3,49 +3,7 | |||||
3 | // version 1.1: 02/04/2014 |
|
3 | // version 1.1: 02/04/2014 | |
4 | // version 1.2: 30/04/2014 |
|
4 | // version 1.2: 30/04/2014 | |
5 | // version 1.3: 02/05/2014 |
|
5 | // version 1.3: 02/05/2014 | |
6 |
|
6 | // version 1.4: 16/05/2014 | ||
7 | #include "basic_parameters.h" |
|
7 | // version 1.5: 20/05/2014 | |
8 |
|
||||
9 | void init_k_f0( void ) |
|
|||
10 | { |
|
|||
11 | uint16_t i; // 16 bits unsigned |
|
|||
12 |
|
||||
13 | for(i=0; i<NB_BINS_COMPRESSED_MATRIX_f0; i++){ |
|
|||
14 | k_f0[i][K44_PE] = 1; |
|
|||
15 | k_f0[i][K55_PE] = 1; |
|
|||
16 | k_f0[i][K45_PE_RE] = 1; |
|
|||
17 | k_f0[i][K45_PE_IM] = 1; |
|
|||
18 |
|
8 | |||
19 | k_f0[i][K14_SX_RE] = 1; |
|
9 | // dans l'immédiat ne sert donc plus à rien ... | |
20 | k_f0[i][K14_SX_IM] = 1; |
|
|||
21 | k_f0[i][K15_SX_RE] = 1; |
|
|||
22 | k_f0[i][K15_SX_IM] = 1; |
|
|||
23 | k_f0[i][K24_SX_RE] = 1; |
|
|||
24 | k_f0[i][K24_SX_IM] = 1; |
|
|||
25 | k_f0[i][K25_SX_RE] = 1; |
|
|||
26 | k_f0[i][K25_SX_IM] = 1; |
|
|||
27 | k_f0[i][K34_SX_RE] = 1; |
|
|||
28 | k_f0[i][K34_SX_IM] = 1; |
|
|||
29 | k_f0[i][K35_SX_RE] = 1; |
|
|||
30 | k_f0[i][K35_SX_IM] = 1; |
|
|||
31 |
|
||||
32 | k_f0[i][K24_NY_RE] = 1; |
|
|||
33 | k_f0[i][K24_NY_IM] = 1; |
|
|||
34 | k_f0[i][K25_NY_RE] = 1; |
|
|||
35 | k_f0[i][K25_NY_IM] = 1; |
|
|||
36 | k_f0[i][K34_NY_RE] = 1; |
|
|||
37 | k_f0[i][K34_NY_IM] = 1; |
|
|||
38 | k_f0[i][K35_NY_RE] = 1; |
|
|||
39 | k_f0[i][K35_NY_IM] = 1; |
|
|||
40 |
|
||||
41 | k_f0[i][K24_NZ_RE] = 1; |
|
|||
42 | k_f0[i][K24_NZ_IM] = 1; |
|
|||
43 | k_f0[i][K25_NZ_RE] = 1; |
|
|||
44 | k_f0[i][K25_NZ_IM] = 1; |
|
|||
45 | k_f0[i][K34_NZ_RE] = 1; |
|
|||
46 | k_f0[i][K34_NZ_IM] = 1; |
|
|||
47 | k_f0[i][K35_NZ_RE] = 1; |
|
|||
48 | k_f0[i][K35_NZ_IM] = 1; |
|
|||
49 | } |
|
|||
50 | } |
|
|||
51 |
|
@@ -3,6 +3,8 | |||||
3 | // version 1.1: 02/04/2014 |
|
3 | // version 1.1: 02/04/2014 | |
4 | // version 1.2: 30/04/2014 |
|
4 | // version 1.2: 30/04/2014 | |
5 | // version 1.3: 02/05/2014 |
|
5 | // version 1.3: 02/05/2014 | |
|
6 | // version 1.4: 16/05/2014 | |||
|
7 | // version 1.5: 20/05/2014 | |||
6 |
|
8 | |||
7 | #ifndef BASIC_PARAMETERS_H_INCLUDED |
|
9 | #ifndef BASIC_PARAMETERS_H_INCLUDED | |
8 | #define BASIC_PARAMETERS_H_INCLUDED |
|
10 | #define BASIC_PARAMETERS_H_INCLUDED | |
@@ -13,16 +15,13 | |||||
13 |
|
15 | |||
14 | #include "basic_parameters_params.h" |
|
16 | #include "basic_parameters_params.h" | |
15 |
|
17 | |||
16 | float k_f0[NB_BINS_COMPRESSED_MATRIX_f0][32]; |
|
18 | static inline void BP1_set(float * compressed_spec_mat, float * k_coeff_intercalib, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1); | |
17 |
|
||||
18 | void init_k_f0( void ); |
|
|||
19 | static inline void BP1_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp1); |
|
|||
20 | static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2); |
|
19 | static inline void BP2_set(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * lfr_bp2); | |
21 |
|
20 | |||
22 | //*********************************** |
|
21 | //*********************************** | |
23 | // STATIC INLINE FUNCTION DEFINITIONS |
|
22 | // STATIC INLINE FUNCTION DEFINITIONS | |
24 |
|
23 | |||
25 | void BP1_set( float * compressed_spec_mat, uint8_t nb_bins_compressed_spec_mat, uint8_t * lfr_bp1 ){ |
|
24 | void BP1_set( float * compressed_spec_mat, float * k_coeff_intercalib, uint8_t nb_bins_compressed_spec_mat, uint8_t * lfr_bp1 ){ | |
26 | float PSDB; // 32-bit floating point |
|
25 | float PSDB; // 32-bit floating point | |
27 | float PSDE; |
|
26 | float PSDE; | |
28 | float tmp; |
|
27 | float tmp; | |
@@ -57,8 +56,6 void BP1_set( float * compressed_spec_ma | |||||
57 |
|
56 | |||
58 | alpha_M = 45 * (3.1415927/180); |
|
57 | alpha_M = 45 * (3.1415927/180); | |
59 |
|
58 | |||
60 | init_k_f0(); |
|
|||
61 |
|
||||
62 | #ifdef DEBUG_TCH |
|
59 | #ifdef DEBUG_TCH | |
63 | printf("BP1 : \n"); |
|
60 | printf("BP1 : \n"); | |
64 | printf("Number of bins: %d\n", nb_bins_compressed_spec_mat); |
|
61 | printf("Number of bins: %d\n", nb_bins_compressed_spec_mat); | |
@@ -131,10 +128,10 void BP1_set( float * compressed_spec_ma | |||||
131 | #endif |
|
128 | #endif | |
132 | //============================================== |
|
129 | //============================================== | |
133 | // BP1 PSDE == PA_LFR_SC_BP1_PE_F0 == 12 bits = 5 bits (exponent) + 7 bits (significand) |
|
130 | // BP1 PSDE == PA_LFR_SC_BP1_PE_F0 == 12 bits = 5 bits (exponent) + 7 bits (significand) | |
134 |
PSDE = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21] * k_ |
|
131 | PSDE = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K44_PE] // S44 | |
135 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_ |
|
132 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K55_PE] // S55 | |
136 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+22] * k_ |
|
133 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+22] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_RE] // S45 Re | |
137 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+23] * k_ |
|
134 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+23] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K45_PE_IM]; // S45 Im | |
138 |
|
135 | |||
139 | significand = frexpf(PSDE/2, &exponent); // 0.5 <= significand < 1 |
|
136 | significand = frexpf(PSDE/2, &exponent); // 0.5 <= significand < 1 | |
140 | // PSDE/2 = significand * 2^exponent |
|
137 | // PSDE/2 = significand * 2^exponent | |
@@ -254,32 +251,32 void BP1_set( float * compressed_spec_ma | |||||
254 | // BP1 X_SO-component of the Poynting flux == PA_LFR_SC_BP1_SX_F0 == 8 (+ 2) bits |
|
251 | // BP1 X_SO-component of the Poynting flux == PA_LFR_SC_BP1_SX_F0 == 8 (+ 2) bits | |
255 | // = 5 bits (exponent) + 3 bits (significand) |
|
252 | // = 5 bits (exponent) + 3 bits (significand) | |
256 | // + 1 sign bit + 1 argument bit (two sectors) |
|
253 | // + 1 sign bit + 1 argument bit (two sectors) | |
257 |
e_cross_b_re = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
254 | e_cross_b_re = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_RE] //S34 Re | |
258 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
255 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_RE] //S35 Re | |
259 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_ |
|
256 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_RE] //S14 Re | |
260 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_ |
|
257 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K15_SX_RE] //S15 Re | |
261 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
258 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_RE] //S24 Re | |
262 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
259 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_RE] //S25 Re | |
263 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
260 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_IM] //S34 Im | |
264 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
261 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_IM] //S35 Im | |
265 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_ |
|
262 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_IM] //S14 Im | |
266 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_ |
|
263 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K15_SX_IM] //S15 Im | |
267 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
264 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_IM] //S24 Im | |
268 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
265 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_IM]; //S25 Im | |
269 | // Im(S_ji) = -Im(S_ij) |
|
266 | // Im(S_ji) = -Im(S_ij) | |
270 | // k_ji = k_ij |
|
267 | // k_ji = k_ij | |
271 |
e_cross_b_im = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
268 | e_cross_b_im = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_IM] //S34 Re | |
272 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
269 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_IM] //S35 Re | |
273 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_ |
|
270 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_IM] //S14 Re | |
274 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_ |
|
271 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K15_SX_IM] //S15 Re | |
275 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
272 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_IM] //S24 Re | |
276 |
+ compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
273 | + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_IM] //S25 Re | |
277 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
274 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_SX_RE] //S34 Im | |
278 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
275 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_SX_RE] //S35 Im | |
279 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_ |
|
276 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K14_SX_RE] //S14 Im | |
280 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_ |
|
277 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K15_SX_RE] //S15 Im | |
281 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
278 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_SX_RE] //S24 Im | |
282 |
- compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
279 | - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_SX_RE]; //S25 Im | |
283 | #ifdef DEBUG_TCH |
|
280 | #ifdef DEBUG_TCH | |
284 | printf("ReaSX / 2 : %16.8e\n",e_cross_b_re/2); |
|
281 | printf("ReaSX / 2 : %16.8e\n",e_cross_b_re/2); | |
285 | #endif |
|
282 | #endif | |
@@ -358,40 +355,40 void BP1_set( float * compressed_spec_ma | |||||
358 | + sin(alpha_M)*sin(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16] // S33 Re |
|
355 | + sin(alpha_M)*sin(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16] // S33 Re | |
359 | - 2*sin(alpha_M)*cos(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+10]; // S23 Re |
|
356 | - 2*sin(alpha_M)*cos(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+10]; // S23 Re | |
360 |
|
357 | |||
361 |
n_cross_e_scal_b_re = ny * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
358 | n_cross_e_scal_b_re = ny * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NY_RE] //S24 Re | |
362 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
359 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NY_RE] //S25 Re | |
363 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
360 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NY_RE] //S34 Re | |
364 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
361 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NY_RE] //S35 Re | |
365 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
362 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NY_IM] //S24 Im | |
366 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
363 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NY_IM] //S25 Im | |
367 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
364 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NY_IM] //S34 Im | |
368 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
365 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NY_IM]) //S35 Im | |
369 |
+ nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
366 | + nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NZ_RE] //S24 Re | |
370 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
367 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NZ_RE] //S25 Re | |
371 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
368 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NZ_RE] //S34 Re | |
372 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
369 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NZ_RE] //S35 Re | |
373 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
370 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NZ_IM] //S24 Im | |
374 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
371 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NZ_IM] //S25 Im | |
375 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
372 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NZ_IM] //S34 Im | |
376 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
373 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NZ_IM]);//S35 Im | |
377 | // Im(S_ji) = -Im(S_ij) |
|
374 | // Im(S_ji) = -Im(S_ij) | |
378 | // k_ji = k_ij |
|
375 | // k_ji = k_ij | |
379 |
n_cross_e_scal_b_im = ny * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
376 | n_cross_e_scal_b_im = ny * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NY_IM] //S24 Re | |
380 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
377 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NY_IM] //S25 Re | |
381 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
378 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NY_IM] //S34 Re | |
382 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
379 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NY_IM] //S35 Re | |
383 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
380 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NY_RE] //S24 Im | |
384 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
381 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NY_RE] //S25 Im | |
385 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
382 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NY_RE] //S34 Im | |
386 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
383 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NY_RE]) //S35 Im | |
387 |
+ nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_ |
|
384 | + nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NZ_IM] //S24 Re | |
388 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_ |
|
385 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NZ_IM] //S25 Re | |
389 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_ |
|
386 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NZ_IM] //S34 Re | |
390 |
+compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_ |
|
387 | +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NZ_IM] //S35 Re | |
391 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_ |
|
388 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K24_NZ_RE] //S24 Im | |
392 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_ |
|
389 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K25_NZ_RE] //S25 Im | |
393 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_ |
|
390 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K34_NZ_RE] //S34 Im | |
394 |
-compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_ |
|
391 | -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K35_NZ_RE]);//S35 Im | |
395 | #ifdef DEBUG_TCH |
|
392 | #ifdef DEBUG_TCH | |
396 | printf("n_cross_e_scal_b_re : %16.8e\n",n_cross_e_scal_b_re); |
|
393 | printf("n_cross_e_scal_b_re : %16.8e\n",n_cross_e_scal_b_re); | |
397 | printf("n_cross_e_scal_b_im : %16.8e\n",n_cross_e_scal_b_im); |
|
394 | printf("n_cross_e_scal_b_im : %16.8e\n",n_cross_e_scal_b_im); |
@@ -1,3 +1,6 | |||||
|
1 | // version 1.4: 16/05/2014 | |||
|
2 | // version 1.5: 20/05/2014 | |||
|
3 | ||||
1 | #ifndef BASIC_PARAMETERS_PARAMS_H |
|
4 | #ifndef BASIC_PARAMETERS_PARAMS_H | |
2 | #define BASIC_PARAMETERS_PARAMS_H |
|
5 | #define BASIC_PARAMETERS_PARAMS_H | |
3 |
|
6 | |||
@@ -7,8 +10,11 | |||||
7 | #define NB_BYTES_BP1 9 |
|
10 | #define NB_BYTES_BP1 9 | |
8 | #define NB_BYTES_BP2 30 |
|
11 | #define NB_BYTES_BP2 30 | |
9 |
|
12 | |||
10 | //** |
|
13 | //******************************************** | |
11 | // K |
|
14 | // K-COEFFICIENTS FOR ONBOARD INTERCALIBRATION | |
|
15 | ||||
|
16 | #define NB_K_COEFF_PER_BIN 32 | |||
|
17 | ||||
12 | #define K44_PE 0 |
|
18 | #define K44_PE 0 | |
13 | #define K55_PE 1 |
|
19 | #define K55_PE 1 | |
14 | #define K45_PE_RE 2 |
|
20 | #define K45_PE_RE 2 |
@@ -3,8 +3,10 | |||||
3 | // version 1.1: 02/04/2014 |
|
3 | // version 1.1: 02/04/2014 | |
4 | // version 1.2: 30/04/2014 |
|
4 | // version 1.2: 30/04/2014 | |
5 | // version 1.3: 02/05/2014 |
|
5 | // version 1.3: 02/05/2014 | |
|
6 | // version 1.4: 16/05/2014 | |||
|
7 | // version 1.5: 20/05/2014 | |||
6 |
|
8 | |||
7 |
#include |
|
9 | #include "file_utilities.h" | |
8 |
|
10 | |||
9 | int lecture_file_sm(const char *fileName) |
|
11 | int lecture_file_sm(const char *fileName) | |
10 | { |
|
12 | { | |
@@ -63,3 +65,46 int lecture_file_sm(const char *fileName | |||||
63 | return 0; |
|
65 | return 0; | |
64 | } |
|
66 | } | |
65 |
|
67 | |||
|
68 | void init_k_coefficients_f0( void ) | |||
|
69 | { | |||
|
70 | uint16_t i; // 16 bits unsigned | |||
|
71 | ||||
|
72 | for(i=0; i<NB_BINS_COMPRESSED_MATRIX_f0; i++){ | |||
|
73 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K44_PE] = 1; | |||
|
74 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K55_PE] = 1; | |||
|
75 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K45_PE_RE] = 1; | |||
|
76 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K45_PE_IM] = 1; | |||
|
77 | ||||
|
78 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K14_SX_RE] = 1; | |||
|
79 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K14_SX_IM] = 1; | |||
|
80 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K15_SX_RE] = 1; | |||
|
81 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K15_SX_IM] = 1; | |||
|
82 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_SX_RE] = 1; | |||
|
83 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_SX_IM] = 1; | |||
|
84 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_SX_RE] = 1; | |||
|
85 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_SX_IM] = 1; | |||
|
86 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_SX_RE] = 1; | |||
|
87 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_SX_IM] = 1; | |||
|
88 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_SX_RE] = 1; | |||
|
89 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_SX_IM] = 1; | |||
|
90 | ||||
|
91 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_NY_RE] = 1; | |||
|
92 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_NY_IM] = 1; | |||
|
93 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_NY_RE] = 1; | |||
|
94 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_NY_IM] = 1; | |||
|
95 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_NY_RE] = 1; | |||
|
96 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_NY_IM] = 1; | |||
|
97 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_NY_RE] = 1; | |||
|
98 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_NY_IM] = 1; | |||
|
99 | ||||
|
100 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_NZ_RE] = 1; | |||
|
101 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K24_NZ_IM] = 1; | |||
|
102 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_NZ_RE] = 1; | |||
|
103 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K25_NZ_IM] = 1; | |||
|
104 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_NZ_RE] = 1; | |||
|
105 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K34_NZ_IM] = 1; | |||
|
106 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_NZ_RE] = 1; | |||
|
107 | k_coefficients_f0[i*NB_K_COEFF_PER_BIN+K35_NZ_IM] = 1; | |||
|
108 | } | |||
|
109 | } | |||
|
110 |
@@ -3,16 +3,25 | |||||
3 | // version 1.1: 02/04/2014 |
|
3 | // version 1.1: 02/04/2014 | |
4 | // version 1.2: 30/04/2014 |
|
4 | // version 1.2: 30/04/2014 | |
5 | // version 1.3: 02/05/2014 |
|
5 | // version 1.3: 02/05/2014 | |
|
6 | // version 1.4: 16/05/2014 | |||
|
7 | // version 1.5: 20/05/2014 | |||
6 |
|
8 | |||
7 | #ifndef FILE_UTILITIES_H |
|
9 | #ifndef FILE_UTILITIES_H | |
8 | #define FILE_UTILITIES_H |
|
10 | #define FILE_UTILITIES_H | |
9 |
|
11 | |||
10 | #include <stdio.h> |
|
12 | #include <stdio.h> | |
11 | #include <malloc.h> |
|
13 | #include <malloc.h> | |
12 | #include <basic_parameters.h> |
|
14 | ||
|
15 | #include "basic_parameters.h" | |||
13 |
|
16 | |||
14 |
|
|
17 | float compressed_spectral_matrix_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_VALUES_PER_SPECTRAL_MATRIX]; | |
|
18 | float k_coefficients_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_K_COEFF_PER_BIN]; | |||
|
19 | ||||
|
20 | unsigned char LFR_BP1_f0[NB_BINS_COMPRESSED_MATRIX_f0*NB_BYTES_BP1]; | |||
|
21 | unsigned char LFR_BP2_f0[NB_BINS_COMPRESSED_MATRIX_f0*NB_BYTES_BP2]; | |||
15 |
|
22 | |||
16 | int lecture_file_sm(const char *fileName); |
|
23 | int lecture_file_sm(const char *fileName); | |
17 |
|
24 | |||
|
25 | void init_k_coefficients_f0( void ); | |||
|
26 | ||||
18 | #endif // FILE_UTILITIES_H |
|
27 | #endif // FILE_UTILITIES_H |
@@ -3,15 +3,12 | |||||
3 | // version 1.1: 02/04/2014 |
|
3 | // version 1.1: 02/04/2014 | |
4 | // version 1.2: 30/04/2014 |
|
4 | // version 1.2: 30/04/2014 | |
5 | // version 1.3: 02/05/2014 |
|
5 | // version 1.3: 02/05/2014 | |
|
6 | // version 1.4: 16/05/2014 | |||
|
7 | // version 1.5: 20/05/2014 | |||
6 |
|
8 | |||
7 | #include <stdio.h> |
|
9 | #include <stdio.h> | |
8 | #include <basic_parameters.h> |
|
|||
9 | #include <file_utilities.h> |
|
|||
10 |
|
10 | |||
11 | float compressed_spectral_matrix_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_VALUES_PER_SPECTRAL_MATRIX]; |
|
11 | #include "file_utilities.h" | |
12 |
|
||||
13 | unsigned char LFR_BP1_f0[NB_BINS_COMPRESSED_MATRIX_f0*NB_BYTES_BP1]; |
|
|||
14 | unsigned char LFR_BP2_f0[NB_BINS_COMPRESSED_MATRIX_f0*NB_BYTES_BP2]; |
|
|||
15 |
|
12 | |||
16 | int main(void) |
|
13 | int main(void) | |
17 | { |
|
14 | { | |
@@ -30,12 +27,13 int main(void) | |||||
30 |
|
27 | |||
31 | //filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests2/sm_test2.dat"; |
|
28 | //filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests2/sm_test2.dat"; | |
32 | filename="sm_test2.dat"; |
|
29 | filename="sm_test2.dat"; | |
|
30 | lecture_file_sm(filename); | |||
33 |
|
31 | |||
34 | lecture_file_sm(filename); |
|
32 | init_k_coefficients_f0(); | |
35 |
|
33 | |||
36 | printf("\n"); |
|
34 | printf("\n"); | |
37 |
|
35 | |||
38 | BP1_set(compressed_spectral_matrix_f0, NB_BINS_COMPRESSED_MATRIX_f0, LFR_BP1_f0); |
|
36 | BP1_set(compressed_spectral_matrix_f0, k_coefficients_f0, NB_BINS_COMPRESSED_MATRIX_f0, LFR_BP1_f0); | |
39 |
|
37 | |||
40 | printf("\n"); |
|
38 | printf("\n"); | |
41 |
|
39 |
General Comments 0
You need to be logged in to leave comments.
Login now