forked from isce-framework/isce3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* buildable untested CPU pybind of ResampSlc * added RadarGridParameters constructor This constructor is more direct than making a lambda constructor in pybind. * bound new RadarGridParameter constructor and linesPerTile property * test code for pybind CPU resamp * adding RadarGridParameters constructor to CUDA ResampSlc * buildable untested CUDA pybind of ResampSlc * test code for pybind CUDA resamp
- Loading branch information
Liang Yu
authored and
GitHub Enterprise
committed
Aug 14, 2020
1 parent
fa3d0a4
commit 5151f15
Showing
17 changed files
with
394 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#include "ResampSlc.h" | ||
|
||
#include <isce3/core/Constants.h> | ||
#include <isce3/core/LUT2d.h> | ||
#include <isce3/io/Raster.h> | ||
|
||
using isce3::cuda::image::ResampSlc; | ||
|
||
namespace py = pybind11; | ||
|
||
void addbinding(py::class_<ResampSlc> & pyResampSlc) | ||
{ | ||
pyResampSlc | ||
.def(py::init<const isce3::core::LUT2d<double> &, double, double, | ||
double, double, double>(), | ||
py::arg("doppler"), | ||
py::arg("start_range"), | ||
py::arg("range_pixel_spacing"), | ||
py::arg("sensing_start"), | ||
py::arg("prf"), | ||
py::arg("wavelength")) | ||
.def(py::init<const isce3::core::LUT2d<double> &, double, double, | ||
double, double, double, double, double, double>(), | ||
py::arg("doppler"), | ||
py::arg("start_range"), | ||
py::arg("range_pixel_spacing"), | ||
py::arg("sensing_start"), | ||
py::arg("prf"), | ||
py::arg("wavelength"), | ||
py::arg("ref_start_range"), | ||
py::arg("ref_range_pixel_spacing"), | ||
py::arg("ref_wavelength")) | ||
.def(py::init<const isce3::product::RadarGridParameters &, | ||
const isce3::core::LUT2d<double> &, double>(), | ||
py::arg("rdr_grid"), | ||
py::arg("doppler"), | ||
py::arg("wavelength")) | ||
.def(py::init<const isce3::product::RadarGridParameters &, | ||
const isce3::product::RadarGridParameters &, | ||
const isce3::core::LUT2d<double> &, double, double>(), | ||
py::arg("rdr_grid"), | ||
py::arg("ref_rdr_grid"), | ||
py::arg("doppler"), | ||
py::arg("ref_wavelength"), | ||
py::arg("wavelength")) | ||
.def_property("doppler", | ||
py::overload_cast<>(&ResampSlc::doppler, py::const_), | ||
&ResampSlc::doppler) | ||
.def_property("lines_per_tile", | ||
py::overload_cast<>(&ResampSlc::linesPerTile, py::const_), | ||
py::overload_cast<size_t>(&ResampSlc::linesPerTile)) | ||
.def_property_readonly("start_range", &ResampSlc::startingRange) | ||
.def_property_readonly("range_pixel_spacing", &ResampSlc::rangePixelSpacing) | ||
.def_property_readonly("sensing_start", &ResampSlc::sensingStart) | ||
.def_property_readonly("prf", &ResampSlc::prf) | ||
.def_property_readonly("wavelength", &ResampSlc::wavelength) | ||
.def_property_readonly("ref_start_range", &ResampSlc::refStartingRange) | ||
.def_property_readonly("ref_range_pixel_spacing", &ResampSlc::refRangePixelSpacing) | ||
.def_property_readonly("ref_wavelength", &ResampSlc::refWavelength) | ||
.def("resamp", py::overload_cast<isce3::io::Raster &, isce3::io::Raster &, | ||
isce3::io::Raster &, isce3::io::Raster &, | ||
int, bool, bool, int , int>(&ResampSlc::resamp), | ||
py::arg("input_slc"), | ||
py::arg("output_slc"), | ||
py::arg("rg_offset_raster"), | ||
py::arg("az_offset_raster"), | ||
py::arg("input_band") = 1, | ||
py::arg("flatten") = false, | ||
py::arg("is_complex") = true, | ||
py::arg("row_buffer") = 40, | ||
py::arg("chip_size") = isce3::core::SINC_ONE) | ||
.def("resamp", py::overload_cast<const std::string &, const std::string &, | ||
const std::string & , const std::string &, | ||
int, bool, bool, int, int>(&ResampSlc::resamp), | ||
py::arg("input_filename"), | ||
py::arg("output_filename"), | ||
py::arg("rg_offset_filename"), | ||
py::arg("az_offset_filename"), | ||
py::arg("input_band") = 1, | ||
py::arg("flatten") = false, | ||
py::arg("is_complex") = true, | ||
py::arg("row_buffer") = 40, | ||
py::arg("chip_size") = isce3::core::SINC_ONE) | ||
; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <isce3/cuda/image/ResampSlc.h> | ||
#include <pybind11/pybind11.h> | ||
|
||
void addbinding(pybind11::class_<isce3::cuda::image::ResampSlc>&); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "image.h" | ||
|
||
#include "ResampSlc.h" | ||
|
||
namespace py = pybind11; | ||
|
||
void addsubmodule_cuda_image(py::module & m) | ||
{ | ||
py::module m_image = m.def_submodule("image"); | ||
|
||
// forward declare bound classes | ||
py::class_<isce3::cuda::image::ResampSlc> pyResampSlc(m_image, "ResampSlc"); | ||
|
||
// add bindings | ||
addbinding(pyResampSlc); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
void addsubmodule_cuda_image(pybind11::module &); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#include "ResampSlc.h" | ||
|
||
#include <isce3/core/Constants.h> | ||
#include <isce3/core/LUT2d.h> | ||
#include <isce3/io/Raster.h> | ||
|
||
using isce3::image::ResampSlc; | ||
|
||
namespace py = pybind11; | ||
|
||
void addbinding(py::class_<ResampSlc> & pyResampSlc) | ||
{ | ||
pyResampSlc | ||
.def(py::init<const isce3::core::LUT2d<double> &, double, double, | ||
double, double, double>(), | ||
py::arg("doppler"), | ||
py::arg("start_range"), | ||
py::arg("range_pixel_spacing"), | ||
py::arg("sensing_start"), | ||
py::arg("prf"), | ||
py::arg("wavelength")) | ||
.def(py::init<const isce3::core::LUT2d<double> &, double, double, | ||
double, double, double, double, double, double>(), | ||
py::arg("doppler"), | ||
py::arg("start_range"), | ||
py::arg("range_pixel_spacing"), | ||
py::arg("sensing_start"), | ||
py::arg("prf"), | ||
py::arg("wavelength"), | ||
py::arg("ref_start_range"), | ||
py::arg("ref_range_pixel_spacing"), | ||
py::arg("ref_wavelength")) | ||
.def(py::init<const isce3::product::RadarGridParameters &, | ||
const isce3::core::LUT2d<double> &, double>(), | ||
py::arg("rdr_grid"), | ||
py::arg("doppler"), | ||
py::arg("wavelength")) | ||
.def(py::init<const isce3::product::RadarGridParameters &, | ||
const isce3::product::RadarGridParameters &, | ||
const isce3::core::LUT2d<double> &, double, double>(), | ||
py::arg("rdr_grid"), | ||
py::arg("ref_rdr_grid"), | ||
py::arg("doppler"), | ||
py::arg("ref_wavelength"), | ||
py::arg("wavelength")) | ||
.def_property("doppler", | ||
py::overload_cast<>(&ResampSlc::doppler, py::const_), | ||
&ResampSlc::doppler) | ||
.def_property("lines_per_tile", | ||
py::overload_cast<>(&ResampSlc::linesPerTile, py::const_), | ||
py::overload_cast<size_t>(&ResampSlc::linesPerTile)) | ||
.def_property_readonly("start_range", &ResampSlc::startingRange) | ||
.def_property_readonly("range_pixel_spacing", &ResampSlc::rangePixelSpacing) | ||
.def_property_readonly("sensing_start", &ResampSlc::sensingStart) | ||
.def_property_readonly("prf", &ResampSlc::prf) | ||
.def_property_readonly("wavelength", &ResampSlc::wavelength) | ||
.def_property_readonly("ref_start_range", &ResampSlc::refStartingRange) | ||
.def_property_readonly("ref_range_pixel_spacing", &ResampSlc::refRangePixelSpacing) | ||
.def_property_readonly("ref_wavelength", &ResampSlc::refWavelength) | ||
.def("resamp", py::overload_cast<isce3::io::Raster &, isce3::io::Raster &, | ||
isce3::io::Raster &, isce3::io::Raster &, | ||
int, bool, bool, int , int>(&ResampSlc::resamp), | ||
py::arg("input_slc"), | ||
py::arg("output_slc"), | ||
py::arg("rg_offset_raster"), | ||
py::arg("az_offset_raster"), | ||
py::arg("input_band") = 1, | ||
py::arg("flatten") = false, | ||
py::arg("is_complex") = true, | ||
py::arg("row_buffer") = 40, | ||
py::arg("chip_size") = isce3::core::SINC_ONE) | ||
.def("resamp", py::overload_cast<const std::string &, const std::string &, | ||
const std::string & , const std::string &, | ||
int, bool, bool, int, int>(&ResampSlc::resamp), | ||
py::arg("input_filename"), | ||
py::arg("output_filename"), | ||
py::arg("rg_offset_filename"), | ||
py::arg("az_offset_filename"), | ||
py::arg("input_band") = 1, | ||
py::arg("flatten") = false, | ||
py::arg("is_complex") = true, | ||
py::arg("row_buffer") = 40, | ||
py::arg("chip_size") = isce3::core::SINC_ONE) | ||
; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <isce3/image/ResampSlc.h> | ||
#include <pybind11/pybind11.h> | ||
|
||
void addbinding(pybind11::class_<isce3::image::ResampSlc>&); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "image.h" | ||
|
||
#include "ResampSlc.h" | ||
|
||
namespace py = pybind11; | ||
|
||
void addsubmodule_image(py::module & m) | ||
{ | ||
py::module m_image = m.def_submodule("image"); | ||
|
||
// forward declare bound classes | ||
py::class_<isce3::image::ResampSlc> pyResampSlc(m_image, "ResampSlc"); | ||
|
||
// add bindings | ||
addbinding(pyResampSlc); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
void addsubmodule_image(pybind11::module &); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.