##// END OF EJS Templates
version 2.3 : bug affectation initiale des octets 7 et 9 de BP1 corrigé
chust -
r21:3081d1f9bb20 TCH
parent child
Show More
@@ -0,0 +1,165
1 Hello World!
2
3 The multi-byte quantities are laid out in a LSB FIRST (little endian) fashion
4
5 Compressed_spectral_matrix_f0 :
6 Number of bins: 1
7 Number of values per spectral matrix: 25
8 Size of compressed_spectral_matrix_f0 : 100
9
10 Bin number: 0
11 Element 01 (S11) (00 & --) => Re: 4.00109575e+06 Im: 0.00000000e+00
12 Element 02 (S12) (01 & 02) => Re: -2.19891187e+03 Im: 1.73193325e+06
13 Element 03 (S13) (03 & 04) => Re: 1.88106079e+03 Im: -1.00001638e+06
14 Element 04 (S14) (05 & 06) => Re: 6.23724854e+02 Im: 2.00016860e+07
15 Element 05 (S15) (07 & 08) => Re: -3.46422920e+07 Im: -1.44333826e+03
16 Element 06 (S22) (09 & --) => Re: 7.54424812e+05 Im: 0.00000000e+00
17 Element 07 (S23) (10 & 11) => Re: -4.36785375e+05 Im: 2.34538879e+02
18 Element 08 (S24) (12 & 13) => Re: 8.65882200e+06 Im: -3.31611108e+03
19 Element 09 (S25) (14 & 15) => Re: 2.71719702e+03 Im: 1.50027590e+07
20 Element 10 (S33) (16 & --) => Re: 2.53229094e+05 Im: 0.00000000e+00
21 Element 11 (S34) (17 & 18) => Re: -4.99895450e+06 Im: 2.90329712e+03
22 Element 12 (S35) (19 & 20) => Re: -2.17048022e+03 Im: -8.66275100e+06
23 Element 13 (S44) (21 & --) => Re: 1.00002952e+08 Im: 0.00000000e+00
24 Element 14 (S45) (22 & 23) => Re: -2.94739111e+03 Im: 1.73206224e+08
25 Element 15 (S55) (24 & --) => Re: 3.00003392e+08 Im: 0.00000000e+00
26
27 F0 data: initialization of the intercalibration k-coefficients
28 F1 data: initialization of the intercalibration k-coefficients
29 F2 data: initialization of the intercalibration k-coefficients
30
31
32 BP1 :
33 Number of bins: 1
34 nbitexp : 6, expmax : 37, expmin : -26
35 nbitsig : 10, rangesig : 1023
36
37 Bin number: 0
38 PSDB : 5.00874950e+06
39 significand : 5.97089469e-01
40 exponent : 23
41 psd for PSDB significand : 199
42 exp for PSDB exponent : 49
43 pt_uint8[1] for PSDB exponent + significand: 196 or c4
44 pt_uint8[0] for PSDB significand: 199 or c7
45 lfr_bp1[i*NB_BYTES_BP1+2] : 196 or c4
46 lfr_bp1[i*NB_BYTES_BP1+3] : 199 or c7
47 PSDE : 2.26797168e+08
48 significand : 8.44885290e-01
49 exponent : 28
50 psd for PSDE significand : 706
51 exp for PSDE exponent : 54
52 pt_uint8[1] for PSDE exponent + significand: 218 or da
53 pt_uint8[0] for PSDE significand: 194 or c2
54 lfr_bp1[i*NB_BYTES_BP1+0] : 218 or da
55 lfr_bp1[i*NB_BYTES_BP1+1] : 194 or c2
56 NVEC_V0 : 1.17274933e-04
57 NVEC_V1 : 5.00031590e-01
58 NVEC_V2 : 8.66007149e-01
59 lfr_bp1[i*NB_BYTES_BP1+4] for NVEC_V0 : 128
60 lfr_bp1[i*NB_BYTES_BP1+5] for NVEC_V1 : 191
61 lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 : 0
62 ellipticity : 7.98565149e-01
63 tmp_uint8 for ellipticity : 12
64 lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity : 96
65 DOP : 9.96131897e-01
66 tmp_uint8 for DOP : 7
67 lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity + DOP : 103
68 ReaSX : -4.64141500e+06
69 |ReaSX| : 4.64141500e+06
70 significand : 5.53299785e-01
71 exponent : 23
72 tmp_uint8 for ReaSX exponent : 49
73 lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX sign + RealSX exponent : 177
74 lfr_bp1[i*NB_BYTES_BP1+8] for ReaSX significand : 27
75 ImaSX : -5.73210880e+07
76 |ImaSX| : 5.73210880e+07
77 ArgSX sign : 64
78 lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX & ArgSX signs + ReaSX exponent : 241
79 n_cross_e_scal_b_re : 9.66053400e+06
80 n_cross_e_scal_b_im : -2.58822950e+06
81 |VPHI| : 1.02704735e+01
82 significand : 6.41904593e-01
83 exponent : 4
84 tmp_uint8 for VPHI exponent : 30
85 lfr_bp1[i*NB_BYTES_BP1+9] for VPHI sign + VPHI exponent : 30
86 lfr_bp1[i*NB_BYTES_BP1+10] for VPHI significand : 72
87 |n_cross_e_scal_b_im| : 2.58822950e+06
88 |n_cross_e_scal_b_im|/bx_bx_star : 2.75164318e+00
89 ArgNEBX sign : 0
90 lfr_bp1[i*NB_BYTES_BP1+9] for VPHI & ArgNEBX signs + VPHI exponent : 30
91
92 BP2 :
93 Number of bins: 1
94 nbitexp : 6, expmax : 37, expmin : -26
95 nbitsig : 10, rangesig : 1023
96
97 Bin number: 0
98 lfr_bp2[i*NB_BYTES_BP2+10] for cross12_re ( -1.26564049e-03) : 127
99 lfr_bp2[i*NB_BYTES_BP2+20] for cross12_im ( 9.96858895e-01) : 255
100 lfr_bp2[i*NB_BYTES_BP2+11] for cross13_re ( 1.86877302e-03) : 128
101 lfr_bp2[i*NB_BYTES_BP2+21] for cross13_im ( -9.93483901e-01) : 001
102 lfr_bp2[i*NB_BYTES_BP2+12] for cross14_re ( 3.11815129e-05) : 128
103 lfr_bp2[i*NB_BYTES_BP2+22] for cross14_im ( 9.99932587e-01) : 255
104 lfr_bp2[i*NB_BYTES_BP2+13] for cross15_re ( -9.99894261e-01) : 000
105 lfr_bp2[i*NB_BYTES_BP2+23] for cross15_im ( -4.16596449e-05) : 127
106 lfr_bp2[i*NB_BYTES_BP2+14] for cross23_re ( -9.99317050e-01) : 000
107 lfr_bp2[i*NB_BYTES_BP2+24] for cross23_im ( 5.36599255e-04) : 128
108 lfr_bp2[i*NB_BYTES_BP2+15] for cross24_re ( 9.96883571e-01) : 255
109 lfr_bp2[i*NB_BYTES_BP2+25] for cross24_im ( -3.81781341e-04) : 127
110 lfr_bp2[i*NB_BYTES_BP2+16] for cross25_re ( 1.80613439e-04) : 128
111 lfr_bp2[i*NB_BYTES_BP2+26] for cross25_im ( 9.97240901e-01) : 255
112 lfr_bp2[i*NB_BYTES_BP2+17] for cross34_re ( -9.93381321e-01) : 001
113 lfr_bp2[i*NB_BYTES_BP2+27] for cross34_im ( 5.76936873e-04) : 128
114 lfr_bp2[i*NB_BYTES_BP2+18] for cross35_re ( -2.49020959e-04) : 127
115 lfr_bp2[i*NB_BYTES_BP2+28] for cross35_im ( -9.93884504e-01) : 001
116 lfr_bp2[i*NB_BYTES_BP2+19] for cross45_re ( -1.70164221e-05) : 127
117 lfr_bp2[i*NB_BYTES_BP2+29] for cross45_im ( 9.99986172e-01) : 255
118 S11 : 4.00109575e+06
119 significand : 9.53935564e-01
120 exponent : 22
121 autocor for S11 significand : 929
122 exp for S11 exponent : 48
123 pt_uint8[1] for S11 exponent + significand : 195 or c3
124 pt_uint8[0] for S11 significand : 161 or a1
125 lfr_bp2[i*NB_BYTES_BP2+0] : 195 or c3
126 lfr_bp2[i*NB_BYTES_BP2+1] : 161 or a1
127 S22 : 7.54424812e+05
128 significand : 7.19475567e-01
129 exponent : 20
130 autocor for S22 significand : 449
131 exp for S11 exponent : 46
132 pt_uint8[1] for S22 exponent + significand : 185 or b9
133 pt_uint8[0] for S22 significand : 193 or c1
134 lfr_bp2[i*NB_BYTES_BP2+2] : 185 or b9
135 lfr_bp2[i*NB_BYTES_BP2+3] : 193 or c1
136 S33 : 2.53229094e+05
137 significand : 9.65992332e-01
138 exponent : 18
139 autocor for S33 significand : 953
140 exp for S33 exponent : 44
141 pt_uint8[1] for S33 exponent + significand : 179 or b3
142 pt_uint8[0] for S33 significand : 185 or b9
143 lfr_bp2[i*NB_BYTES_BP2+4] : 179 or b3
144 lfr_bp2[i*NB_BYTES_BP2+5] : 185 or b9
145 S44 : 1.00002952e+08
146 significand : 7.45080054e-01
147 exponent : 27
148 autocor for S44 significand : 501
149 exp for S44 exponent : 53
150 pt_uint8[1] for S44 exponent + significand : 213 or d5
151 pt_uint8[0] for S44 significand : 245 or f5
152 lfr_bp2[i*NB_BYTES_BP2+6] : 213 or d5
153 lfr_bp2[i*NB_BYTES_BP2+7] : 245 or f5
154 S55 : 3.00003392e+08
155 significand : 5.58799863e-01
156 exponent : 29
157 autocor for S55 significand : 120
158 exp for S55 exponent : 55
159 pt_uint8[1] for S55 exponent + significand : 220 or dc
160 pt_uint8[0] for S55 significand : 120 or 78
161 lfr_bp2[i*NB_BYTES_BP2+8] : 220 or dc
162 lfr_bp2[i*NB_BYTES_BP2+9] : 120 or 78
163 Press <RETURN> to close this window...
164
165
@@ -12,6 +12,7
12 12 // version 2.0: 19/06/2015
13 13 // version 2.1: 22/06/2015 (modifs de Paul)
14 14 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
15 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
15 16
16 17 #include <stdio.h>
17 18 #include <stdint.h>
@@ -12,6 +12,7
12 12 // version 2.0: 19/06/2015
13 13 // version 2.1: 22/06/2015 (modifs de Paul)
14 14 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
15 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
15 16
16 17 #ifndef BASIC_PARAMETERS_H_INCLUDED
17 18 #define BASIC_PARAMETERS_H_INCLUDED
@@ -308,15 +309,16 void BP1_set( float * compressed_spec_ma
308 309 #endif
309 310 pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re
310 311 #ifdef LSB_FIRST_TCH
311 lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
312 // Record it at the 8th bit position (from the right to the left)
313 // of lfr_bp1[i*NB_BYTES_BP1+7]
312
313 lfr_bp1[i*NB_BYTES_BP1+7] = (uint8_t) (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
314 // Record it at the 8th bit position (from the right to the left)
315 // of lfr_bp1[i*NB_BYTES_BP1+7]
314 316 pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
315 317 #endif
316 318 #ifdef MSB_FIRST_TCH
317 lfr_bp1[i*NB_BYTES_BP1+7] = lfr_bp1[i*NB_BYTES_BP1+7] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
318 // Record it at the 8th bit position (from the right to the left)
319 // of lfr_bp1[i*NB_BYTES_BP1+7]
319 lfr_bp1[i*NB_BYTES_BP1+7] = (uint8_t) (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
320 // Record it at the 8th bit position (from the right to the left)
321 // of lfr_bp1[i*NB_BYTES_BP1+7]
320 322 pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX|
321 323 #endif
322 324 significand = frexpf(e_cross_b_re, &exponent); // 0.5 <= significand < 1
@@ -418,15 +420,15 void BP1_set( float * compressed_spec_ma
418 420 // vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re)
419 421 pt_uint8 = (uint8_t*) &n_cross_e_scal_b_re; // Affect an uint8_t pointer with the adress of n_cross_e_scal_b_re
420 422 #ifdef LSB_FIRST_TCH
421 lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
422 // Record it at the 8th bit position (from the right to the left)
423 // of lfr_bp1[i*NB_BYTES_BP1+9]
423 lfr_bp1[i*NB_BYTES_BP1+9] = (uint8_t) (pt_uint8[3] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 4th octet:PC convention)
424 // Record it at the 8th bit position (from the right to the left)
425 // of lfr_bp1[i*NB_BYTES_BP1+9]
424 426 pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make n_cross_e_scal_b_re be positive in any case: |n_cross_e_scal_b_re|
425 427 #endif
426 428 #ifdef MSB_FIRST_TCH
427 lfr_bp1[i*NB_BYTES_BP1+9] = lfr_bp1[i*NB_BYTES_BP1+9] | (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
428 // Record it at the 8th bit position (from the right to the left)
429 // of lfr_bp1[i*NB_BYTES_BP1+9]
429 lfr_bp1[i*NB_BYTES_BP1+9] = (uint8_t) (pt_uint8[0] & 0x80); // Extract its sign bit (32-bit float, sign bit in the 1th octet:SPARC convention)
430 // Record it at the 8th bit position (from the right to the left)
431 // of lfr_bp1[i*NB_BYTES_BP1+9]
430 432 pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make n_cross_e_scal_b_re be positive in any case: |n_cross_e_scal_b_re|
431 433 #endif
432 434 if (bx_bx_star != 0.) { // no division by 0.
@@ -8,6 +8,7
8 8 // version 2.0: 19/06/2015
9 9 // version 2.1: 22/06/2015 (modifs de Paul)
10 10 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
11 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
11 12
12 13 #ifndef BASIC_PARAMETERS_PARAMS_H
13 14 #define BASIC_PARAMETERS_PARAMS_H
@@ -6,7 +6,7
6 6 // version 2.0: 19/06/2015
7 7 // version 2.1: 22/06/2015 (modifs de Paul)
8 8 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
9
9 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
10 10
11 11 #ifndef BASIC_PARAMETERS_UTILITIES_H
12 12 #define BASIC_PARAMETERS_UTILITIES_H
@@ -12,7 +12,7
12 12 // version 2.0: 19/06/2015
13 13 // version 2.1: 22/06/2015 (modifs de Paul)
14 14 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
15
15 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
16 16
17 17 #include "basic_parameters_utilities.h"
18 18
@@ -12,7 +12,7
12 12 // version 2.0: 19/06/2015
13 13 // version 2.1: 22/06/2015 (modifs de Paul)
14 14 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
15
15 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
16 16
17 17 #ifndef FILE_UTILITIES_H
18 18 #define FILE_UTILITIES_H
@@ -12,6 +12,7
12 12 // version 2.0: 19/06/2015
13 13 // version 2.1: 22/06/2015 (modifs de Paul)
14 14 // version 2.2: 23/06/2015 (modifs de l'ordre de déclaration/définition de init_k_coefficients dans basic_parameters.c ... + maintien des declarations dans le .h)
15 // version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...)
15 16
16 17 #include <stdio.h>
17 18
@@ -35,6 +36,8 int main(void)
35 36 #endif
36 37
37 38 filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests7/sm_test2_R3.dat";
39 //filename="/home/chust/DD pc-p-chust/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests7/sm_test2_R3.dat";
40
38 41 lecture_file_sm(filename);
39 42
40 43 printf("\n");
General Comments 0
You need to be logged in to leave comments. Login now