Skip to content

Commit

Permalink
Merge pull request #106 from project8/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pslocum authored Oct 29, 2019
2 parents dcae1ec + c5b2c3b commit 2fc57f5
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&\
Expand Down
5 changes: 5 additions & 0 deletions Source/Generators/LMCDipoleSignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.});
Expand Down
2 changes: 1 addition & 1 deletion Source/Generators/LMCFakeTrackSignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions Source/Generators/LMCPatchSignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.});

Expand Down
7 changes: 6 additions & 1 deletion Source/Generators/LMCPlaneWaveSignalGenerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
29 changes: 27 additions & 2 deletions Source/RxComponents/LMCPowerCombiner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}



Expand Down Expand Up @@ -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();
}
Expand All @@ -234,6 +241,7 @@ namespace locust
{
SetSmatrix10patchDampingFactors();
}

return true;
}

Expand Down Expand Up @@ -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;

}
Expand Down
1 change: 1 addition & 0 deletions Source/RxComponents/LMCPowerCombiner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ namespace locust
void SetAmplifierLoss(double aAmplifierLoss);
void SetEndPatchLoss(double aEndPatchLoss);
bool SetPowerCombiner( std::string feed );
int GetPowerCombiner();



Expand Down

0 comments on commit 2fc57f5

Please sign in to comment.