diff --git a/basic_parameters.c b/basic_parameters.c --- a/basic_parameters.c +++ b/basic_parameters.c @@ -12,6 +12,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #include #include diff --git a/basic_parameters.h b/basic_parameters.h --- a/basic_parameters.h +++ b/basic_parameters.h @@ -12,6 +12,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #ifndef BASIC_PARAMETERS_H_INCLUDED #define BASIC_PARAMETERS_H_INCLUDED @@ -308,15 +309,16 @@ void BP1_set( float * compressed_spec_ma #endif pt_uint8 = (uint8_t*) &e_cross_b_re; // Affect an uint8_t pointer with the adress of e_cross_b_re #ifdef LSB_FIRST_TCH - 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) - // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+7] + + 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) + // Record it at the 8th bit position (from the right to the left) + // of lfr_bp1[i*NB_BYTES_BP1+7] pt_uint8[3] = (pt_uint8[3] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX| #endif #ifdef MSB_FIRST_TCH - 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) - // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+7] + 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) + // Record it at the 8th bit position (from the right to the left) + // of lfr_bp1[i*NB_BYTES_BP1+7] pt_uint8[0] = (pt_uint8[0] & 0x7f); // Make e_cross_b_re be positive in any case: |ReaSX| #endif significand = frexpf(e_cross_b_re, &exponent); // 0.5 <= significand < 1 @@ -418,15 +420,15 @@ void BP1_set( float * compressed_spec_ma // vphi = n_cross_e_scal_b_re / bx_bx_star => sign(VPHI) = sign(n_cross_e_scal_b_re) 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 #ifdef LSB_FIRST_TCH - 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) - // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+9] + 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) + // Record it at the 8th bit position (from the right to the left) + // of lfr_bp1[i*NB_BYTES_BP1+9] 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| #endif #ifdef MSB_FIRST_TCH - 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) - // Record it at the 8th bit position (from the right to the left) - // of lfr_bp1[i*NB_BYTES_BP1+9] + 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) + // Record it at the 8th bit position (from the right to the left) + // of lfr_bp1[i*NB_BYTES_BP1+9] 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| #endif if (bx_bx_star != 0.) { // no division by 0. diff --git a/basic_parameters_params.h b/basic_parameters_params.h --- a/basic_parameters_params.h +++ b/basic_parameters_params.h @@ -8,6 +8,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #ifndef BASIC_PARAMETERS_PARAMS_H #define BASIC_PARAMETERS_PARAMS_H diff --git a/basic_parameters_utilities.h b/basic_parameters_utilities.h --- a/basic_parameters_utilities.h +++ b/basic_parameters_utilities.h @@ -6,7 +6,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) - +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #ifndef BASIC_PARAMETERS_UTILITIES_H #define BASIC_PARAMETERS_UTILITIES_H diff --git a/file_utilities.c b/file_utilities.c --- a/file_utilities.c +++ b/file_utilities.c @@ -12,7 +12,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) - +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #include "basic_parameters_utilities.h" diff --git a/file_utilities.h b/file_utilities.h --- a/file_utilities.h +++ b/file_utilities.h @@ -12,7 +12,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) - +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #ifndef FILE_UTILITIES_H #define FILE_UTILITIES_H diff --git a/main.c b/main.c --- a/main.c +++ b/main.c @@ -12,6 +12,7 @@ // version 2.0: 19/06/2015 // version 2.1: 22/06/2015 (modifs de Paul) // 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) +// version 2.3: 01/07/2015 (affectation initiale des octets 7 et 9 dans les BP1 corrigée ...) #include @@ -35,6 +36,8 @@ int main(void) #endif filename="/WIN/Users/chust/DD CHUST/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests7/sm_test2_R3.dat"; + //filename="/home/chust/DD pc-p-chust/Missions/Solar Orbiter/LFR/Prog C/tests bp Paul/tests7/sm_test2_R3.dat"; + lecture_file_sm(filename); printf("\n"); diff --git a/tab_test2_R3_v2.3 b/tab_test2_R3_v2.3 new file mode 100755 --- /dev/null +++ b/tab_test2_R3_v2.3 @@ -0,0 +1,165 @@ +Hello World! + +The multi-byte quantities are laid out in a LSB FIRST (little endian) fashion + +Compressed_spectral_matrix_f0 : +Number of bins: 1 +Number of values per spectral matrix: 25 +Size of compressed_spectral_matrix_f0 : 100 + +Bin number: 0 +Element 01 (S11) (00 & --) => Re: 4.00109575e+06 Im: 0.00000000e+00 +Element 02 (S12) (01 & 02) => Re: -2.19891187e+03 Im: 1.73193325e+06 +Element 03 (S13) (03 & 04) => Re: 1.88106079e+03 Im: -1.00001638e+06 +Element 04 (S14) (05 & 06) => Re: 6.23724854e+02 Im: 2.00016860e+07 +Element 05 (S15) (07 & 08) => Re: -3.46422920e+07 Im: -1.44333826e+03 +Element 06 (S22) (09 & --) => Re: 7.54424812e+05 Im: 0.00000000e+00 +Element 07 (S23) (10 & 11) => Re: -4.36785375e+05 Im: 2.34538879e+02 +Element 08 (S24) (12 & 13) => Re: 8.65882200e+06 Im: -3.31611108e+03 +Element 09 (S25) (14 & 15) => Re: 2.71719702e+03 Im: 1.50027590e+07 +Element 10 (S33) (16 & --) => Re: 2.53229094e+05 Im: 0.00000000e+00 +Element 11 (S34) (17 & 18) => Re: -4.99895450e+06 Im: 2.90329712e+03 +Element 12 (S35) (19 & 20) => Re: -2.17048022e+03 Im: -8.66275100e+06 +Element 13 (S44) (21 & --) => Re: 1.00002952e+08 Im: 0.00000000e+00 +Element 14 (S45) (22 & 23) => Re: -2.94739111e+03 Im: 1.73206224e+08 +Element 15 (S55) (24 & --) => Re: 3.00003392e+08 Im: 0.00000000e+00 + +F0 data: initialization of the intercalibration k-coefficients +F1 data: initialization of the intercalibration k-coefficients +F2 data: initialization of the intercalibration k-coefficients + + +BP1 : +Number of bins: 1 +nbitexp : 6, expmax : 37, expmin : -26 +nbitsig : 10, rangesig : 1023 + +Bin number: 0 +PSDB : 5.00874950e+06 +significand : 5.97089469e-01 +exponent : 23 +psd for PSDB significand : 199 +exp for PSDB exponent : 49 +pt_uint8[1] for PSDB exponent + significand: 196 or c4 +pt_uint8[0] for PSDB significand: 199 or c7 +lfr_bp1[i*NB_BYTES_BP1+2] : 196 or c4 +lfr_bp1[i*NB_BYTES_BP1+3] : 199 or c7 +PSDE : 2.26797168e+08 +significand : 8.44885290e-01 +exponent : 28 +psd for PSDE significand : 706 +exp for PSDE exponent : 54 +pt_uint8[1] for PSDE exponent + significand: 218 or da +pt_uint8[0] for PSDE significand: 194 or c2 +lfr_bp1[i*NB_BYTES_BP1+0] : 218 or da +lfr_bp1[i*NB_BYTES_BP1+1] : 194 or c2 +NVEC_V0 : 1.17274933e-04 +NVEC_V1 : 5.00031590e-01 +NVEC_V2 : 8.66007149e-01 +lfr_bp1[i*NB_BYTES_BP1+4] for NVEC_V0 : 128 +lfr_bp1[i*NB_BYTES_BP1+5] for NVEC_V1 : 191 +lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 : 0 +ellipticity : 7.98565149e-01 +tmp_uint8 for ellipticity : 12 +lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity : 96 +DOP : 9.96131897e-01 +tmp_uint8 for DOP : 7 +lfr_bp1[i*NB_BYTES_BP1+6] for NVEC_V2 + ellipticity + DOP : 103 +ReaSX : -4.64141500e+06 +|ReaSX| : 4.64141500e+06 +significand : 5.53299785e-01 +exponent : 23 +tmp_uint8 for ReaSX exponent : 49 +lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX sign + RealSX exponent : 177 +lfr_bp1[i*NB_BYTES_BP1+8] for ReaSX significand : 27 +ImaSX : -5.73210880e+07 +|ImaSX| : 5.73210880e+07 +ArgSX sign : 64 +lfr_bp1[i*NB_BYTES_BP1+7] for ReaSX & ArgSX signs + ReaSX exponent : 241 +n_cross_e_scal_b_re : 9.66053400e+06 +n_cross_e_scal_b_im : -2.58822950e+06 +|VPHI| : 1.02704735e+01 +significand : 6.41904593e-01 +exponent : 4 +tmp_uint8 for VPHI exponent : 30 +lfr_bp1[i*NB_BYTES_BP1+9] for VPHI sign + VPHI exponent : 30 +lfr_bp1[i*NB_BYTES_BP1+10] for VPHI significand : 72 +|n_cross_e_scal_b_im| : 2.58822950e+06 +|n_cross_e_scal_b_im|/bx_bx_star : 2.75164318e+00 +ArgNEBX sign : 0 +lfr_bp1[i*NB_BYTES_BP1+9] for VPHI & ArgNEBX signs + VPHI exponent : 30 + +BP2 : +Number of bins: 1 +nbitexp : 6, expmax : 37, expmin : -26 +nbitsig : 10, rangesig : 1023 + +Bin number: 0 +lfr_bp2[i*NB_BYTES_BP2+10] for cross12_re ( -1.26564049e-03) : 127 +lfr_bp2[i*NB_BYTES_BP2+20] for cross12_im ( 9.96858895e-01) : 255 +lfr_bp2[i*NB_BYTES_BP2+11] for cross13_re ( 1.86877302e-03) : 128 +lfr_bp2[i*NB_BYTES_BP2+21] for cross13_im ( -9.93483901e-01) : 001 +lfr_bp2[i*NB_BYTES_BP2+12] for cross14_re ( 3.11815129e-05) : 128 +lfr_bp2[i*NB_BYTES_BP2+22] for cross14_im ( 9.99932587e-01) : 255 +lfr_bp2[i*NB_BYTES_BP2+13] for cross15_re ( -9.99894261e-01) : 000 +lfr_bp2[i*NB_BYTES_BP2+23] for cross15_im ( -4.16596449e-05) : 127 +lfr_bp2[i*NB_BYTES_BP2+14] for cross23_re ( -9.99317050e-01) : 000 +lfr_bp2[i*NB_BYTES_BP2+24] for cross23_im ( 5.36599255e-04) : 128 +lfr_bp2[i*NB_BYTES_BP2+15] for cross24_re ( 9.96883571e-01) : 255 +lfr_bp2[i*NB_BYTES_BP2+25] for cross24_im ( -3.81781341e-04) : 127 +lfr_bp2[i*NB_BYTES_BP2+16] for cross25_re ( 1.80613439e-04) : 128 +lfr_bp2[i*NB_BYTES_BP2+26] for cross25_im ( 9.97240901e-01) : 255 +lfr_bp2[i*NB_BYTES_BP2+17] for cross34_re ( -9.93381321e-01) : 001 +lfr_bp2[i*NB_BYTES_BP2+27] for cross34_im ( 5.76936873e-04) : 128 +lfr_bp2[i*NB_BYTES_BP2+18] for cross35_re ( -2.49020959e-04) : 127 +lfr_bp2[i*NB_BYTES_BP2+28] for cross35_im ( -9.93884504e-01) : 001 +lfr_bp2[i*NB_BYTES_BP2+19] for cross45_re ( -1.70164221e-05) : 127 +lfr_bp2[i*NB_BYTES_BP2+29] for cross45_im ( 9.99986172e-01) : 255 +S11 : 4.00109575e+06 +significand : 9.53935564e-01 +exponent : 22 +autocor for S11 significand : 929 +exp for S11 exponent : 48 +pt_uint8[1] for S11 exponent + significand : 195 or c3 +pt_uint8[0] for S11 significand : 161 or a1 +lfr_bp2[i*NB_BYTES_BP2+0] : 195 or c3 +lfr_bp2[i*NB_BYTES_BP2+1] : 161 or a1 +S22 : 7.54424812e+05 +significand : 7.19475567e-01 +exponent : 20 +autocor for S22 significand : 449 +exp for S11 exponent : 46 +pt_uint8[1] for S22 exponent + significand : 185 or b9 +pt_uint8[0] for S22 significand : 193 or c1 +lfr_bp2[i*NB_BYTES_BP2+2] : 185 or b9 +lfr_bp2[i*NB_BYTES_BP2+3] : 193 or c1 +S33 : 2.53229094e+05 +significand : 9.65992332e-01 +exponent : 18 +autocor for S33 significand : 953 +exp for S33 exponent : 44 +pt_uint8[1] for S33 exponent + significand : 179 or b3 +pt_uint8[0] for S33 significand : 185 or b9 +lfr_bp2[i*NB_BYTES_BP2+4] : 179 or b3 +lfr_bp2[i*NB_BYTES_BP2+5] : 185 or b9 +S44 : 1.00002952e+08 +significand : 7.45080054e-01 +exponent : 27 +autocor for S44 significand : 501 +exp for S44 exponent : 53 +pt_uint8[1] for S44 exponent + significand : 213 or d5 +pt_uint8[0] for S44 significand : 245 or f5 +lfr_bp2[i*NB_BYTES_BP2+6] : 213 or d5 +lfr_bp2[i*NB_BYTES_BP2+7] : 245 or f5 +S55 : 3.00003392e+08 +significand : 5.58799863e-01 +exponent : 29 +autocor for S55 significand : 120 +exp for S55 exponent : 55 +pt_uint8[1] for S55 exponent + significand : 220 or dc +pt_uint8[0] for S55 significand : 120 or 78 +lfr_bp2[i*NB_BYTES_BP2+8] : 220 or dc +lfr_bp2[i*NB_BYTES_BP2+9] : 120 or 78 +Press to close this window... + +