ISCE_INSAR/contrib/PyCuAmpcor/src/cuAmpcorChunk.h

100 lines
2.7 KiB
C
Raw Normal View History

/*
2019-01-16 19:40:08 +00:00
* cuAmpcorChunk.h
* Purpose: a group of chips processed at the same time
*/
#ifndef __CUAMPCORCHUNK_H
#define __CUAMPCORCHUNK_H
#include "GDALImage.h"
2019-01-16 19:40:08 +00:00
#include "cuArrays.h"
#include "cuAmpcorParameter.h"
#include "cuOverSampler.h"
#include "cuSincOverSampler.h"
#include "cuCorrFrequency.h"
class cuAmpcorChunk{
private:
int idxChunkDown;
int idxChunkAcross;
int idxChunk;
int nWindowsDown;
int nWindowsAcross;
int devId;
cudaStream_t stream;
GDALImage *referenceImage;
GDALImage *secondaryImage;
2019-01-16 19:40:08 +00:00
cuAmpcorParameter *param;
cuArrays<float2> *offsetImage;
cuArrays<float> *snrImage;
cuArrays<float3> *covImage;
// gpu buffer
cuArrays<float2> * c_referenceChunkRaw, * c_secondaryChunkRaw;
cuArrays<float> * r_referenceChunkRaw, * r_secondaryChunkRaw;
// gpu windows raw data
cuArrays<float2> * c_referenceBatchRaw, * c_secondaryBatchRaw, * c_secondaryBatchZoomIn;
cuArrays<float> * r_referenceBatchRaw, * r_secondaryBatchRaw;
// gpu windows oversampled data
cuArrays<float2> * c_referenceBatchOverSampled, * c_secondaryBatchOverSampled;
cuArrays<float> * r_referenceBatchOverSampled, * r_secondaryBatchOverSampled;
2019-01-16 19:40:08 +00:00
cuArrays<float> * r_corrBatchRaw, * r_corrBatchZoomIn, * r_corrBatchZoomInOverSampled, * r_corrBatchZoomInAdjust;
2019-01-16 19:40:08 +00:00
cuArrays<int> *ChunkOffsetDown, *ChunkOffsetAcross;
cuOverSamplerC2C *referenceBatchOverSampler, *secondaryBatchOverSampler;
2019-01-16 19:40:08 +00:00
cuOverSamplerR2R *corrOverSampler;
cuSincOverSamplerR2R *corrSincOverSampler;
2019-01-16 19:40:08 +00:00
//for frequency domain
cuFreqCorrelator *cuCorrFreqDomain, *cuCorrFreqDomain_OverSampled;
2019-01-16 19:40:08 +00:00
cuArrays<int2> *offsetInit;
cuArrays<int2> *offsetZoomIn;
cuArrays<float2> *offsetFinal;
cuArrays<int2> *maxLocShift; //record the maxloc from the extract center
cuArrays<float> *corrMaxValue;
//SNR estimation
cuArrays<float> *r_corrBatchRawZoomIn;
cuArrays<float> *r_corrBatchSum;
cuArrays<int> *i_corrBatchZoomInValid, *i_corrBatchValidCount;
cuArrays<float> *r_snrValue;
2019-01-16 19:40:08 +00:00
cuArrays<int2> *i_maxloc;
cuArrays<float> *r_maxval;
// Varince estimation.
cuArrays<float3> *r_covValue;
2019-01-16 19:40:08 +00:00
public:
cuAmpcorChunk() {}
//cuAmpcorChunk(cuAmpcorParameter *param_, SlcImage *reference_, SlcImage *secondary_);
2019-01-16 19:40:08 +00:00
void setIndex(int idxDown_, int idxAcross_);
cuAmpcorChunk(cuAmpcorParameter *param_, GDALImage *reference_, GDALImage *secondary_, cuArrays<float2> *offsetImage_,
cuArrays<float> *snrImage_, cuArrays<float3> *covImage_, cudaStream_t stream_);
2019-01-16 19:40:08 +00:00
void loadReferenceChunk();
void loadSecondaryChunk();
2019-01-16 19:40:08 +00:00
void getRelativeOffset(int *rStartPixel, const int *oStartPixel, int diff);
~cuAmpcorChunk();
void run(int, int);
2019-01-16 19:40:08 +00:00
};
#endif