Skip to content

Commit 21df93e

Browse files
gshiromaGustavo H ShiromaLiang Yugmgunter
authored andcommitted
Read metadata from NISAR L2 products (#781)
* add Grid class at the C++ level * add Python binding of the Grid class * update C++ Product class with the new Grid class * update Python Product class with the new Grid class * add serialization of the Grid class from the HDF5 file * update product forward.h with the Grid class * add classes Grid and Product to the Python product namespace * generalize Base class to other products than SLC * add new Python (Pybind11) Grid and ProductClass classes to Sources.cmake * add ProductFactory() class * make method setProductType() private * set productType as RSLC regardless of the HDF5 group RSLC/SLC * update value assignment of productType in Base and SLC classes * simplify _setProduct method of SLC class after changes in ProductFactory * make Base.py general for LSAR and SSAR frequency bands * avoid memory allocation and string copying * add comments to Product.cpp and limit the maximum number of grids/swaths and identification groups to 1 * add function to find unique group paths (excluding repeated occurrences) * add unitest to ProductFactory class * add getProductTypeFromHdf5File to ProductFactory.py * fix ProductFactory for GSLC products (2) * fix extractWithIterator for val undefined if KeyError exception is raised * fix broken ProductFactory.py after updates * create open_nisar_product and move ProductFactory to GenericProduct * rename open_nisar_product() to open_product() * substitute backslashes with parenthesis for line continuation * substitute get_product_type_from_hdf5File() with get_product_type_from_hdf5_file() * improve docstrings and function/variable names * if logger is declared (not None) use logger to raise an exception in h5prep * send exceptions to pyre journal rather than raising default python exceptions * declare pyre error channel locally * fix typos * rename python/packages/pybind_nisar to python/packages/nisar * rename pybind_nisar to nisar (2) * rename pybind_nisar to nisar (3) * remove commented code * fix comment in serialization of Grid metadata * handle the potential case where "frequencyA" does not exist in serialization of Grid metadata * remove unnecessary includes * add docstrings to Grid class * remove commented code * add units to Grid class attributes * comment serialization of zeroDopplerTimeSpacing in Grid metadata * check if frequencyA exists before serializing swath for that frequency * separate L2 products class (new L2Product class) from c++ Product class * add unitest to pybind11 class: Grid * copy zero Doppler time spacing from RSLC to GCOV/GSLC products * update golden dataset and Grid unitest for updated zeroDopplerTimeSpacing fields * add comments to explain map association for C++ Product and L2Product classes * Update cxx/isce3/product/L2Product.h Co-authored-by: Geoffrey M Gunter <[email protected]> * Update cxx/isce3/product/Product.h Co-authored-by: Geoffrey M Gunter <[email protected]> * pass std::string and std::vector by reference rather than by value * remove unused includes * add description to new GCOV sample product nisar_129_gcov_crop.h5 * update docstring of function findGroupPath() * update docstring of function setImageMetadataGroupStr() * rename Product to RadarGridProduct and L2Product to GeoGridProduct * remove blank line * remove cxx/isce3/geocode/interpolate.h Co-authored-by: Gustavo H Shiroma <[email protected]> Co-authored-by: Liang Yu <[email protected]> Co-authored-by: Geoffrey M Gunter <[email protected]>
1 parent d541a52 commit 21df93e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+759
-164
lines changed

cxx/isce3/Headers.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ product/forward.h
139139
product/GeoGridParameters.h
140140
product/Metadata.h
141141
product/ProcessingInformation.h
142-
product/Product.h
142+
product/RadarGridProduct.h
143+
product/GeoGridProduct.h
143144
product/RadarGridParameters.h
144145
product/Serialization.h
145146
product/Swath.h

cxx/isce3/Sources.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ math/polyfunc.cpp
6767
math/RootFind1dNewton.cpp
6868
math/RootFind1dSecant.cpp
6969
polsar/symmetrize.cpp
70-
product/GeoGridParameters.cpp
71-
product/Product.cpp
7270
product/RadarGridParameters.cpp
71+
product/GeoGridParameters.cpp
72+
product/RadarGridProduct.cpp
73+
product/GeoGridProduct.cpp
7374
signal/Covariance.cpp
7475
signal/Crossmul.cpp
7576
signal/CrossMultiply.cpp

cxx/isce3/cuda/geometry/Geo2rdr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
class isce3::cuda::geometry::Geo2rdr : public isce3::geometry::Geo2rdr {
1818

1919
public:
20-
/** Constructor from Product */
21-
inline Geo2rdr(const isce3::product::Product & product,
20+
/** Constructor from RadarGridProduct */
21+
inline Geo2rdr(const isce3::product::RadarGridProduct & product,
2222
char frequency = 'A',
2323
bool nativeDoppler = false) :
2424
isce3::geometry::Geo2rdr(product, frequency, nativeDoppler) {}

cxx/isce3/cuda/geometry/Topo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
class isce3::cuda::geometry::Topo : public isce3::geometry::Topo {
1818

1919
public:
20-
/** Constructor from Product */
21-
inline Topo(const isce3::product::Product & product,
20+
/** Constructor from RadarGridProduct */
21+
inline Topo(const isce3::product::RadarGridProduct & product,
2222
char frequency = 'A',
2323
bool nativeDoppler = false) :
2424
isce3::geometry::Topo(product, frequency, nativeDoppler){}

cxx/isce3/cuda/geometry/gpuRTC.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <isce3/geometry/DEMInterpolator.h>
2121
#include <isce3/geometry/RTC.h>
2222
#include <isce3/geometry/Topo.h>
23-
#include <isce3/product/Product.h>
23+
#include <isce3/product/RadarGridProduct.h>
2424

2525
#include <isce3/cuda/core/gpuLUT1d.h>
2626
#include <isce3/cuda/core/Orbit.h>
@@ -271,7 +271,7 @@ namespace isce3 { namespace cuda {
271271

272272
namespace geometry {
273273

274-
void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem,
274+
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem,
275275
isce3::io::Raster& out_raster, char frequency)
276276
{
277277

cxx/isce3/cuda/geometry/gpuRTC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
#include <isce3/product/forward.h>
55

66
namespace isce3 { namespace cuda { namespace geometry {
7-
void computeRtc(isce3::product::Product& product, isce3::io::Raster& dem,
7+
void computeRtc(isce3::product::RadarGridProduct& product, isce3::io::Raster& dem,
88
isce3::io::Raster& out_raster, char frequency = 'A');
99
}}}

cxx/isce3/cuda/image/ResampSlc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class isce3::cuda::image::ResampSlc : public isce3::image::ResampSlc {
1010

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

17-
// Constructor from an isce3::product::Product and reference product (flattening)
18-
inline ResampSlc(const isce3::product::Product & product,
19-
const isce3::product::Product & refProduct,
17+
// Constructor from an isce3::product::RadarGridProduct and reference product (flattening)
18+
inline ResampSlc(const isce3::product::RadarGridProduct & product,
19+
const isce3::product::RadarGridProduct & refProduct,
2020
char frequency = 'A') :
2121
isce3::image::ResampSlc(product, refProduct, frequency) {}
2222

cxx/isce3/geocode/GeocodeCov.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <isce3/io/Raster.h>
1616

1717
// isce3::product
18-
#include <isce3/product/Product.h>
18+
#include <isce3/product/RadarGridProduct.h>
1919
#include <isce3/product/RadarGridParameters.h>
2020

2121
// isce3::geometry

cxx/isce3/geocode/geocodeSlc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <isce3/geometry/geometry.h>
1515
#include <isce3/io/Raster.h>
1616
#include <isce3/product/GeoGridParameters.h>
17-
#include <isce3/product/Product.h>
17+
#include <isce3/product/RadarGridProduct.h>
1818
#include <isce3/product/RadarGridParameters.h>
1919

2020

cxx/isce3/geometry/Geo2rdr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <isce3/io/Raster.h>
2323

2424
// isce3::product
25-
#include <isce3/product/Product.h>
25+
#include <isce3/product/RadarGridProduct.h>
2626
#include <isce3/product/RadarGridParameters.h>
2727

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

0 commit comments

Comments
 (0)