@@ -53,11 +53,11 @@ void transformTile(const thrust::complex<float> *tile,
53
53
double refRangePixelSpacing,
54
54
double refWavelength,
55
55
int chipSize,
56
- int rowOffset,
56
+ int rowOffset,
57
57
int rowStart) {
58
58
59
59
int iTileOut = blockDim .x * blockIdx .x + threadIdx .x ;
60
- int iChip = iTileOut * chipSize * chipSize;
60
+ int iChip = iTileOut * chipSize * chipSize;
61
61
int chipHalf = chipSize/2 ;
62
62
63
63
if (iTileOut < outWidth*outLength) {
@@ -74,7 +74,7 @@ void transformTile(const thrust::complex<float> *tile,
74
74
const int intRg = __float2int_rd (j + rgOff);
75
75
const double fracAz = i + azOff - intAz + rowStart;
76
76
const double fracRg = j + rgOff - intRg;
77
-
77
+
78
78
// Check bounds again. Use rowOffset to account tiles where tile.rowStart != tile.firstRowImage
79
79
bool intAzInBounds = !((intAz+rowOffset < chipHalf) || (intAz >= (inLength - chipHalf)));
80
80
bool intRgInBounds = !((intRg < chipHalf) || (intRg >= (inWidth - chipHalf)));
@@ -86,29 +86,29 @@ void transformTile(const thrust::complex<float> *tile,
86
86
87
87
// Doppler to be added back. Simultaneously evaluate carrier that needs to
88
88
// be added back after interpolation
89
- double phase = (dop * fracAz)
90
- + rgCarrier.eval (i + azOff, j + rgOff)
89
+ double phase = (dop * fracAz)
90
+ + rgCarrier.eval (i + azOff, j + rgOff)
91
91
+ azCarrier.eval (i + azOff, j + rgOff);
92
92
93
93
// Flatten the carrier phase if requested
94
94
if (flatten) {
95
- phase += ((4 . * (M_PI / wavelength)) *
96
- ((startingRange - refStartingRange)
97
- + (j * (rangePixelSpacing - refRangePixelSpacing))
98
- + (rgOff * rangePixelSpacing))) + ((4.0 * M_PI
99
- * (refStartingRange + (j * refRangePixelSpacing)))
95
+ phase += ((4 . * (M_PI / wavelength)) *
96
+ ((startingRange - refStartingRange)
97
+ + (j * (rangePixelSpacing - refRangePixelSpacing))
98
+ + (rgOff * rangePixelSpacing))) + ((4.0 * M_PI
99
+ * (refStartingRange + (j * refRangePixelSpacing)))
100
100
* ((1.0 / refWavelength) - (1.0 / wavelength)));
101
101
}
102
-
102
+
103
103
// Modulate by 2*PI
104
104
phase = fmod (phase, 2.0 *M_PI);
105
-
105
+
106
106
// Read data chip without the carrier phases
107
107
for (int ii = 0 ; ii < chipSize; ++ii) {
108
108
// Row to read from
109
109
const int chipRow = intAz + ii - chipHalf + rowOffset - rowStart;
110
110
// Carrier phase
111
- const double phase = dop * (ii - 4.0 );
111
+ const double phase = dop * (ii - chipHalf );
112
112
const thrust::complex <float > cval (cos (phase), -sin (phase));
113
113
// Set the data values after removing doppler in azimuth
114
114
for (int jj = 0 ; jj < chipSize; ++jj) {
@@ -142,7 +142,7 @@ gpuTransformTile(isce3::image::Tile<std::complex<float>> & tile,
142
142
isce3::cuda::core::gpuSinc2dInterpolator<thrust::complex <float >> interp,
143
143
int inWidth, int inLength, double startingRange, double rangePixelSpacing,
144
144
double prf, double wavelength, double refStartingRange,
145
- double refRangePixelSpacing, double refWavelength,
145
+ double refRangePixelSpacing, double refWavelength,
146
146
bool flatten, int chipSize) {
147
147
148
148
// Cache geometry values
@@ -186,14 +186,14 @@ gpuTransformTile(isce3::image::Tile<std::complex<float>> & tile,
186
186
dim3 grid ((nOutPixels+(THRD_PER_BLOCK-1 ))/THRD_PER_BLOCK);
187
187
188
188
// global call to transform
189
- transformTile<<<grid, block>>> (d_tile,
189
+ transformTile<<<grid, block>>> (d_tile,
190
190
d_chip,
191
- d_imgOut,
192
- d_rgOffTile,
193
- d_azOffTile,
194
- d_rgCarrier,
195
- d_azCarrier,
196
- d_dopplerLUT,
191
+ d_imgOut,
192
+ d_rgOffTile,
193
+ d_azOffTile,
194
+ d_rgCarrier,
195
+ d_azCarrier,
196
+ d_dopplerLUT,
197
197
interp,
198
198
flatten,
199
199
outWidth,
@@ -206,7 +206,7 @@ gpuTransformTile(isce3::image::Tile<std::complex<float>> & tile,
206
206
wavelength,
207
207
refStartingRange,
208
208
refRangePixelSpacing,
209
- refWavelength,
209
+ refWavelength,
210
210
chipSize,
211
211
tile.rowStart ()-tile.firstImageRow (),// needed to keep az in bounds in subtiles
212
212
tile.rowStart ()); // needed to match az components on CPU
@@ -224,7 +224,7 @@ gpuTransformTile(isce3::image::Tile<std::complex<float>> & tile,
224
224
checkCudaErrors (cudaFree (d_imgOut));
225
225
checkCudaErrors (cudaFree (d_azOffTile));
226
226
checkCudaErrors (cudaFree (d_rgOffTile));
227
-
227
+
228
228
// Write block of data
229
229
outputSlc.setBlock (imgOut, 0 , tile.rowStart (), outWidth, outLength);
230
230
}
0 commit comments