From 22c69a4ec0527e7ea81deb91b1d417c15f263b3c Mon Sep 17 00:00:00 2001 From: piyushrpt Date: Mon, 27 May 2019 22:11:32 -0700 Subject: [PATCH 1/4] clang fixes --- .../iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp | 2 +- components/mroipac/looks/bindings/cpxlooksmodule.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp b/components/iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp index bedba66..4cb0a4c 100644 --- a/components/iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp +++ b/components/iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp @@ -98,7 +98,7 @@ GDALAccessor::getStream (char * dataLine, int & numEl) int ypos0 = LastPosition / LineWidth; int xpos0 = LastPosition % LineWidth; LastPosition += numEl; - int ypos1 = (LastPosition - 1) / LineWidth; + int ypos1 = (LastPosition - std::streampos(1)) / LineWidth; if (LastPosition * SizeV >= FileSize) { numEl -= LastPosition % LineWidth; diff --git a/components/mroipac/looks/bindings/cpxlooksmodule.cpp b/components/mroipac/looks/bindings/cpxlooksmodule.cpp index ff2edcc..672a015 100644 --- a/components/mroipac/looks/bindings/cpxlooksmodule.cpp +++ b/components/mroipac/looks/bindings/cpxlooksmodule.cpp @@ -145,7 +145,7 @@ PyObject * cpxlooks_C(PyObject* self, PyObject* args) } for(int j = 0; j < na; ++j) { - b[j] = b[j] + a[j]*pow(pha,j+1)*pow(phd,lineToGet); + b[j] = b[j] + a[j]*pow(pha,j+1.0f)*pow(phd,lineToGet*1.0f); } } if(eofReached) From 7b781aec097c7029c802d25c01164b3233545671 Mon Sep 17 00:00:00 2001 From: piyushrpt Date: Sun, 9 Jun 2019 20:05:13 -0700 Subject: [PATCH 2/4] OMP threads cap fix --- components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 b/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 index 759d27e..f38e450 100644 --- a/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 +++ b/components/stdproc/stdproc/resamp_slc/src/resamp_slc.f90 @@ -21,7 +21,7 @@ integer i, j, k integer int_az_off integer i_na - integer ith, thnum + integer ith, thnum, ithorig integer ii, jj integer chipi, chipj @@ -82,6 +82,7 @@ !$OMP END MASTER !$OMP END PARALLEL + ithorig = ith ith = min(ith,8) print *, 'Number of threads: ', ith call omp_set_num_threads(ith) @@ -283,6 +284,8 @@ deallocate(rout) endif + !Reset number of threads + call omp_set_num_threads(ithorig) end From 930c56d3b81c867fe149ba7430c0024686b8b7e2 Mon Sep 17 00:00:00 2001 From: piyushrpt Date: Mon, 10 Jun 2019 11:02:42 -0700 Subject: [PATCH 3/4] Fix for GDAL 3 --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index f0727c2..8e653fe 100644 --- a/SConstruct +++ b/SConstruct @@ -141,12 +141,13 @@ else: gdal_version = os.popen('gdal-config --version').read() print('GDAL version: {0}'.format(gdal_version)) try: + gdal_majorversion = int(gdal_version.split('.')[0]) gdal_subversion = int(gdal_version.split('.')[1]) except: raise Exception('gdal-config not found. GDAL does not appear to be installed ... cannot proceed. If you have installed gdal, ensure that you have path to gdal-config in your environment') env['GDALISCXX11'] = None -if gdal_subversion >= 3: +if (gdal_majorversion > 2) or (gdal_subversion >= 3): env['GDALISCXX11'] = 'True' From f3362da9c044674f69911e133f1b9fa8adc70cb9 Mon Sep 17 00:00:00 2001 From: Mohammad Mohseni Aref Date: Thu, 13 Jun 2019 14:49:38 +0200 Subject: [PATCH 4/4] Update crop_rdr.py for small bug 'NEW NEW_FILE' is not necessary for clipping data ! --- contrib/timeseries/prepStackToStaMPS/bin/crop_rdr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/timeseries/prepStackToStaMPS/bin/crop_rdr.py b/contrib/timeseries/prepStackToStaMPS/bin/crop_rdr.py index 4e8134c..96bc118 100755 --- a/contrib/timeseries/prepStackToStaMPS/bin/crop_rdr.py +++ b/contrib/timeseries/prepStackToStaMPS/bin/crop_rdr.py @@ -157,7 +157,7 @@ if __name__ == '__main__': print('Lines: ' + str(min_LinePixel[0]) + '\t' + str(max_LinePixel[0])) print('Pixels: ' + str(min_LinePixel[1]) + '\t' + str(max_LinePixel[1])) - print('gdalwarp -to SRC_METHOD=NO_GEOTRANSFORM -of envi -te ' + str(min_LinePixel[1]) + ' ' + str(min_LinePixel[0]) + ' ' + str(max_LinePixel[1]) + ' ' + str(max_LinePixel[0]) + ' FILE FILE_NEW') + print('gdalwarp -to SRC_METHOD=NO_GEOTRANSFORM -of envi -te ' + str(min_LinePixel[1]) + ' ' + str(min_LinePixel[0]) + ' ' + str(max_LinePixel[1]) + ' ' + str(max_LinePixel[0]) + ' ') # print('gdalwarp -to SRC_METHOD=NO_GEOTRANSFORM -of envi -co INTERLEAVE=BIP -te ' + str(min_LinePixel[1]) + ' ' + str(min_LinePixel[0]) + ' ' + str(max_LinePixel[1]) + ' ' + str(max_LinePixel[0])) print('gdal_translate -srcwin ' + str(min_LinePixel[1]) + ' ' + str(min_LinePixel[0]) + ' ' + str(max_LinePixel[1]-min_LinePixel[1]) + ' ' + str(max_LinePixel[0]-min_LinePixel[0]) + ' -of envi -co INTERLEAVE=BIP ' )