增加了模拟天线方向图衰减
parent
ab8ca4802f
commit
3bf201b4ca
|
|
@ -466,8 +466,15 @@ void CUDA_RFPC_MainProcess(
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 核函数 ****************************************************************************************************************************/
|
/* 核函数 ****************************************************************************************************************************/
|
||||||
|
|
||||||
|
__device__ double SincTarg(double x) {
|
||||||
|
return 1 - (pow(x, 2) / 6) + (pow(x, 4) / 120) - (pow(x, 6) / 5040);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__global__ void Kernel_Computer_R_amp_NoAntPattern(
|
__global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
SateState* antlist,
|
SateState* antlist,
|
||||||
long PRFCount,
|
long PRFCount,
|
||||||
|
|
@ -478,6 +485,7 @@ __global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
double Pt,
|
double Pt,
|
||||||
double refPhaseRange,
|
double refPhaseRange,
|
||||||
double NearR, double FarR,
|
double NearR, double FarR,
|
||||||
|
double maxGain,double GainWeight,
|
||||||
double* d_temp_R, double* d_temp_amps// 计算输出
|
double* d_temp_R, double* d_temp_amps// 计算输出
|
||||||
) {
|
) {
|
||||||
long long idx = blockIdx.x * blockDim.x + threadIdx.x; // 获取当前的线程编码
|
long long idx = blockIdx.x * blockDim.x + threadIdx.x; // 获取当前的线程编码
|
||||||
|
|
@ -489,18 +497,14 @@ __global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (prfId < PRFCount && posId < pixelcount) {
|
if (prfId < PRFCount && posId < pixelcount) {
|
||||||
double RstX = antlist[prfId].Px - goallist[posId].Tx; // ¼ÆËã×ø±êʸÁ¿
|
SateState antp = antlist[prfId];
|
||||||
double RstY = antlist[prfId].Py - goallist[posId].Ty;
|
GoalState gp = goallist[posId];
|
||||||
double RstZ = antlist[prfId].Pz - goallist[posId].Tz;
|
double RstX = antp.Px - gp.Tx; // 柴麻恫炎文楚 T->S
|
||||||
|
double RstY = antp.Py - gp.Ty;
|
||||||
|
double RstZ = antp.Pz - gp.Tz;
|
||||||
double RstR = sqrt(RstX * RstX + RstY * RstY + RstZ * RstZ); // 矢量距离
|
double RstR = sqrt(RstX * RstX + RstY * RstY + RstZ * RstZ); // 矢量距离
|
||||||
|
|
||||||
//if (prfId > 20000) {
|
|
||||||
// printf("prfid %d,nearR R Rfar %e %e %e ant=[%e,%e,%e] dem_G=[%e,%e,%e]\n", prfId,NearR,RstR,FarR,
|
|
||||||
// antlist[prfId].Px , antlist[prfId].Py , antlist[prfId].Pz ,
|
|
||||||
// goallist[posId].Tx, goallist[posId].Ty, goallist[posId].Tz
|
|
||||||
// );
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (RstR<NearR || RstR>FarR) {
|
if (RstR<NearR || RstR>FarR) {
|
||||||
d_temp_R[idx] = 0;
|
d_temp_R[idx] = 0;
|
||||||
|
|
@ -508,9 +512,9 @@ __global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
double slopeX = goallist[posId].TsX;
|
double slopeX = gp.TsX;
|
||||||
double slopeY = goallist[posId].TsY;
|
double slopeY = gp.TsY;
|
||||||
double slopeZ = goallist[posId].TsZ;
|
double slopeZ = gp.TsZ;
|
||||||
|
|
||||||
double slopR = sqrtf(slopeX * slopeX + slopeY * slopeY + slopeZ * slopeZ); //
|
double slopR = sqrtf(slopeX * slopeX + slopeY * slopeY + slopeZ * slopeZ); //
|
||||||
if (abs(slopR - 0) > 1e-3) {
|
if (abs(slopR - 0) > 1e-3) {
|
||||||
|
|
@ -524,7 +528,20 @@ __global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
}
|
}
|
||||||
else {}
|
else {}
|
||||||
|
|
||||||
double ampGain = 1;
|
|
||||||
|
// 柴麻弍鉦縫受
|
||||||
|
|
||||||
|
double antDirectR = sqrt(antp.antDirectX * antp.antDirectX
|
||||||
|
+ antp.antDirectY * antp.antDirectY
|
||||||
|
+ antp.antDirectZ * antp.antDirectZ);
|
||||||
|
|
||||||
|
double diectAngle = -1*(RstX*antp.antDirectX+
|
||||||
|
RstY*antp.antDirectY+
|
||||||
|
RstZ*antp.antDirectZ) / (antDirectR* RstR);
|
||||||
|
|
||||||
|
diectAngle = acos(diectAngle);// 察業崙
|
||||||
|
|
||||||
|
double ampGain = 2*maxGain*SincTarg(GainWeight*diectAngle);
|
||||||
ampGain = ampGain / (powf(4 * LAMP_CUDA_PI, 2) * powf(RstR, 4)); // 反射强度
|
ampGain = ampGain / (powf(4 * LAMP_CUDA_PI, 2) * powf(RstR, 4)); // 反射强度
|
||||||
double sigma = GPU_getSigma0dB(sigma0Params, localangle);
|
double sigma = GPU_getSigma0dB(sigma0Params, localangle);
|
||||||
sigma = powf(10.0, sigma / 10.0);
|
sigma = powf(10.0, sigma / 10.0);
|
||||||
|
|
@ -549,6 +566,11 @@ __global__ void Kernel_Computer_R_amp_NoAntPattern(
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__global__ void CUDA_Kernel_Computer_echo_NoAntPattern(
|
__global__ void CUDA_Kernel_Computer_echo_NoAntPattern(
|
||||||
double* d_temp_R, double* d_temp_amps, long posNum,
|
double* d_temp_R, double* d_temp_amps, long posNum,
|
||||||
double f0, double dfreq,
|
double f0, double dfreq,
|
||||||
|
|
@ -586,9 +608,6 @@ __global__ void CUDA_Kernel_Computer_echo_NoAntPattern(
|
||||||
|
|
||||||
if (fId < maxfreqnum && prfId < temp_PRF_Count) {
|
if (fId < maxfreqnum && prfId < temp_PRF_Count) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long echo_ID = prfId * maxfreqnum + fId; // 计算对应的回波位置
|
long echo_ID = prfId * maxfreqnum + fId; // 计算对应的回波位置
|
||||||
float factorjTemp = RFPCPIDIVLIGHT * (f0 + fId * dfreq);
|
float factorjTemp = RFPCPIDIVLIGHT * (f0 + fId * dfreq);
|
||||||
cuComplex echo = make_cuComplex(0, 0);
|
cuComplex echo = make_cuComplex(0, 0);
|
||||||
|
|
@ -735,6 +754,7 @@ extern "C" void ProcessRFPCTask(RFPCTask& task, long devid)
|
||||||
task.Pt,
|
task.Pt,
|
||||||
task.Rref,
|
task.Rref,
|
||||||
task.Rnear, task.Rfar,
|
task.Rnear, task.Rfar,
|
||||||
|
task.maxGain,task.GainWeight,
|
||||||
d_R, d_amps// 计算输出
|
d_R, d_amps// 计算输出
|
||||||
);
|
);
|
||||||
PrintLasterError("CUDA_Kernel_Computer_R_amp");
|
PrintLasterError("CUDA_Kernel_Computer_R_amp");
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
extern "C" struct SateState {
|
extern "C" struct SateState {
|
||||||
double Px, Py, Pz, Vx, Vy, Vz;
|
double Px, Py, Pz, Vx, Vy, Vz;
|
||||||
|
//double antXaxisX, antXaxisY, antXaxisZ;
|
||||||
|
//double antYaxisX, antYaxisY, antYaxisZ;
|
||||||
|
//double antZaxisX, antZaxisY, antZaxisZ;
|
||||||
|
double antDirectX, antDirectY, antDirectZ;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -86,7 +90,8 @@ extern "C" struct RFPCTask
|
||||||
GoalState* goallist = nullptr;
|
GoalState* goallist = nullptr;
|
||||||
cuComplex* d_echoData = nullptr; // ťŘ˛¨
|
cuComplex* d_echoData = nullptr; // ťŘ˛¨
|
||||||
CUDASigmaParam sigma0_cls;
|
CUDASigmaParam sigma0_cls;
|
||||||
|
double maxGain=48;
|
||||||
|
double GainWeight=300;
|
||||||
|
|
||||||
size_t targetnum;
|
size_t targetnum;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -929,8 +929,8 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU() {
|
||||||
|
|
||||||
ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
|
ErrorCode RFPCProcessCls::RFPCMainProcess_MultiGPU_NoAntPattern()
|
||||||
{
|
{
|
||||||
int num_devices=1;
|
int num_devices=0;
|
||||||
//cudaGetDeviceCount(&num_devices);
|
cudaGetDeviceCount(&num_devices);
|
||||||
PRINT("GPU Count : %d \n", num_devices);
|
PRINT("GPU Count : %d \n", num_devices);
|
||||||
|
|
||||||
long prfcount = this->EchoSimulationData->getPluseCount();
|
long prfcount = this->EchoSimulationData->getPluseCount();
|
||||||
|
|
@ -1089,6 +1089,23 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU_NoAntPattern(size_t startprfid, si
|
||||||
h_antlist.get()[i].Vx = antplise.get()[i + startprfid].Vx;
|
h_antlist.get()[i].Vx = antplise.get()[i + startprfid].Vx;
|
||||||
h_antlist.get()[i].Vy = antplise.get()[i + startprfid].Vy;
|
h_antlist.get()[i].Vy = antplise.get()[i + startprfid].Vy;
|
||||||
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].antDirectX = antplise.get()[i + startprfid].AntDirectX;
|
||||||
|
h_antlist.get()[i].antDirectY = antplise.get()[i + startprfid].AntDirectY;
|
||||||
|
h_antlist.get()[i].antDirectZ = antplise.get()[i + startprfid].AntDirectZ;
|
||||||
|
h_antlist.get()[i].antXaxisX = antplise.get()[i + startprfid].x;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
h_antlist.get()[i].Vz = antplise.get()[i + startprfid].Vz;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task.antlist = (SateState*)mallocCUDADevice(prfcount * sizeof(SateState), devId);
|
task.antlist = (SateState*)mallocCUDADevice(prfcount * sizeof(SateState), devId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue