##// END OF EJS Templates
version 1.5 qui passe le tableau des k-coefficients d'intercalibration en paramètre de la fonction BP1_set....
chust -
r12:bbf448e745b1 TCH
parent child
Show More
@@ -3,49 +3,7
3 3 // version 1.1: 02/04/2014
4 4 // version 1.2: 30/04/2014
5 5 // version 1.3: 02/05/2014
6
7 #include "basic_parameters.h"
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;
6 // version 1.4: 16/05/2014
7 // version 1.5: 20/05/2014
18 8
19 k_f0[i][K14_SX_RE] = 1;
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
9 // dans l'immédiat ne sert donc plus à rien ...
@@ -3,6 +3,8
3 3 // version 1.1: 02/04/2014
4 4 // version 1.2: 30/04/2014
5 5 // version 1.3: 02/05/2014
6 // version 1.4: 16/05/2014
7 // version 1.5: 20/05/2014
6 8
7 9 #ifndef BASIC_PARAMETERS_H_INCLUDED
8 10 #define BASIC_PARAMETERS_H_INCLUDED
@@ -13,16 +15,13
13 15
14 16 #include "basic_parameters_params.h"
15 17
16 float k_f0[NB_BINS_COMPRESSED_MATRIX_f0][32];
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);
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);
20 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 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 25 float PSDB; // 32-bit floating point
27 26 float PSDE;
28 27 float tmp;
@@ -57,8 +56,6 void BP1_set( float * compressed_spec_ma
57 56
58 57 alpha_M = 45 * (3.1415927/180);
59 58
60 init_k_f0();
61
62 59 #ifdef DEBUG_TCH
63 60 printf("BP1 : \n");
64 61 printf("Number of bins: %d\n", nb_bins_compressed_spec_mat);
@@ -131,10 +128,10 void BP1_set( float * compressed_spec_ma
131 128 #endif
132 129 //==============================================
133 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_f0[i][K44_PE] // S44
135 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_f0[i][K55_PE] // S55
136 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+22] * k_f0[i][K45_PE_RE] // S45 Re
137 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+23] * k_f0[i][K45_PE_IM]; // S45 Im
131 PSDE = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+21] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K44_PE] // S44
132 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+24] * k_coeff_intercalib[i*NB_K_COEFF_PER_BIN+K55_PE] // S55
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
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 136 significand = frexpf(PSDE/2, &exponent); // 0.5 <= significand < 1
140 137 // PSDE/2 = significand * 2^exponent
@@ -254,32 +251,32 void BP1_set( float * compressed_spec_ma
254 251 // BP1 X_SO-component of the Poynting flux == PA_LFR_SC_BP1_SX_F0 == 8 (+ 2) bits
255 252 // = 5 bits (exponent) + 3 bits (significand)
256 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_f0[i][K34_SX_RE] //S34 Re
258 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_SX_RE] //S35 Re
259 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_f0[i][K14_SX_RE] //S14 Re
260 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_f0[i][K15_SX_RE] //S15 Re
261 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_f0[i][K24_SX_RE] //S24 Re
262 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_SX_RE] //S25 Re
263 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_SX_IM] //S34 Im
264 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_SX_IM] //S35 Im
265 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_f0[i][K14_SX_IM] //S14 Im
266 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_f0[i][K15_SX_IM] //S15 Im
267 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_SX_IM] //S24 Im
268 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_SX_IM]; //S25 Im
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
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
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
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
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
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
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
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
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
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
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
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 266 // Im(S_ji) = -Im(S_ij)
270 267 // k_ji = k_ij
271 e_cross_b_im = compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_f0[i][K34_SX_IM] //S34 Re
272 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_SX_IM] //S35 Re
273 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+5] *k_f0[i][K14_SX_IM] //S14 Re
274 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+7] *k_f0[i][K15_SX_IM] //S15 Re
275 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_f0[i][K24_SX_IM] //S24 Re
276 + compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_SX_IM] //S25 Re
277 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_SX_RE] //S34 Im
278 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_SX_RE] //S35 Im
279 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+6] *k_f0[i][K14_SX_RE] //S14 Im
280 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+8] *k_f0[i][K15_SX_RE] //S15 Im
281 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_SX_RE] //S24 Im
282 - compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_SX_RE]; //S25 Im
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
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
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
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
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
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
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
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
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
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
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
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 280 #ifdef DEBUG_TCH
284 281 printf("ReaSX / 2 : %16.8e\n",e_cross_b_re/2);
285 282 #endif
@@ -358,40 +355,40 void BP1_set( float * compressed_spec_ma
358 355 + sin(alpha_M)*sin(alpha_M)*compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+16] // S33 Re
359 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_f0[i][K24_NY_RE] //S24 Re
362 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_NY_RE] //S25 Re
363 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_f0[i][K34_NY_RE] //S34 Re
364 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_NY_RE] //S35 Re
365 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_NY_IM] //S24 Im
366 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_NY_IM] //S25 Im
367 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_NY_IM] //S34 Im
368 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_NY_IM]) //S35 Im
369 + nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_f0[i][K24_NZ_RE] //S24 Re
370 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_NZ_RE] //S25 Re
371 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_f0[i][K34_NZ_RE] //S34 Re
372 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_NZ_RE] //S35 Re
373 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_NZ_IM] //S24 Im
374 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_NZ_IM] //S25 Im
375 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_NZ_IM] //S34 Im
376 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_NZ_IM]);//S35 Im
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 374 // Im(S_ji) = -Im(S_ij)
378 375 // k_ji = k_ij
379 n_cross_e_scal_b_im = ny * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_f0[i][K24_NY_IM] //S24 Re
380 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_NY_IM] //S25 Re
381 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_f0[i][K34_NY_IM] //S34 Re
382 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_NY_IM] //S35 Re
383 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_NY_RE] //S24 Im
384 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_NY_RE] //S25 Im
385 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_NY_RE] //S34 Im
386 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_NY_RE]) //S35 Im
387 + nz * (compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+12]*k_f0[i][K24_NZ_IM] //S24 Re
388 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+14]*k_f0[i][K25_NZ_IM] //S25 Re
389 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+17]*k_f0[i][K34_NZ_IM] //S34 Re
390 +compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+19]*k_f0[i][K35_NZ_IM] //S35 Re
391 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+13]*k_f0[i][K24_NZ_RE] //S24 Im
392 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+15]*k_f0[i][K25_NZ_RE] //S25 Im
393 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+18]*k_f0[i][K34_NZ_RE] //S34 Im
394 -compressed_spec_mat[i*NB_VALUES_PER_SPECTRAL_MATRIX+20]*k_f0[i][K35_NZ_RE]);//S35 Im
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 392 #ifdef DEBUG_TCH
396 393 printf("n_cross_e_scal_b_re : %16.8e\n",n_cross_e_scal_b_re);
397 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 4 #ifndef BASIC_PARAMETERS_PARAMS_H
2 5 #define BASIC_PARAMETERS_PARAMS_H
3 6
@@ -7,8 +10,11
7 10 #define NB_BYTES_BP1 9
8 11 #define NB_BYTES_BP2 30
9 12
10 //**
11 // K
13 //********************************************
14 // K-COEFFICIENTS FOR ONBOARD INTERCALIBRATION
15
16 #define NB_K_COEFF_PER_BIN 32
17
12 18 #define K44_PE 0
13 19 #define K55_PE 1
14 20 #define K45_PE_RE 2
@@ -3,8 +3,10
3 3 // version 1.1: 02/04/2014
4 4 // version 1.2: 30/04/2014
5 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 <file_utilities.h>
9 #include "file_utilities.h"
8 10
9 11 int lecture_file_sm(const char *fileName)
10 12 {
@@ -63,3 +65,46 int lecture_file_sm(const char *fileName
63 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 3 // version 1.1: 02/04/2014
4 4 // version 1.2: 30/04/2014
5 5 // version 1.3: 02/05/2014
6 // version 1.4: 16/05/2014
7 // version 1.5: 20/05/2014
6 8
7 9 #ifndef FILE_UTILITIES_H
8 10 #define FILE_UTILITIES_H
9 11
10 12 #include <stdio.h>
11 13 #include <malloc.h>
12 #include <basic_parameters.h>
14
15 #include "basic_parameters.h"
13 16
14 extern float compressed_spectral_matrix_f0[NB_BINS_COMPRESSED_MATRIX_f0 * NB_VALUES_PER_SPECTRAL_MATRIX];
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 23 int lecture_file_sm(const char *fileName);
17 24
25 void init_k_coefficients_f0( void );
26
18 27 #endif // FILE_UTILITIES_H
@@ -3,15 +3,12
3 3 // version 1.1: 02/04/2014
4 4 // version 1.2: 30/04/2014
5 5 // version 1.3: 02/05/2014
6 // version 1.4: 16/05/2014
7 // version 1.5: 20/05/2014
6 8
7 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];
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];
11 #include "file_utilities.h"
15 12
16 13 int main(void)
17 14 {
@@ -30,12 +27,13 int main(void)
30 27
31 28 //filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests2/sm_test2.dat";
32 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 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 38 printf("\n");
41 39
General Comments 0
You need to be logged in to leave comments. Login now