| 38 | } |
| 39 | |
| 40 | void HinodeInstrumentsDecoderModule::process() |
| 41 | { |
| 42 | filesize = getFilesize(d_input_file); |
| 43 | std::ifstream data_in(d_input_file, std::ios::binary); |
| 44 | |
| 45 | logger->info("Using input frames " + d_input_file); |
| 46 | |
| 47 | time_t lastTime = 0; |
| 48 | uint8_t cadu[1024]; |
| 49 | |
| 50 | // Demuxers |
| 51 | ccsds::ccsds_aos::Demuxer demuxer_vcid4(880, true, 0); |
| 52 | |
| 53 | reedsolomon::ReedSolomon rs_check(reedsolomon::RS223); |
| 54 | |
| 55 | std::string flt_obs1_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/FLT/OBS_1"; |
| 56 | if (!std::filesystem::exists(flt_obs1_directory)) |
| 57 | std::filesystem::create_directories(flt_obs1_directory); |
| 58 | std::string flt_obs2_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/FLT/OBS_2"; |
| 59 | if (!std::filesystem::exists(flt_obs2_directory)) |
| 60 | std::filesystem::create_directories(flt_obs2_directory); |
| 61 | |
| 62 | std::string spp_obs1_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/SPP/OBS_1"; |
| 63 | if (!std::filesystem::exists(spp_obs1_directory)) |
| 64 | std::filesystem::create_directories(spp_obs1_directory); |
| 65 | std::string spp_obs2_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/SPP/OBS_2"; |
| 66 | if (!std::filesystem::exists(spp_obs2_directory)) |
| 67 | std::filesystem::create_directories(spp_obs2_directory); |
| 68 | |
| 69 | std::string xrt_obs1_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/XRT/OBS_1"; |
| 70 | if (!std::filesystem::exists(xrt_obs1_directory)) |
| 71 | std::filesystem::create_directories(xrt_obs1_directory); |
| 72 | std::string xrt_obs2_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/XRT/OBS_2"; |
| 73 | if (!std::filesystem::exists(xrt_obs2_directory)) |
| 74 | std::filesystem::create_directories(xrt_obs2_directory); |
| 75 | |
| 76 | std::string eis_obs1_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/EIS/OBS_1"; |
| 77 | if (!std::filesystem::exists(eis_obs1_directory)) |
| 78 | std::filesystem::create_directories(eis_obs1_directory); |
| 79 | std::string eis_obs2_directory = d_output_file_hint.substr(0, d_output_file_hint.rfind('/')) + "/EIS/OBS_2"; |
| 80 | if (!std::filesystem::exists(eis_obs2_directory)) |
| 81 | std::filesystem::create_directories(eis_obs2_directory); |
| 82 | |
| 83 | ImageRecomposer recomp_flt_obs1, recomp_flt_obs2; |
| 84 | ImageRecomposer recomp_spp_obs1, recomp_spp_obs2; |
| 85 | ImageRecomposer recomp_xrt_obs1, recomp_xrt_obs2; |
| 86 | ImageRecomposer recomp_eis_obs1, recomp_eis_obs2; |
| 87 | |
| 88 | while (!data_in.eof()) |
| 89 | { |
| 90 | // Read buffer |
| 91 | data_in.read((char *)cadu, 1024); |
| 92 | |
| 93 | // Check RS |
| 94 | int errors[4]; |
| 95 | rs_check.decode_interlaved(cadu, true, 4, errors); |
| 96 | if (errors[0] < 0 || errors[1] < 0 || errors[2] < 0 || errors[3] < 0) |
| 97 | continue; |
nothing calls this directly
no test coverage detected