Skip to content

Commit

Permalink
Merge pull request #134 from project8/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
pslocum authored Feb 25, 2020
2 parents 2664e62 + 3a9aba0 commit 383d703
Show file tree
Hide file tree
Showing 46 changed files with 3,492 additions and 2,723 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.9)
project( locust_mc VERSION 1.15.10)

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake )
include( PackageBuilder )
Expand Down
36 changes: 19 additions & 17 deletions Config/Tutorial/LocustPhase3Template.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"generators":
[
"patch-signal",
[
"array-signal",
"lpf-fft",
"decimate-signal",
"decimate-signal",
"digitizer"
],

Expand All @@ -25,45 +25,47 @@
"xml-filename": "/home/hep/baker/ps48/locust_mc/Config/Tutorial/Project8Phase1_WithRoot_Template.xml"
},

"patch-signal":

"array-signal":
{
"transmitter": "antenna",
"transmitter-frequency": 25.9281e9,
"planewave-amplitude": 1.0e-6,
"antenna-voltage-amplitude": 1.0e5,
"antenna-x-position": 0.04,
"antenna-y-position": 0.03,
"tf-transmitter-filename": "/home/penny/Desktop/laptop_backup/programs/FIRResonse/firTransmitterFile.txt",
"lo-frequency": 25.8781e9,
"array-radius": 0.05,
"npatches-per-strip": 2,
"nelements-per-strip": 2,
"zshift-array": 0.0,
"patch-spacing": 0.0068,
"element-spacing": 0.0068,
"power-combining-feed": "corporate",
"tf-receiver-filename": "/home/penny/locust_mc/Data/TransferFunctions/PatchTFLocust.txt",
"tf-receiver-bin-width": 0.01e9,
"buffer-size": 100,
"hilbert-buffer-margin": 50,
"xml-filename": "/home/penny/locust_mc/Config/Tutorial/Project8Phase3_WithRoot_Template.xml"
},

"freefield-signal":
{
"lo-frequency": 25.2814e9,
"xml-filename": "/home/penny/locust_mc/Config/Tutorial/Project8Phase3_WithRoot_Template.xml"
},


"simulation":
{
"egg-filename": "/home/penny/locust_mc/cbuild/bin/locust_mc.egg",
"n-records": 1,
"record-size": 81920,
"record-size": 8192,
"n-channels": 1
},

"gaussian-noise":
{
"noise-floor": 4.2e-22,
"noise-floor-psd": 8.2e-24,
"domain": "time"
},

"digitizer":
{
"v-range": 1.6e-7,
"v-offset": -0.8e-7
"v-range": 2.0e-7,
"v-offset": -1.0e-7
}

}
Expand Down
800 changes: 0 additions & 800 deletions Data/TransferFunctions/PatchTFLocust.txt

Large diffs are not rendered by default.

1,207 changes: 1,207 additions & 0 deletions Data/TransferFunctions/PatchTFLocust_wide.txt

Large diffs are not rendered by default.

408 changes: 408 additions & 0 deletions Data/TransferFunctions/SlotTFLocust.txt

Large diffs are not rendered by default.

408 changes: 408 additions & 0 deletions Data/TransferFunctions/UncoupledMagDipoleTF.txt

Large diffs are not rendered by default.

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.9
ENV LOCUST_TAG=v1.15.10
ENV LOCUST_BUILD_PREFIX=/usr/local/p8/locust/$LOCUST_TAG

