File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -728,8 +728,15 @@ void Geocode<T>::geocodeAreaProj(
728
728
<< pyre::journal::newline;
729
729
assert (out_off_diag_terms->numBands () == nbands_off_diag_terms);
730
730
info << " full covariance: true" << pyre::journal::newline;
731
- assert (isce3::is_complex<T>());
732
- assert (GDALDataTypeIsComplex (out_off_diag_terms->dtype ()));
731
+ if (!GDALDataTypeIsComplex (input_raster.dtype ())){
732
+ std::string error_msg = " Input raster must be complex to"
733
+ " generate full-covariance matrix" ;
734
+ throw isce3::except::InvalidArgument (ISCE_SRCINFO (), error_msg);
735
+ }
736
+ if (!GDALDataTypeIsComplex (out_off_diag_terms->dtype ())){
737
+ std::string error_msg = " Off-diagonal raster must be complex" ;
738
+ throw isce3::except::InvalidArgument (ISCE_SRCINFO (), error_msg);
739
+ }
733
740
} else {
734
741
info << " nbands: " << nbands << pyre::journal::newline;
735
742
info << " full covariance: false" << pyre::journal::newline;
Original file line number Diff line number Diff line change @@ -299,8 +299,15 @@ void GeocodePolygon<T>::_getPolygonMean(
299
299
<< pyre::journal::endl;
300
300
assert (output_off_diag_terms->numBands () == nbands_off_diag_terms);
301
301
_info << " full covariance: true" << pyre::journal::endl;
302
- assert (is_complex_t <T>());
303
- assert (GDALDataTypeIsComplex (output_off_diag_terms->dtype ()));
302
+ if (!GDALDataTypeIsComplex (input_raster.dtype ())){
303
+ std::string error_msg = " Input raster must be complex to"
304
+ " generate full-covariance matrix" ;
305
+ throw isce3::except::InvalidArgument (ISCE_SRCINFO (), error_msg);
306
+ }
307
+ if (!GDALDataTypeIsComplex (output_off_diag_terms->dtype ())){
308
+ std::string error_msg = " Off-diagonal raster must be complex" ;
309
+ throw isce3::except::InvalidArgument (ISCE_SRCINFO (), error_msg);
310
+ }
304
311
} else {
305
312
_info << " nbands: " << nbands << pyre::journal::endl;
306
313
_info << " full covariance: false" << pyre::journal::endl;
You can’t perform that action at this time.
0 commit comments