Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
da95af1
sm r3.4
Sep 19, 2023
16c8fed
copy LY common band filter source codes
Oct 9, 2023
e7bab5e
crossmul pybinding for the range filter
Oct 9, 2023
09b2314
add the range band filter
Oct 10, 2023
43dafee
formats
Oct 10, 2023
c0587a4
add azimuth common band fitler with cosine filter
Oct 10, 2023
b8ee707
add the range kaiser filter
Oct 11, 2023
bc35b20
add azimuth kaiser filter
Oct 11, 2023
b30afb7
fix kaiser azimuth filter bug
Oct 11, 2023
9ac9fef
clean
Oct 11, 2023
fbda9ce
clean croosmul.py
Oct 11, 2023
bf40256
delete vscode file
Oct 11, 2023
ed277d7
Merge branch 'develop' into common_band_filter
xhuang-jpl Oct 11, 2023
714b063
enable the flatten_path when the azimuth band filter is enabled
Oct 11, 2023
febd191
tMerge remote-tracking branch 'origin/common_band_filter' into common…
Oct 11, 2023
5d06c3e
fix the azimuth filter bugs
Oct 11, 2023
f81ee9b
fix range band filter bugs
Oct 16, 2023
d821dcf
fix some issues with the bandpassing
Oct 23, 2023
7169c5d
fix the azimuth filter
Oct 24, 2023
6f6e1fc
Merge remote-tracking branch 'upstream/develop' into common_band_filter
Oct 24, 2023
b90dfe1
remove vscode files
Oct 24, 2023
25db581
fix the segmentation fault of range filter
Oct 30, 2023
0cddc63
populate the azimuth and range bandwidth
Oct 30, 2023
f92765a
docstring
Oct 30, 2023
09c60f8
revert the range kaiser windowing
Oct 30, 2023
67f261c
clean
Oct 30, 2023
ac0e90d
address Geoff's comments
Oct 30, 2023
d8a0e21
remove the vscode files
Oct 30, 2023
f6415f0
merge develop
Oct 30, 2023
e6acfd7
add units
Nov 13, 2023
7bebe1f
add Geoff comments
Nov 13, 2023
6dba408
delete .vscode
Nov 13, 2023
4b509a8
make the window type tunable
Nov 14, 2023
7902d83
change minors
Nov 15, 2023
787063d
add kaiser window functions
Nov 16, 2023
7e36fed
finish translating the python to C++
Nov 16, 2023
86bbee4
finish the translation
Nov 16, 2023
9dc838f
using the time domain range kaiser filter
Nov 21, 2023
aa55837
revert the kaiser window effects
Nov 21, 2023
f27fe58
debug range common band filter
Nov 21, 2023
54fde5e
fix the range kaiser filter
Nov 28, 2023
ee9e3cd
change the LUT1d to 2d
Nov 28, 2023
b1ec218
change the doppler centroid from 1d to 2d
Nov 28, 2023
65d4d51
compute the azimuth doppler centroids for reference and secodnary
Nov 28, 2023
03555c4
fix azimuth bugs
Nov 28, 2023
bdd63a0
add the azimuth filter
Nov 29, 2023
afc1545
determine the max kernel size
Nov 29, 2023
d7bbda8
determine the overlap size
Nov 30, 2023
6c0dfcf
overlap size determination
Nov 30, 2023
3d9d50a
process by block with overlap
Dec 1, 2023
6817545
finish the block with overlap processing
Dec 4, 2023
e3b71d4
optimize the performance
Dec 4, 2023
989f5d5
remove .vscode
Dec 4, 2023
12f04cf
fix minors
Dec 4, 2023
6b09a5e
initialize the crossmul variables
Dec 4, 2023
fe50f96
fix minors
Dec 5, 2023
07a4fc8
add the check of flatten_path
Dec 7, 2023
fb1aad0
remove the range samping frequency in pybinding
Dec 7, 2023
83481e1
add references to the doxygen
Dec 7, 2023
a1ded91
move the function description to the header file
Dec 7, 2023
e5015b4
return the tuple
Dec 7, 2023
8f1e9c6
remove the reduntant functions
Dec 7, 2023
7c02297
capitalize the common band
Dec 7, 2023
984845e
change docstring
Dec 7, 2023
7036234
add the docstring
Dec 7, 2023
a9517b2
remove .vscode
Dec 7, 2023
67b3fb0
normalize the FFT transform
Dec 8, 2023
1c10417
fix unit tests failtures
Dec 8, 2023
8a72171
chunk the filter if it is greater than the maximum kernel size
Dec 8, 2023
b3ca47a
remove the .vscode
Dec 8, 2023
7469d36
fix string
Dec 8, 2023
800a438
use the maximum range kernel size with 20% spectrum overlap
Dec 12, 2023
7882716
chnge minors
Dec 12, 2023
79a402b
switch to pyre
Dec 12, 2023
68ecd4e
remove .vscode
Dec 12, 2023
def920d
fix LY comments
Dec 12, 2023
18a1991
formats
Dec 12, 2023
52e0b1a
add kaiser filter unit test
Dec 12, 2023
8b4d211
remove .vscode
Dec 12, 2023
9e74b22
formats
Dec 12, 2023
2314779
improve speedup
Dec 13, 2023
b64ca89
minors
Dec 13, 2023
2b8bf41
fix some readability
Dec 13, 2023
13e7868
minors
Dec 13, 2023
7c1dcfc
change minors
Dec 14, 2023
c93885a
change the sensor type
Dec 14, 2023
57b4de8
change formats
Dec 14, 2023
b45d7f1
some readability changes
Dec 14, 2023
123ec1c
docstrings
Dec 14, 2023
8944067
fix the invalid dopp centroids computation
Dec 14, 2023
797de55
remove .vscode
Dec 14, 2023
e41f074
remove redundant descriptions
Dec 14, 2023
3df640b
fix minors
Dec 14, 2023
b484d30
fix minors
Dec 14, 2023
6eebb96
minors
Dec 14, 2023
ad24486
add the envisat.h5 offset product
Dec 14, 2023
27a38a3
add common band filtering to unit tests
Dec 14, 2023
8ae93ae
minors
Dec 14, 2023
3a0f2a9
fix the complex sinc and modify the kaiser function
Dec 15, 2023
2cde476
operator overload import
Dec 15, 2023
4779dba
remove the product.swath(freq)
Dec 15, 2023
fd33a6b
add the crossmul test data in the ReadMe
Dec 15, 2023
7426d10
fix docstrings
Dec 15, 2023
e6c0e44
add critical secton to compute ref and sec dopp centroids
Dec 19, 2023
aa21514
openmp for computing the doppler centroids
Dec 19, 2023
7142cd6
docstrings
Dec 19, 2023
00e96d4
init the max range filter kernel size 0
Dec 19, 2023
0f8758b
Merge branch 'develop' into common_band_filter
xhuang-jpl Feb 22, 2024
aee3078
Merge branch 'develop' into common_band_filter
xhuang-jpl Feb 29, 2024
9220963
fix the crossmul
Mar 4, 2024
93302b5
Merge remote-tracking branch 'upstream/develop' into common_band_filter
Mar 11, 2024
73804d1
fix typos
Mar 11, 2024
868034c
Merge branch 'develop' into common_band_filter
xhuang-jpl May 1, 2024
dd51fcf
Merge branch 'develop' into common_band_filter
xhuang-jpl May 18, 2024
f3f6e7b
Merge branch 'develop' into common_band_filter
xhuang-jpl May 30, 2024
0834947
Merge branch 'develop' into common_band_filter
xhuang-jpl Jul 3, 2024
afa897c
Merge remote-tracking branch 'origin/common_band_filter' into common_…
Jul 3, 2024
ef22ba0
fix the crossmul doppler function
Jul 3, 2024
a8a1ddb
Merge branch 'develop' into common_band_filter
xhuang-jpl Jun 4, 2025
4a580c0
Merge branch 'develop' into common_band_filter
xhuang-jpl Jun 24, 2025
b88616e
Merge branch 'develop' of https://github-fn.jpl.nasa.gov/isce-3/isce …
Jun 24, 2025
3bf6fda
Merge branch 'develop' into common_band_filter
xhuang-jpl Sep 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions cxx/isce3/cuda/signal/gpuCrossMul.cu
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ __global__ void flatten_g(thrust::complex<T> *ifg,


/** Set number of range looks */
void
gpuCrossmul::rangeLooks(int rngLks) {
void gpuCrossmul::rangeLooks(int rngLks) {
if (rngLks < 1) {
std::string error_msg = "ERROR CUDA crossmul range multilook < 1";
throw isce3::except::InvalidArgument(ISCE_SRCINFO(), error_msg);
Expand All @@ -134,8 +133,7 @@ gpuCrossmul::rangeLooks(int rngLks) {
}

/** Set number of azimuth looks */
void
gpuCrossmul::azimuthLooks(int azLks) {
void gpuCrossmul::azimuthLooks(int azLks) {
if (azLks < 1) {
std::string error_msg = "ERROR CUDA crossmul azimuth multilook < 1";
throw isce3::except::InvalidArgument(ISCE_SRCINFO(), error_msg);
Expand All @@ -148,9 +146,8 @@ gpuCrossmul::azimuthLooks(int azLks) {
_multiLookEnabled = false;
}

void
gpuCrossmul::doppler(isce3::core::LUT1d<double> refDoppler,
isce3::core::LUT1d<double> secDoppler)
void gpuCrossmul::doppler(isce3::core::LUT2d<double> refDoppler,
isce3::core::LUT2d<double> secDoppler)
{
_refDoppler = refDoppler;
_secDoppler = secDoppler;
Expand Down Expand Up @@ -214,7 +211,8 @@ gpuCrossmul::crossmul(isce3::io::Raster& refSlcRaster,
isce3::io::Raster& secSlcRaster,
isce3::io::Raster& ifgRaster,
isce3::io::Raster& coherenceRaster,
isce3::io::Raster* rngOffsetRaster) const
isce3::io::Raster* rngOffsetRaster,
isce3::io::Raster* aziOffsetRaster) const
{
// set flatten flag based range offset raster ptr value
bool flatten = rngOffsetRaster ? true : false;
Expand Down
28 changes: 17 additions & 11 deletions cxx/isce3/cuda/signal/gpuCrossMul.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

#include "forward.h"
#include <isce3/io/forward.h> // Raster
#include <isce3/core/forward.h>

#include <isce3/core/Common.h>
#include <isce3/core/LUT1d.h>
#include <isce3/core/LUT2d.h>

#include <thrust/complex.h>

namespace isce3::cuda::signal {
Expand All @@ -24,28 +26,32 @@ class gpuCrossmul {
* \param[out] coherenceRaster output coherence raster
* \param[in] rngOffsetRaster optional pointer to range offset raster
* if provided, interferogram will be flattened
* \param[in] aziOffsetRaster optional pointer to azimuth offset raster
* it is a placeholder here, and will implement the
* azimuth common band filter based on it
*/
void crossmul(isce3::io::Raster& refSlcRaster,
isce3::io::Raster& secSlcRaster,
isce3::io::Raster& ifgRaster,
isce3::io::Raster& coherenceRaster,
isce3::io::Raster* rngOffsetRaster = nullptr) const;
isce3::io::Raster* rngOffsetRaster = nullptr,
isce3::io::Raster* aziOffsetRaster = nullptr) const;

/** Set doppler LUTs for reference and secondary SLCs*/
void doppler(isce3::core::LUT1d<double> refDoppler,
isce3::core::LUT1d<double> secDoppler);
void doppler(isce3::core::LUT2d<double> refDoppler,
isce3::core::LUT2d<double> secDoppler);

/** Set reference doppler */
inline void refDoppler(isce3::core::LUT1d<double> refDopp) {_refDoppler = refDopp;};
inline void refDoppler(isce3::core::LUT2d<double> refDopp) {_refDoppler = refDopp;};

/** Get reference doppler */
inline const isce3::core::LUT1d<double> & refDoppler() const {return _refDoppler;};
inline const isce3::core::LUT2d<double> & refDoppler() const {return _refDoppler;};

/** Set secondary doppler */
inline void secDoppler(isce3::core::LUT1d<double> secDopp) {_secDoppler = secDopp;};
inline void secDoppler(isce3::core::LUT2d<double> secDopp) {_secDoppler = secDopp;};

/** Get secondary doppler */
inline const isce3::core::LUT1d<double> & secDoppler() const {return _secDoppler;};
inline const isce3::core::LUT2d<double> & secDoppler() const {return _secDoppler;};

/** Set reference and secondary starting range shift */
inline void startingRangeShift(double rng_shift) { _offsetStartingRangeShift = rng_shift; }
Expand Down Expand Up @@ -93,11 +99,11 @@ class gpuCrossmul {
inline bool multiLookEnabled() const { return _multiLookEnabled; }

private:
//Doppler LUT for the reference SLC
isce3::core::LUT1d<double> _refDoppler;
//Doppler LUT for the refernce SLC
isce3::core::LUT2d<double> _refDoppler;

//Doppler LUT for the secondary SLC
isce3::core::LUT1d<double> _secDoppler;
isce3::core::LUT2d<double> _secDoppler;

// starting range shifts between the secondary and reference RSLC in meters
double _offsetStartingRangeShift = 0.0;
Expand Down
23 changes: 11 additions & 12 deletions cxx/isce3/geocode/GeocodeCov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ void Geocode<T>::geocodeInterp(
std::make_unique<isce3::io::Raster>(
vsimem_ref, radar_grid.width(),
radar_grid.length(), 1, GDT_Float32, "ENVI");
rtc_sigma0_raster =
rtc_sigma0_raster =
rtc_raster_sigma0_unique_ptr.get();
} else {
rtc_sigma0_raster = output_rtc_sigma;
Expand Down Expand Up @@ -542,7 +542,7 @@ void Geocode<T>::geocodeInterp(
block_length = geogrid.length();
} else {

if (geocode_memory_mode ==
if (geocode_memory_mode ==
isce3::core::GeocodeMemoryMode::BlocksGeogridAndRadarGrid) {
warning << "WARNING the geocode memory mode"
<< " BlocksGeogridAndRadarGrid is not available"
Expand All @@ -554,7 +554,7 @@ void Geocode<T>::geocodeInterp(
isce3::core::getBlockProcessingParametersY(
geogrid.length(), geogrid.width(), nbands, sizeof(T),
&info, &block_length, &nBlocks, min_block_size, max_block_size);
}
}

info << "number of blocks: " << nBlocks << pyre::journal::newline;
info << "block length: " << block_length << pyre::journal::newline;
Expand Down Expand Up @@ -1012,7 +1012,6 @@ inline void Geocode<T>::_interpolate(
}

if (sub_swaths != nullptr) {

// read the sub-swath value at the center to save the output mask
uint8_t sample_sub_swath_center = sub_swaths->getSampleSubSwath(
rdr_y_rslc, rdr_x_rslc);
Expand Down Expand Up @@ -1047,10 +1046,10 @@ inline void Geocode<T>::_interpolate(
}
}

/*
/*
check within the interpolation kernel (approximated by `interp_margin`)
if any of the samples is marked as shadow or layover-and-shadow
in which case we skip to the next position, i.e., we "break" the
in which case we skip to the next position, i.e., we "break" the
2 inner for-loop bellow (vars: yy and xx) and "continue" from the parent
for-loop (var: kk) above.
*/
Expand Down Expand Up @@ -2079,7 +2078,7 @@ void Geocode<T>::geocodeAreaProj(
output_rtc_sigma == nullptr) {
std::string vsimem_ref = (
"/vsimem/" + getTempString("geocode_cov_areaproj_rtc_sigma0"));
rtc_raster_sigma0_unique_ptr =
rtc_raster_sigma0_unique_ptr =
std::make_unique<isce3::io::Raster>(
vsimem_ref, radar_grid_cropped.width(),
radar_grid_cropped.length(), 1, GDT_Float32, "ENVI");
Expand Down Expand Up @@ -2259,7 +2258,7 @@ void Geocode<T>::geocodeAreaProj(
} else {
isce3::core::getBlockProcessingParametersXY(
imax, jmax, nbands + nbands_off_diag_terms, sizeof(T_out),
&info, &block_size_with_upsampling_y, &nblocks_y,
&info, &block_size_with_upsampling_y, &nblocks_y,
&block_size_with_upsampling_x, &nblocks_x,
min_block_size, max_block_size, geogrid_upsampling);
block_size_x = block_size_with_upsampling_x / geogrid_upsampling;
Expand Down Expand Up @@ -2509,7 +2508,7 @@ void Geocode<T>::_runBlock(
isce3::io::Raster& dem_raster, isce3::io::Raster* out_off_diag_terms,
isce3::io::Raster* out_geo_rdr, isce3::io::Raster* out_geo_dem,
isce3::io::Raster* out_geo_nlooks, isce3::io::Raster* out_geo_rtc,
isce3::io::Raster* out_geo_rtc_gamma0_to_sigma0,
isce3::io::Raster* out_geo_rtc_gamma0_to_sigma0,
isce3::core::ProjectionBase* proj, bool flag_apply_rtc,
bool flag_rtc_raster_is_in_memory, bool flag_rtc_sigma0_raster_is_in_memory,
isce3::io::Raster* rtc_raster, isce3::io::Raster* rtc_sigma0_raster,
Expand Down Expand Up @@ -2905,7 +2904,7 @@ void Geocode<T>::_runBlock(
this_block_size_y, this_block_size_x));

nan_t_out *= std::numeric_limits<T_out_real>::quiet_NaN();

for (int band = 0; band < nbands; ++band)
geoDataBlock[band]->fill(nan_t_out);

Expand Down Expand Up @@ -3286,7 +3285,7 @@ void Geocode<T>::_runBlock(
also need to add `offset_x` and `offset_y` that represent the offsets
in X- and Y- directions over the radar-grid coordinates.

in which case we skip to the next position, i.e., we "break" the
in which case we skip to the next position, i.e., we "break" the
2 inner for-loop bellow (vars: yy and xx) and "continue" from the parent
for-loop (var: kk) above.
*/
Expand Down Expand Up @@ -3647,7 +3646,7 @@ std::string _get_geocode_memory_mode_str(
}

template<class T>
void Geocode<T>::_print_parameters(pyre::journal::info_t& channel,
void Geocode<T>::_print_parameters(pyre::journal::info_t& channel,
isce3::core::GeocodeMemoryMode& geocode_memory_mode,
const long long min_block_size,
const long long max_block_size) {
Expand Down
5 changes: 5 additions & 0 deletions cxx/isce3/math/Sinc.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#pragma once

#include <isce3/core/Common.h>
#include <complex>

namespace isce3 { namespace math {

/** sinc function defined as \f$ \frac{\sin(\pi x)}{\pi x} \f$ */
template<typename T>
CUDA_HOSTDEV
std::complex<T> sinc(std::complex<T> t);

template<typename T>
CUDA_HOSTDEV
T sinc(T t);
Expand Down
25 changes: 25 additions & 0 deletions cxx/isce3/math/Sinc.icc
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,29 @@ T sinc(T t)
return std::sin(x) / x;
}

template<typename T>
CUDA_HOSTDEV
inline
std::complex<T> sinc(std::complex<T> t)
{
static_assert(std::is_floating_point<T>::value);

using U = typename std::remove_cv<T>::type;
static constexpr auto eps1 = detail::root_epsilon<U>();
static constexpr auto eps2 = detail::fourth_root_epsilon<U>();

auto u = T(M_PI) * t;
auto x = std::abs(u);

// approximate by Taylor series expansion near zero
if (x < eps2) {
std::complex<T> out = static_cast<T>(1);
if (x > eps1) {
out -= u * u / static_cast<T>(6);
}
return out;
}
return std::sin(u) / u;
}

}}
14 changes: 7 additions & 7 deletions cxx/isce3/product/RadarGridProduct.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace isce3 { namespace product {
/**
* Return the path to each child group of `group` that ends with the substring
* `group_name`.
*
*
* \param[in] group Parent group
* \param[in] group_name Search string
* \returns List of child group paths
Expand All @@ -39,13 +39,13 @@ std::vector<std::string> findGroupPath(
* Return grids or swaths group paths within the base_group.
* Start by assigning an empty string to image_group_str in case
* grids and swaths group are not found.
*
*
* \param[in] file
* \param[in] base_dir Path to `base_group` object (e.g. '/science/')
* \param[in] base_group Base group
* \param[in] key_vector Vector containing possible image groups
* (e.g., 'swaths', 'grids', or both) to look for
* \param[out] image_group_str Path to first image group found containing
* \param[out] image_group_str Path to first image group found containing
* one of the `key_vector` keys (e.g., '/science/LSAR/RSLC/swaths')
* \param[in] metadata_group_str Path to first metadata group found by
* substituting `key` with `metadata` in `image_group_str`
Expand All @@ -60,10 +60,10 @@ void setImageMetadataGroupStr(
std::string &metadata_group_str);

/** RadarGridProduct class declaration
*
*
* The Produt attribute Swaths map, i.e. _swaths, associates the
* frequency (key) with the Swath object (value). The RadarGridProduct object
* is usually initiated with an empty map and the serialization of
* frequency (key) with the Swath object (value). The RadarGridProduct object
* is usually initiated with an empty map and the serialization of
* the SAR product is responsible for populating the Swath map
* from the product's metadata.
*
Expand All @@ -75,7 +75,7 @@ class RadarGridProduct {
RadarGridProduct(isce3::io::IH5File &);
/** Constructor with Metadata and Swath map. */
inline RadarGridProduct(const Metadata &, const std::map<char, isce3::product::Swath> &);

/** Get a read-only reference to the metadata */
inline const Metadata & metadata() const { return _metadata; }
/** Get a reference to the metadata. */
Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/product/Swath.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class isce3::product::Swath {
inline isce3::product::SubSwaths& subSwaths() {
return _subSwaths;
}

inline const isce3::product::SubSwaths& subSwaths() const {
return _subSwaths;
}
Expand Down
Loading
Loading