diff --git a/Detector.cc b/Detector.cc index 81ac7f5..f8bbe6f 100644 --- a/Detector.cc +++ b/Detector.cc @@ -2300,10 +2300,10 @@ inline void Detector::ReadAllAntennaGains(Settings *settings1){ VgainTopFile = string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_TVpol_RealizedGainAndPhase_Copol_Kansas2024.txt"; HgainFile = string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_Hpol_RealizedGainAndPhase_Copol_Kansas2024.txt"; } - else if (settings1->ANTENNA_MODE == 6) { //Adding antenna mode for custom gains. - VgainFile = string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_BVpol_RealizedGainAndPhase_Copol_Custom.txt"; - VgainTopFile = string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_TVpol_RealizedGainAndPhase_Copol_Custom.txt"; - HgainFile = string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_Hpol_RealizedGainAndPhase_Copol_Custom.txt"; + else if (settings1->ANTENNA_MODE == 6) { //Adding antenna mode for custom gains (takes full path). + VgainFile = string( settings1->VPOL_GAIN_FILE ); + VgainTopFile = string( settings1->VTOP_GAIN_FILE ); + HgainFile = string( settings1->HPOL_GAIN_FILE ); } // Check for ALL_ANT_V_ON, then set all antennas to VPol if true diff --git a/Settings.cc b/Settings.cc index 60bc966..b1514e8 100644 --- a/Settings.cc +++ b/Settings.cc @@ -34,7 +34,7 @@ void Settings::Initialize() { NDISCONES_PASS=3; DEBUG=false; // debugging option -outputdir="outputs"; // directory where outputs go + outputdir="outputs"; // directory where outputs go FREQ_LOW_SEAVEYS=200.E6; FREQ_HIGH_SEAVEYS=1200.E6; BW_SEAVEYS=FREQ_HIGH_SEAVEYS-FREQ_LOW_SEAVEYS; @@ -46,6 +46,9 @@ outputdir="outputs"; // directory where outputs go SIGMA_SELECT=0; // when in SIGMAPARAM=1 case, 0 : (default) use mean value, 1 : use upper bound, 2 : use lower bound + HPOL_GAIN_FILE=string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_dipoletest1_output.txt"; // Default to original Ara Data + VTOP_GAIN_FILE=string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_bicone6in_output.txt"; // Default to original Ara Data + VPOL_GAIN_FILE=string(getenv("ARA_SIM_DIR"))+"/data/antennas/realizedGain/ARA_bicone6in_output.txt"; // Default to original Ara Data // end of values from icemc @@ -727,6 +730,30 @@ void Settings::ReadFile(string setupfile) { else if (label == "ANTENNA_MODE"){ ANTENNA_MODE = atoi(line.substr(line.find_first_of("=") + 1).c_str()); } + else if (label == "VPOL_GAIN_FILE") { + VPOL_GAIN_FILE = ParseFilePath(line); + if (VPOL_GAIN_FILE.empty()) { + std::cerr << "Warning: could not parse path from line: " << line << std::endl; + std::cerr << "Example Input: VPOL_GAIN_FILE=\"path/to/gain/file.txt\"" << std::endl; + std::abort(); + } + } + else if (label == "VTOP_GAIN_FILE") { + VTOP_GAIN_FILE = ParseFilePath(line); + if (VTOP_GAIN_FILE.empty()) { + std::cerr << "Warning: could not parse path from line: " << line << std::endl; + std::cerr << "Example Input: VTOP_GAIN_FILE=\"path/to/gain/file.txt\"" << std::endl; + std::abort(); + } + } + else if (label == "HPOL_GAIN_FILE") { + HPOL_GAIN_FILE = ParseFilePath(line); + if (HPOL_GAIN_FILE.empty()) { + std::cerr << "Warning: could not parse path from line: " << line << std::endl; + std::cerr << "Example Input: HPOL_GAIN_FILE=\"path/to/gain/file.txt\"" << std::endl; + std::abort(); + } + } else if (label == "IMPEDANCE_RX_VPOL"){ IMPEDANCE_RX_VPOL = atoi(line.substr(line.find_first_of("=") + 1).c_str()); } @@ -762,9 +789,6 @@ void Settings::ReadFile(string setupfile) { SOURCE_DEPTH = atof(line.substr(line.find_first_of("=") + 1).c_str()); } - - - } } setFile.close(); @@ -1135,6 +1159,16 @@ int Settings::CheckCompatibilitiesSettings() { num_err++; } + // checking antenna mode + if (ANTENNA_MODE != 6) { + if (!VPOL_GAIN_FILE.empty() || !VTOP_GAIN_FILE.empty() || !HPOL_GAIN_FILE.empty()) { + std::cerr << "Warning: Custom GAIN_FILE paths provided, " + << "but ANTENNA_MODE != 6. These files may be ignored." << std::endl; + num_err++; + } + } + + return num_err; } @@ -1148,3 +1182,22 @@ void Settings::SetGitCommitHash(){ std::cout<<"The Git Commit Hash: "<