From 4599562e5b6d995b79ada6f2d7fb6e8f772cab62 Mon Sep 17 00:00:00 2001 From: buzinsky Date: Mon, 28 Oct 2019 11:05:17 -0400 Subject: [PATCH 1/3] bug fix: prints wring freqs to root file --- Source/Generators/LMCFakeTrackSignalGenerator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Generators/LMCFakeTrackSignalGenerator.cc b/Source/Generators/LMCFakeTrackSignalGenerator.cc index 674f0866..21190207 100644 --- a/Source/Generators/LMCFakeTrackSignalGenerator.cc +++ b/Source/Generators/LMCFakeTrackSignalGenerator.cc @@ -657,7 +657,7 @@ namespace locust fStartFrequency = rel_cyc(new_energy, fBField); fCurrentFrequency = fStartFrequency; aTrack.StartTime = fEndTime + 0.; // margin of time is 0. - aTrack.StartFrequency += fStartFrequency; + aTrack.StartFrequency = fStartFrequency; } fSlope = slope_distribution(fRandomEngine); From d05b9685d4aebb50b3e5442c686ea681de87e3a1 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Mon, 28 Oct 2019 22:37:05 -0400 Subject: [PATCH 2/3] Added single-patch feed to LMCPowerCombiner with gain==1.0 so that gain comes from patch FIR only. Positioned the single patch at z=0 in InitializePatchArray() functions in LMCPatchSignal, LMCDipoleSignal, and LMCPlaneWaveSignal Generators. --- Source/Generators/LMCDipoleSignalGenerator.cc | 5 ++++ Source/Generators/LMCPatchSignalGenerator.cc | 5 ++++ .../Generators/LMCPlaneWaveSignalGenerator.cc | 7 ++++- Source/RxComponents/LMCPowerCombiner.cc | 29 +++++++++++++++++-- Source/RxComponents/LMCPowerCombiner.hh | 1 + 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Source/Generators/LMCDipoleSignalGenerator.cc b/Source/Generators/LMCDipoleSignalGenerator.cc index af96c578..2c51f672 100644 --- a/Source/Generators/LMCDipoleSignalGenerator.cc +++ b/Source/Generators/LMCDipoleSignalGenerator.cc @@ -306,6 +306,11 @@ namespace locust for(int receiverIndex = 0; receiverIndex < nReceivers; ++receiverIndex) { zPosition = (receiverIndex - (nReceivers - 1.) /2.) * patchSpacingZ; + + if (fPowerCombiner.GetPowerCombiner() == 7) // single patch + { + zPosition = 0.; + } modelPatch.SetCenterPosition({patchRadius * cos(theta) , patchRadius * sin(theta) , zPosition }); modelPatch.SetPolarizationDirection({RotateZ(0, dRotateVoltages*channelIndex, sin(theta), -cos(theta)), RotateZ(1, dRotateVoltages*channelIndex, sin(theta), -cos(theta)), 0.}); diff --git a/Source/Generators/LMCPatchSignalGenerator.cc b/Source/Generators/LMCPatchSignalGenerator.cc index 575eb256..6c02e774 100644 --- a/Source/Generators/LMCPatchSignalGenerator.cc +++ b/Source/Generators/LMCPatchSignalGenerator.cc @@ -377,6 +377,11 @@ namespace locust { zPosition = fZShiftArray + (receiverIndex - (nReceivers - 1.) /2.) * patchSpacingZ; + if (fPowerCombiner.GetPowerCombiner() == 7) // single patch + { + zPosition = 0.; + } + modelPatch.SetCenterPosition({patchRadius * cos(theta) , patchRadius * sin(theta) , zPosition }); modelPatch.SetPolarizationDirection({sin(theta), -cos(theta), 0.}); diff --git a/Source/Generators/LMCPlaneWaveSignalGenerator.cc b/Source/Generators/LMCPlaneWaveSignalGenerator.cc index 19624bf7..d7ac1ad3 100644 --- a/Source/Generators/LMCPlaneWaveSignalGenerator.cc +++ b/Source/Generators/LMCPlaneWaveSignalGenerator.cc @@ -413,7 +413,12 @@ namespace locust { zPosition = (receiverIndex - (nReceivers - 1.) /2.) * patchSpacingZ; - modelPatch.SetCenterPosition({patchRadius * cos(theta) , patchRadius * sin(theta) , zPosition }); + if (fPowerCombiner.GetPowerCombiner() == 7) // single patch + { + zPosition = 0.; + } + + modelPatch.SetCenterPosition({patchRadius * cos(theta) , patchRadius * sin(theta) , zPosition }); modelPatch.SetPolarizationDirection({sin(theta), -cos(theta), 0.}); modelPatch.SetNormalDirection({-cos(theta), -sin(theta), 0.}); //Say normals point inwards allChannels[channelIndex].AddReceiver(modelPatch); diff --git a/Source/RxComponents/LMCPowerCombiner.cc b/Source/RxComponents/LMCPowerCombiner.cc index ce3d77e5..f17e824c 100644 --- a/Source/RxComponents/LMCPowerCombiner.cc +++ b/Source/RxComponents/LMCPowerCombiner.cc @@ -53,9 +53,16 @@ namespace locust else if (feed == "seven-eighths") fpowerCombiner = 3; else if (feed == "nine-sixteenths") fpowerCombiner = 4; else if (feed == "voltage-divider") fpowerCombiner = 5; + else if (feed == "s-matrix") fpowerCombiner = 6; + else if (feed == "single-patch") fpowerCombiner = 7; else fpowerCombiner = 0; // default return true; - } + } + + int PowerCombiner::GetPowerCombiner() + { + return fpowerCombiner; + } @@ -215,7 +222,7 @@ namespace locust SetNPatchesPerStrip(aPatchesPerStrip); fdampingFactors.resize(fnPatchesPerStrip); - if ((fpowerCombiner == 0) || (fpowerCombiner == 2) || (fpowerCombiner == 3) || (fpowerCombiner == 4)) + if ((fpowerCombiner == 7) || (fpowerCombiner == 0) || (fpowerCombiner == 2) || (fpowerCombiner == 3) || (fpowerCombiner == 4)) { SetCenterFedDampingFactors(); } @@ -234,6 +241,7 @@ namespace locust { SetSmatrix10patchDampingFactors(); } + return true; } @@ -289,6 +297,23 @@ namespace locust fpatchLoss = 0.6; famplifierLoss = 0.66; } + + else if (fpowerCombiner == 6) // s-matrix + { + famplifierLoss = 1.0; // this has no effect. S-matrix takes its place. + } + + else if (fpowerCombiner == 7) // single-patch + { + // these losses have no effect. FIR for single patch is responsible for patch gain. + fjunctionLoss = 1.0; + fpatchLoss = 1.0; + famplifierLoss = 1.0; + fendPatchLoss = 1.0; + } + + + return true; } diff --git a/Source/RxComponents/LMCPowerCombiner.hh b/Source/RxComponents/LMCPowerCombiner.hh index f8202e63..be3c9826 100644 --- a/Source/RxComponents/LMCPowerCombiner.hh +++ b/Source/RxComponents/LMCPowerCombiner.hh @@ -42,6 +42,7 @@ namespace locust void SetAmplifierLoss(double aAmplifierLoss); void SetEndPatchLoss(double aEndPatchLoss); bool SetPowerCombiner( std::string feed ); + int GetPowerCombiner(); From a2bf8c760cf159016c927bf045dc01a5bc5f1a35 Mon Sep 17 00:00:00 2001 From: Penny Slocum Date: Tue, 29 Oct 2019 12:15:23 -0400 Subject: [PATCH 3/3] Bumped version to 1.15.3 for patch. --- CMakeLists.txt | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a8f98fb..02cc4836 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required( VERSION 3.1 ) # Define the project cmake_policy( SET CMP0048 NEW ) # version in project() -project( locust_mc VERSION 1.15.2) +project( locust_mc VERSION 1.15.3) list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake ) include( PackageBuilder ) diff --git a/Dockerfile b/Dockerfile index 68c7d0ad..90aec229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM project8/p8compute_dependencies:v0.9.0 as locust_common ARG build_type=Release ENV LOCUST_BUILD_TYPE=$build_type -ENV LOCUST_TAG=v1.15.2 +ENV LOCUST_TAG=v1.15.3 ENV LOCUST_BUILD_PREFIX=/usr/local/p8/locust/$LOCUST_TAG RUN mkdir -p $LOCUST_BUILD_PREFIX &&\