Skip to content

Commit

Permalink
Merge pull request #9 from jungkyoj/develop
Browse files Browse the repository at this point in the history
rebase PR with the most recent develop
  • Loading branch information
jungkyoJung authored and GitHub Enterprise committed Mar 17, 2022
2 parents e45bcb4 + e6fc3ba commit b820cb0
Show file tree
Hide file tree
Showing 94 changed files with 11,901 additions and 196 deletions.
11 changes: 10 additions & 1 deletion cxx/isce3/Headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ product/forward.h
product/GeoGridParameters.h
product/Metadata.h
product/ProcessingInformation.h
product/Product.h
product/RadarGridProduct.h
product/GeoGridProduct.h
product/RadarGridParameters.h
product/Serialization.h
product/Swath.h
Expand Down Expand Up @@ -171,6 +172,14 @@ unwrap/icu/LabelMap.icc
unwrap/icu/PhaseGrad.h
unwrap/icu/SearchTable.h
unwrap/icu/SearchTable.icc
unwrap/ortools/ebert_graph.h
unwrap/ortools/graph.h
unwrap/ortools/graphs.h
unwrap/ortools/iterators.h
unwrap/ortools/max_flow.h
unwrap/ortools/min_cost_flow.h
unwrap/ortools/permutation.h
unwrap/ortools/zvector.h
unwrap/phass/ASSP.h
unwrap/phass/BMFS.h
unwrap/phass/CannyEdgeDetector.h
Expand Down
7 changes: 5 additions & 2 deletions cxx/isce3/Sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ math/polyfunc.cpp
math/RootFind1dNewton.cpp
math/RootFind1dSecant.cpp
polsar/symmetrize.cpp
product/GeoGridParameters.cpp
product/Product.cpp
product/RadarGridParameters.cpp
product/GeoGridParameters.cpp
product/RadarGridProduct.cpp
product/GeoGridProduct.cpp
signal/Covariance.cpp
signal/Crossmul.cpp
signal/CrossMultiply.cpp
Expand All @@ -90,6 +91,8 @@ unwrap/icu/PhaseGrad.cpp
unwrap/icu/Residue.cpp
unwrap/icu/Tree.cpp
unwrap/icu/Unwrap.cpp
unwrap/ortools/max_flow.cc
unwrap/ortools/min_cost_flow.cc
unwrap/phass/ASSP.cc
unwrap/phass/BMFS.cc
unwrap/phass/CannyEdgeDetector.cc
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/cuda/geometry/Geo2rdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class isce3::cuda::geometry::Geo2rdr : public isce3::geometry::Geo2rdr {

public:
/** Constructor from Product */
inline Geo2rdr(const isce3::product::Product & product,
/** Constructor from RadarGridProduct */
inline Geo2rdr(const isce3::product::RadarGridProduct & product,
char frequency = 'A',
bool nativeDoppler = false) :
isce3::geometry::Geo2rdr(product, frequency, nativeDoppler) {}
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/cuda/geometry/Topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
class isce3::cuda::geometry::Topo : public isce3::geometry::Topo {

public:
/** Constructor from Product */
inline Topo(const isce3::product::Product & product,
/** Constructor from RadarGridProduct */
inline Topo(const isce3::product::RadarGridProduct & product,
char frequency = 'A',
bool nativeDoppler = false) :
isce3::geometry::Topo(product, frequency, nativeDoppler){}
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/cuda/geometry/gpuRTC.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <isce3/geometry/DEMInterpolator.h>
#include <isce3/geometry/RTC.h>
#include <isce3/geometry/Topo.h>
#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>

#include <isce3/cuda/core/gpuLUT1d.h>
#include <isce3/cuda/core/Orbit.h>
Expand Down Expand Up @@ -271,7 +271,7 @@ namespace isce3 { namespace cuda {

namespace geometry {

void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem,
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem,
isce3::io::Raster& out_raster, char frequency)
{

Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/cuda/geometry/gpuRTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
#include <isce3/product/forward.h>

namespace isce3 { namespace cuda { namespace geometry {
void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem,
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem,
isce3::io::Raster& out_raster, char frequency = 'A');
}}}
10 changes: 5 additions & 5 deletions cxx/isce3/cuda/image/ResampSlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class isce3::cuda::image::ResampSlc : public isce3::image::ResampSlc {

public:
// Meta-methods
// Constructor from an isce3::product::Product
inline ResampSlc(const isce3::product::Product &product, char frequency = 'A') :
// Constructor from an isce3::product::RadarGridProduct
inline ResampSlc(const isce3::product::RadarGridProduct &product, char frequency = 'A') :
isce3::image::ResampSlc(product, frequency) {}

// Constructor from an isce3::product::Product and reference product (flattening)
inline ResampSlc(const isce3::product::Product & product,
const isce3::product::Product & refProduct,
// Constructor from an isce3::product::RadarGridProduct and reference product (flattening)
inline ResampSlc(const isce3::product::RadarGridProduct & product,
const isce3::product::RadarGridProduct & refProduct,
char frequency = 'A') :
isce3::image::ResampSlc(product, refProduct, frequency) {}

Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/geocode/GeocodeCov.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <isce3/io/Raster.h>

// isce3::product
#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>
#include <isce3/product/RadarGridParameters.h>

// isce3::geometry
Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/geocode/geocodeSlc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <isce3/geometry/geometry.h>
#include <isce3/io/Raster.h>
#include <isce3/product/GeoGridParameters.h>
#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>
#include <isce3/product/RadarGridParameters.h>


Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/geometry/Geo2rdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <isce3/io/Raster.h>

// isce3::product
#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>
#include <isce3/product/RadarGridParameters.h>

#include <limits>
Expand Down Expand Up @@ -50,7 +50,7 @@ class isce3::geometry::Geo2rdr {
* @param[in] frequency Frequency designation
* @param[in] nativeDoppler Flag for using native Doppler frequencies instead of zero-Doppler
*/
Geo2rdr(const isce3::product::Product &,
Geo2rdr(const isce3::product::RadarGridProduct &,
char frequency = 'A',
bool nativeDoppler = false);

Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/geometry/Geo2rdr.icc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

inline
isce3::geometry::Geo2rdr::
Geo2rdr(const isce3::product::Product & product,
Geo2rdr(const isce3::product::RadarGridProduct & product,
char frequency,
bool nativeDoppler)
:
Expand Down
2 changes: 1 addition & 1 deletion cxx/isce3/geometry/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void areaProjGetNBlocks(const int array_length, const int array_width,
}
}

void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem_raster,
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem_raster,
isce3::io::Raster& output_raster, char frequency, bool native_doppler,
rtcInputTerrainRadiometry input_terrain_radiometry,
rtcOutputTerrainRadiometry output_terrain_radiometry,
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/geometry/RTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void applyRtc(const isce3::product::RadarGridParameters& radarGrid,
/** Generate radiometric terrain correction (RTC) area or area normalization
* factor
*
* @param[in] product Product
* @param[in] product RadarGridProduct
* @param[in] dem_raster Input DEM raster
* @param[out] output_raster Output raster
* @param[in] frequency Product frequency
Expand All @@ -116,7 +116,7 @@ void applyRtc(const isce3::product::RadarGridParameters& radarGrid,
* looks associated with the geogrid will be saved
* @param[in] rtc_memory_mode Select memory mode
* */
void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem_raster,
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem_raster,
isce3::io::Raster& output_raster, char frequency = 'A',
bool native_doppler = false,
rtcInputTerrainRadiometry inputTerrainRadiometry =
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/geometry/Topo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <isce3/core/DenseMatrix.h>
#include <isce3/core/Utilities.h>

#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>

// isce3::geometry
#include <isce3/geometry/RTC.h>
Expand All @@ -32,7 +32,7 @@ using isce3::core::Vec3;
using isce3::io::Raster;

isce3::geometry::Topo::
Topo(const isce3::product::Product & product,
Topo(const isce3::product::RadarGridProduct & product,
char frequency,
bool nativeDoppler)
:
Expand Down
4 changes: 2 additions & 2 deletions cxx/isce3/geometry/Topo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class isce3::geometry::Topo {
/**
* Constructor using a product
*
* @param[in] product Input Product
* @param[in] product Input RadarGridProduct
* @param[in] frequency Frequency designation
* @param[in] nativeDoppler Flag for using native Doppler frequencies instead of zero-Doppler
*/
Topo(const isce3::product::Product &,
Topo(const isce3::product::RadarGridProduct &,
char frequency = 'A',
bool nativeDoppler = false);

Expand Down
14 changes: 7 additions & 7 deletions cxx/isce3/image/ResampSlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include <isce3/core/Interpolator.h>
#include <isce3/core/Poly2d.h>
#include <isce3/product/Product.h>
#include <isce3/product/RadarGridProduct.h>
#include <isce3/product/RadarGridParameters.h>

namespace isce3 { namespace image {
Expand All @@ -21,15 +21,15 @@ class ResampSlc {
public:
typedef Tile<std::complex<float>> Tile_t;

/** Constructor from an isce3::product::Product (no flattening) */
ResampSlc(const isce3::product::Product& product, char frequency = 'A');
/** Constructor from an isce3::product::RadarGridProduct (no flattening) */
ResampSlc(const isce3::product::RadarGridProduct& product, char frequency = 'A');

/**
* Constructor from an isce3::product::Product and reference product
* Constructor from an isce3::product::RadarGridProduct and reference product
* (flattening)
*/
ResampSlc(const isce3::product::Product& product,
const isce3::product::Product& refProduct, char frequency = 'A');
ResampSlc(const isce3::product::RadarGridProduct& product,
const isce3::product::RadarGridProduct& refProduct, char frequency = 'A');

/** Constructor from an isce3::product::Swath (no flattening) */
ResampSlc(const isce3::product::Swath& swath);
Expand Down Expand Up @@ -97,7 +97,7 @@ class ResampSlc {
void doppler(const isce3::core::LUT2d<double>&);

// Set reference product for flattening
void referenceProduct(const isce3::product::Product& product,
void referenceProduct(const isce3::product::RadarGridProduct& product,
char frequency = 'A');

// Get/set number of lines per processing tile
Expand Down
12 changes: 6 additions & 6 deletions cxx/isce3/image/ResampSlc.icc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace isce3 { namespace image {

// Constructor from an isce3::product::Product
inline ResampSlc::ResampSlc(const isce3::product::Product& product,
// Constructor from an isce3::product::RadarGridProduct
inline ResampSlc::ResampSlc(const isce3::product::RadarGridProduct& product,
char frequency)
: ResampSlc(product.swath(frequency))
{
Expand All @@ -15,10 +15,10 @@ inline ResampSlc::ResampSlc(const isce3::product::Product& product,
_filename = product.filename();
}

// Constructor from an isce3::product::Product and reference product
// Constructor from an isce3::product::RadarGridProduct and reference product
// (flattening)
inline ResampSlc::ResampSlc(const isce3::product::Product& product,
const isce3::product::Product& refProduct,
inline ResampSlc::ResampSlc(const isce3::product::RadarGridProduct& product,
const isce3::product::RadarGridProduct& refProduct,
char frequency)
: ResampSlc(product.swath(frequency), refProduct.swath(frequency))
{
Expand Down Expand Up @@ -146,7 +146,7 @@ inline void ResampSlc::doppler(const isce3::core::LUT2d<double>& lut)

// Set reference product
inline void
ResampSlc::referenceProduct(const isce3::product::Product& refProduct,
ResampSlc::referenceProduct(const isce3::product::RadarGridProduct& refProduct,
char frequency)
{
_setRefDataFromSwath(refProduct.swath(frequency));
Expand Down
58 changes: 58 additions & 0 deletions cxx/isce3/product/GeoGridProduct.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "GeoGridProduct.h"
#include <isce3/product/RadarGridProduct.h>
#include <isce3/product/Serialization.h>

/** @param[in] file IH5File object for product. */
isce3::product::GeoGridProduct::
GeoGridProduct(isce3::io::IH5File & file) {

std::string base_dir = "/science/";

isce3::io::IGroup base_group = file.openGroup(base_dir);
std::vector<std::string> key_vector = {"grids"};

std::string image_group_str = "", metadata_group_str;
setImageMetadataGroupStr(file, base_dir, base_group, key_vector,
image_group_str, metadata_group_str);

// If did not find HDF5 groups grids
if (image_group_str.size() == 0) {
std::string error_msg = ("ERROR grids groups not found in " +
file.getFileName());
throw isce3::except::RuntimeError(ISCE_SRCINFO(), error_msg);
}

// Get grids group
isce3::io::IGroup imGroup = file.openGroup(image_group_str);

// Configure grids
loadFromH5(imGroup, _grids);

// Get metadata group
isce3::io::IGroup metaGroup = file.openGroup(metadata_group_str);
// Configure metadata

loadFromH5(metaGroup, _metadata);

// Get look direction
auto identification_vector = isce3::product::findGroupPath(base_group, "identification");
if (identification_vector.size() == 0) {
std::string error_msg = ("ERROR identification group not found in " +
file.getFileName());
throw isce3::except::RuntimeError(ISCE_SRCINFO(), error_msg);
} else if (identification_vector.size() > 1) {
std::string error_msg = ("ERROR there should be only one identification"
" group in " +
file.getFileName());
throw isce3::except::RuntimeError(ISCE_SRCINFO(), error_msg);
}

std::string identification_group_str = base_dir + identification_vector[0];
std::string lookDir;
isce3::io::loadFromH5(
file, identification_group_str + "/lookDirection", lookDir);
lookSide(lookDir);

// Save the filename
_filename = file.filename();
}
Loading

0 comments on commit b820cb0

Please sign in to comment.