##// END OF EJS Templates
setFBinMask corrected...
paul -
r313:972ae9f0eb8f R3_plus draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 94f0f2fccbcb8030d9437ffbb69ee0eefaaea188 header/lfr_common_headers
2 57edc38eadba4601cf0b1e2fa1eeab85082e9f41 header/lfr_common_headers
@@ -104,3 +104,5 add_definitions(-DSW_VERSION_N3=${SW_VER
104 add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4})
104 add_definitions(-DSW_VERSION_N4=${SW_VERSION_N4})
105
105
106 add_executable(FSW ${SOURCES})
106 add_executable(FSW ${SOURCES})
107 add_test_cppcheck(FSW STYLE UNUSED_FUNCTIONS POSSIBLE_ERROR MISSING_INCLUDE)
108
@@ -679,7 +679,7 int getFBinMask( int index, unsigned cha
679 int fbin;
679 int fbin;
680 unsigned char *sy_lfr_fbins_fx_word1;
680 unsigned char *sy_lfr_fbins_fx_word1;
681
681
682 sy_lfr_fbins_fx_word1 = parameter_dump_packet.sy_lfr_fbins_f0_word1;
682 sy_lfr_fbins_fx_word1 = parameter_dump_packet.sy_lfr_fbins.fx.f0_word1;
683
683
684 switch(channel)
684 switch(channel)
685 {
685 {
@@ -1017,40 +1017,31 void setFBinMask( unsigned char *fbins_m
1017 closestBin = binAbove;
1017 closestBin = binAbove;
1018 }
1018 }
1019
1019
1020 // compute the fi interval [fi - Delta_f * 0.285, fi + Delta_f * 0.285]
1020 // compute the fi interval [fi - deltaFreq * 0.285, fi + deltaFreq * 0.285]
1021 fi = closestBin * deltaFreq;
1021 fi = closestBin * deltaFreq;
1022
1023 fi_min = fi - (deltaFreq * 0.285);
1022 fi_min = fi - (deltaFreq * 0.285);
1024 if ( fi_min < 0 )
1023 fi_MAX = fi + (deltaFreq * 0.285);
1025 {
1026 fi_min = 0;
1027 }
1028 else if ( fi_min > (deltaFreq * 127) )
1029 {
1030 fi_min = -1;
1031 }
1032
1024
1033 fi_MAX = fi + (deltaFreq * 0.285);
1025 //**************************************************************************************
1034 if ( fi_MAX > (deltaFreq*127) )
1026 // be careful here, one shall take into account that the bin 0 IS DROPPED in the spectra
1035 {
1027 // thus, the index 0 in a mask corresponds to the bin 1 of the spectrum
1036 fi_MAX = -1;
1028 //**************************************************************************************
1037 }
1038
1029
1039 // 1. IF [ f_RW_min, f_RW_MAX] is included in [ fi_min; fi_MAX ]
1030 // 1. IF [ f_RW_min, f_RW_MAX] is included in [ fi_min; fi_MAX ]
1040 // => remove f_(i), f_(i-1) and f_(i+1)
1031 // => remove f_(i), f_(i-1) and f_(i+1)
1041 if ( ( f_RW_min > fi_min ) && ( f_RW_MAX < fi_MAX ) )
1032 if ( ( f_RW_min > fi_min ) && ( f_RW_MAX < fi_MAX ) )
1042 {
1033 {
1043 binToRemove[0] = closestBin - 1;
1034 binToRemove[0] = (closestBin - 1) - 1;
1044 binToRemove[1] = closestBin;
1035 binToRemove[1] = (closestBin) - 1;
1045 binToRemove[2] = closestBin + 1;
1036 binToRemove[2] = (closestBin + 1) - 1;
1046 }
1037 }
1047 // 2. ELSE
1038 // 2. ELSE
1048 // => remove the two f_(i) which are around f_RW
1039 // => remove the two f_(i) which are around f_RW
1049 else
1040 else
1050 {
1041 {
1051 binToRemove[0] = binBelow;
1042 binToRemove[0] = (binBelow) - 1;
1052 binToRemove[1] = binAbove;
1043 binToRemove[1] = (binAbove) - 1;
1053 binToRemove[2] = -1;
1044 binToRemove[2] = (-1);
1054 }
1045 }
1055
1046
1056 for (k = 0; k < 3; k++)
1047 for (k = 0; k < 3; k++)
@@ -1083,15 +1074,15 void build_sy_lfr_rw_mask( unsigned int
1083 switch (channel)
1074 switch (channel)
1084 {
1075 {
1085 case 0:
1076 case 0:
1086 maskPtr = parameter_dump_packet.sy_lfr_rw_mask_f0_word1;
1077 maskPtr = parameter_dump_packet.sy_lfr_rw_mask.fx.f0_word1;
1087 deltaF = 96.;
1078 deltaF = 96.;
1088 break;
1079 break;
1089 case 1:
1080 case 1:
1090 maskPtr = parameter_dump_packet.sy_lfr_rw_mask_f1_word1;
1081 maskPtr = parameter_dump_packet.sy_lfr_rw_mask.fx.f1_word1;
1091 deltaF = 16.;
1082 deltaF = 16.;
1092 break;
1083 break;
1093 case 2:
1084 case 2:
1094 maskPtr = parameter_dump_packet.sy_lfr_rw_mask_f2_word1;
1085 maskPtr = parameter_dump_packet.sy_lfr_rw_mask.fx.f2_word1;
1095 deltaF = 1.;
1086 deltaF = 1.;
1096 break;
1087 break;
1097 default:
1088 default:
@@ -1157,12 +1148,12 void merge_fbins_masks( void )
1157 unsigned char *rw_mask_f1;
1148 unsigned char *rw_mask_f1;
1158 unsigned char *rw_mask_f2;
1149 unsigned char *rw_mask_f2;
1159
1150
1160 fbins_f0 = parameter_dump_packet.sy_lfr_fbins_f0_word1;
1151 fbins_f0 = parameter_dump_packet.sy_lfr_fbins.fx.f0_word1;
1161 fbins_f1 = parameter_dump_packet.sy_lfr_fbins_f1_word1;
1152 fbins_f1 = parameter_dump_packet.sy_lfr_fbins.fx.f1_word1;
1162 fbins_f2 = parameter_dump_packet.sy_lfr_fbins_f2_word1;
1153 fbins_f2 = parameter_dump_packet.sy_lfr_fbins.fx.f2_word1;
1163 rw_mask_f0 = parameter_dump_packet.sy_lfr_rw_mask_f0_word1;
1154 rw_mask_f0 = parameter_dump_packet.sy_lfr_rw_mask.fx.f0_word1;
1164 rw_mask_f1 = parameter_dump_packet.sy_lfr_rw_mask_f1_word1;
1155 rw_mask_f1 = parameter_dump_packet.sy_lfr_rw_mask.fx.f1_word1;
1165 rw_mask_f2 = parameter_dump_packet.sy_lfr_rw_mask_f2_word1;
1156 rw_mask_f2 = parameter_dump_packet.sy_lfr_rw_mask.fx.f2_word1;
1166
1157
1167 for( k=0; k < 16; k++ )
1158 for( k=0; k < 16; k++ )
1168 {
1159 {
@@ -1184,7 +1175,7 int set_sy_lfr_fbins( ccsdsTelecommandPa
1184
1175
1185 status = LFR_SUCCESSFUL;
1176 status = LFR_SUCCESSFUL;
1186
1177
1187 fbins_mask_dump = parameter_dump_packet.sy_lfr_fbins_f0_word1;
1178 fbins_mask_dump = parameter_dump_packet.sy_lfr_fbins.raw;
1188 fbins_mask_TC = TC->dataAndCRC;
1179 fbins_mask_TC = TC->dataAndCRC;
1189
1180
1190 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
1181 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
@@ -1465,7 +1456,7 void init_parameter_dump( void )
1465 // FBINS MASKS
1456 // FBINS MASKS
1466 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
1457 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
1467 {
1458 {
1468 parameter_dump_packet.sy_lfr_fbins_f0_word1[k] = 0xff;
1459 parameter_dump_packet.sy_lfr_fbins.raw[k] = 0xff;
1469 }
1460 }
1470
1461
1471 // PAS FILTER PARAMETERS
1462 // PAS FILTER PARAMETERS
@@ -1480,7 +1471,7 void init_parameter_dump( void )
1480 // LFR_RW_MASK
1471 // LFR_RW_MASK
1481 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
1472 for (k=0; k < NB_FBINS_MASKS * NB_BYTES_PER_FBINS_MASK; k++)
1482 {
1473 {
1483 parameter_dump_packet.sy_lfr_rw_mask_f0_word1[k] = 0xff;
1474 parameter_dump_packet.sy_lfr_rw_mask.raw[k] = 0xff;
1484 }
1475 }
1485 }
1476 }
1486
1477
General Comments 0
You need to be logged in to leave comments. Login now