RUN mkdir -p $LOCUST_BUILD_PREFIX &&\
Expand Down
41 changes: 23 additions & 18 deletions Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ set( LOCUST_MC_HEADER_FILES
Core/LMCSimulationController.hh
Core/LMCThreeVector.hh
Core/LMCVisitor.hh
Core/LMCHFSSResponseFileHandler.hh
Core/LMCFIRFileHandler.hh
Core/LMCTFFileHandler.hh

Core/LMCHFSSResponseFileHandler.hh
Core/LMCFIRFileHandler.hh
Core/LMCTFFileHandler.hh
Generators/LMCDigitizer.hh
Generators/LMCGaussianNoiseGenerator.hh
Generators/LMCTestSignalGenerator.hh
Expand All @@ -45,12 +45,11 @@ set( LOCUST_MC_HEADER_FILES
Generators/LMCHighPassFilterFFTGenerator.hh
Generators/LMCLocalOscillatorGenerator.hh
Generators/LMCButterworthLPFGenerator.hh
Generators/LMCDipoleSignalGenerator.cc
Generators/LMCPlaneWaveSignalGenerator.hh
Generators/LMCTurnstileSignalGenerator.hh

Transmitters/LMCFieldBuffer.hh
Transmitters/LMCTransmitter.hh
Transmitters/LMCAntennaSignalTransmitter.hh
Transmitters/LMCPlaneWaveTransmitter.hh

Transforms/LMCHilbertTransform.hh
Transforms/LMCComplexFFT.hh
Expand All @@ -74,10 +73,10 @@ set( LOCUST_MC_SOURCE_FILES
Core/LMCSimulationController.cc
Core/LMCThreeVector.cc
Core/LMCVisitor.cc
Core/LMCHFSSResponseFileHandler.cc
Core/LMCHFSSResponseFileHandler.cc
Core/LMCFIRFileHandler.cc
Core/LMCTFFileHandler.cc

Generators/LMCDigitizer.cc
Generators/LMCGaussianNoiseGenerator.cc
Generators/LMCTestSignalGenerator.cc
Expand All @@ -86,13 +85,13 @@ set( LOCUST_MC_SOURCE_FILES
Generators/LMCHighPassFilterFFTGenerator.cc
Generators/LMCLocalOscillatorGenerator.cc
Generators/LMCButterworthLPFGenerator.cc
Generators/LMCDipoleSignalGenerator.cc
Generators/LMCPlaneWaveSignalGenerator.cc
Generators/LMCTurnstileSignalGenerator.cc

Transmitters/LMCFieldBuffer.cc
Transmitters/LMCAntennaSignalTransmitter.cc


Transmitters/LMCTransmitter.cc
Transmitters/LMCAntennaSignalTransmitter.cc
Transmitters/LMCPlaneWaveTransmitter.cc
Transmitters/LMCFieldBuffer.cc

Transforms/LMCHilbertTransform.cc
Transforms/LMCComplexFFT.cc

Expand All @@ -108,10 +107,13 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA)
set( LOCUST_MC_HEADER_FILES ${LOCUST_MC_HEADER_FILES}

Generators/LMCFreeFieldSignalGenerator.hh
Generators/LMCPatchSignalGenerator.hh
Generators/LMCKassSignalGenerator.hh
Generators/LMCTurnstileSignalGenerator.hh
Generators/LMCArraySignalGenerator.hh


Transmitters/LMCKassTransmitter.hh

Core/LMCGlobalsDeclaration.hh
Core/LMCGlobalsDefinition.hh
Core/LMCParticle.hh
Expand All @@ -130,9 +132,12 @@ if (locust_mc_BUILD_WITH_KASSIOPEIA)

set( LOCUST_MC_SOURCE_FILES ${LOCUST_MC_SOURCE_FILES}
Generators/LMCFreeFieldSignalGenerator.cc
Generators/LMCPatchSignalGenerator.cc
Generators/LMCKassSignalGenerator.cc

Generators/LMCTurnstileSignalGenerator.cc
Generators/LMCArraySignalGenerator.cc

Transmitters/LMCKassTransmitter.cc

Core/LMCHFSSReader.cc
Core/LMCParticle.cc
Core/LMCLienardWiechert.cc
Expand Down
33 changes: 17 additions & 16 deletions Source/Core/LMCHFSSResponseFileHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ namespace locust
LOGGER( lmclog, "HFSSResponseFileHandlerCore" );

HFSSResponseFileHandlerCore::HFSSResponseFileHandlerCore():
fNBins(1000),
fTFNBins(1000),
fFIRNBins(2000),
fResolution(1e-12),
fNSkips(1),
fComplexFFT(),
Expand Down Expand Up @@ -49,10 +50,10 @@ namespace locust
double HFSSResponseFileHandlerCore::ConvolveWithFIRFilter(std::deque<double> inputBuffer)
{
double convolution=0.0;
if(fNBins<=0){
if(fFIRNBins<=0){
LERROR(lmclog,"Number of bins in the filter should be positive");
}
for(int i=0;i<fNBins;++i)
for(int i=0;i<fFIRNBins;++i)
{
convolution+=fFilter[i]*inputBuffer[i];
}
Expand Down Expand Up @@ -89,25 +90,25 @@ namespace locust

bool TFFileHandlerCore::ConvertTFtoFIR(std::vector<std::complex<double>> &tfArray)
{
if(fNBins<=0)
if(fTFNBins<=0)
{
LERROR(lmclog,"The size of transfer function has to be positive integer");
return false;
}
//Might need to be moved to a different function
fTFComplex=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fNBins);
fFIRComplex=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fNBins);
fTFComplex=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fTFNBins);

for (int i = 0; i < fNBins; ++i)
for (int i = 0; i < fTFNBins; ++i)
{
fTFComplex[i][0]=tfArray.at(i).real();
fTFComplex[i][1]=tfArray.at(i).imag();
}
fComplexFFT.SetupIFFT(fNBins,fInitialTFIndex,fTFBinWidth);
fComplexFFT.ReverseFFT(fNBins,fTFComplex,fFIRComplex);
fComplexFFT.SetupIFFT(fTFNBins,fInitialTFIndex,fTFBinWidth);
fFIRNBins=fTFNBins+2*fComplexFFT.GetShiftNBins();
fFIRComplex=(fftw_complex*)fftw_malloc(sizeof(fftw_complex) * fFIRNBins);
fComplexFFT.ReverseFFT(fTFNBins,fTFComplex,fFIRComplex);
fResolution=fComplexFFT.GetTimeResolution();

for (int i = 0; i < fNBins; ++i){
for (int i = 0; i < fFIRNBins; ++i){
fFilter.push_back(fFIRComplex[i][0]);
}
LDEBUG( lmclog, "Finished IFFT to convert transfer function to FIR");
Expand All @@ -120,7 +121,7 @@ namespace locust
{
return true;
}
fNBins=0;
fTFNBins=0;
if(!ends_with(fHFSSFilename,".txt"))
{
LERROR(lmclog,"The TF file should end in .txt");
Expand Down Expand Up @@ -162,10 +163,10 @@ namespace locust
++wordCount;
}
// The TF values from HFSS are in GHz, so need to convert to Hz
if(fNBins==0)fInitialTFIndex=tfIndex*pow(10.0,9);
if(fTFNBins==0)fInitialTFIndex=tfIndex*pow(10.0,9);
const std::complex<double> temp(tfRealValue,tfImaginaryValue);
tfArray.push_back(temp);
++fNBins;
++fTFNBins;
}
}
}
Expand Down Expand Up @@ -197,7 +198,7 @@ namespace locust
{
return true;
}
fNBins=0;
fFIRNBins=0;
if(!ends_with(fHFSSFilename,".txt"))
{
LERROR(lmclog,"The FIR file should end in .txt");
Expand All @@ -215,7 +216,7 @@ namespace locust
if (count%fNSkips==0)
{
fFilter.push_back(filterMagnitude);
++fNBins;
++fFIRNBins;
}
++count;
}
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/LMCHFSSResponseFileHandler.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace locust
// Member variables
std::string fHFSSFilename;
std::vector<double> fFilter;
int fNBins;
int fTFNBins;
int fFIRNBins;
double fResolution;
int fNSkips;
bool fHFSSFiletype;
Expand All @@ -48,7 +49,7 @@ namespace locust

inline int HFSSResponseFileHandlerCore::GetFilterSize() const
{
return fNBins;
return fFIRNBins;
}

inline double HFSSResponseFileHandlerCore::GetFilterResolution() const
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/LMCRunLengthCalculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace locust
// nothing to see here, move along, please
return;
}
void RunLengthCalculator::Visit( const PatchSignalGenerator* )
void RunLengthCalculator::Visit( const ArraySignalGenerator* )
{
// nothing to see here, move along, please
return;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/LMCRunLengthCalculator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace locust
private:
void Visit( const KassSignalGenerator* );
void Visit( const FreeFieldSignalGenerator* );
void Visit( const PatchSignalGenerator* );
void Visit( const ArraySignalGenerator* );
void Visit( const GaussianNoiseGenerator* );
void Visit( const FakeTrackSignalGenerator* );
void Visit( const PlaneWaveSignalGenerator* );
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/LMCVisitor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace locust
class Digitizer;
class KassSignalGenerator;
class FreeFieldSignalGenerator;
class PatchSignalGenerator;
class ArraySignalGenerator;
class DipoleSignalGenerator;
class TurnstileSignalGenerator;
class LocalOscillatorGenerator;
Expand All @@ -38,7 +38,7 @@ namespace locust

virtual void Visit( const KassSignalGenerator* ) = 0;
virtual void Visit( const FreeFieldSignalGenerator* ) = 0;
virtual void Visit( const PatchSignalGenerator* ) = 0;
virtual void Visit( const ArraySignalGenerator* ) = 0;
virtual void Visit( const GaussianNoiseGenerator* ) = 0;
virtual void Visit( const FakeTrackSignalGenerator* ) = 0;
virtual void Visit( const PlaneWaveSignalGenerator* ) = 0;
Expand Down
Loading

0 comments on commit 383d703

Please sign in to comment.