Add start Refelection Reconstruction
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#include "startReflectionReconstruction.h"
|
||||
#include "Function3D.h"
|
||||
#include "Matrix.h"
|
||||
|
||||
#include "common/precalculateChannelList.h"
|
||||
#include "common/dataBlockCreation/getAScanBlockPreprocessed.h"
|
||||
#include "reflectionReconstruction/preprocessData/determineOptimalPulse.h"
|
||||
#include "config/config.h"
|
||||
|
||||
#include "CudaEnvInit.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
namespace Recon
|
||||
{
|
||||
Aurora::Matrix startReflectionReconstruction(Parser* aParser, int SAFT_mode, const Aurora::Matrix &motorPos,
|
||||
const Aurora::Matrix &slList, const Aurora::Matrix &snList,
|
||||
const Aurora::Matrix &rlList, const Aurora::Matrix &rnList,
|
||||
const Aurora::Matrix &geom, MeasurementInfo expInfo, PreComputes preComputes)
|
||||
{
|
||||
printf("Reflection reconstruction is carried out.");
|
||||
|
||||
printf("Preperations for reconstructions.");
|
||||
|
||||
printf(" - reset GPUs");
|
||||
for (size_t i = 0; i < reconParams::gpuSelectionList.getDataSize(); i++)
|
||||
{
|
||||
std::string msg;
|
||||
if (!resetGPUDevice((int)transParams::gpuSelectionList[i],msg))
|
||||
{
|
||||
std::cerr<<msg<<std::endl;
|
||||
}
|
||||
}
|
||||
printf(" - optimal pulse");
|
||||
if(reflectParams::useOptPulse==1 && reflectParams::runReflectionReco){
|
||||
preComputes.sincPeak_ft = determineOptimalPulse(preComputes.timeInterval ,expInfo.expectedAScanLength);
|
||||
}
|
||||
printf(" - channel list");
|
||||
auto channelList = precalculateChannelList(rlList, rnList, expInfo, preComputes);
|
||||
size_t numScans = motorPos.getDataSize() * slList.getDataSize() *
|
||||
snList.getDataSize() * rlList.getDataSize() *
|
||||
rnList.getDataSize();
|
||||
printf(" - blocking");
|
||||
auto Env = Aurora::zeros((int)reflectParams::imageXYZ[0],(int)reflectParams::imageXYZ[1],(int)reflectParams::imageXYZ[2]);
|
||||
|
||||
int numTakenScans = 0,numProcessedScans = 0,numPossibleScans = 0;
|
||||
for(int i=0; i<motorPos.getDataSize(); ++i)
|
||||
{
|
||||
#pragma omp parallel for num_threads(24)
|
||||
for(int j=0; j<slList.getDataSize() / transParams::senderTASSize; ++j)
|
||||
{
|
||||
for(int k=0; k<snList.getDataSize() / transParams::senderElementSize; ++k)
|
||||
{
|
||||
Aurora::Matrix mp = motorPos(i).toMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Aurora::Matrix();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user