From e0287c719ccaf8088cee2376dd84458522278cd4 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Tue, 24 May 2022 12:17:31 -0700 Subject: [PATCH 01/13] remove KMZ support as its not supported by asf_search; bug fixes --- tools/bin/ariaDownload.py | 48 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/tools/bin/ariaDownload.py b/tools/bin/ariaDownload.py index 979b2ab5..f0448043 100755 --- a/tools/bin/ariaDownload.py +++ b/tools/bin/ariaDownload.py @@ -13,6 +13,7 @@ import re from datetime import datetime import logging +import warnings import asf_search as asf from ARIAtools.logger import logger from ARIAtools.url_manager import url_versions @@ -37,27 +38,25 @@ def createParser(): '\n\t ariaDownload.py --bbox "36.75 37.225 -76.655 -75.928"' '\n\t ariaDownload.py -t 004,077 --start 20190101 -o count', formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-o', '--output', dest='output', default='Download', \ - type=str, - help='Output type, default is "Download". "Download", "Count", and "Url"' - '"Kmz" are currently supported. Use "Url" for ingestion to ' - 'aria*.py') - parser.add_argument('-t', '--track', dest='track', default=None, type=str, + parser.add_argument('-o', '--output', default='Download', type=str.title, + choices=('Download', 'Count', 'Url'), help='Output type. '\ + 'Default="Download". Use "Url" for ingestion to aria*.py') + parser.add_argument('-t', '--track', default=None, type=str, help='track to download; single number (including leading zeros) or ' 'comma separated') - parser.add_argument('-b', '--bbox', dest='bbox', default=None, type=str, + parser.add_argument('-b', '--bbox', default=None, type=str, help='Lat/Lon Bounding SNWE, or GDAL-readable file containing ' 'POLYGON geometry.') parser.add_argument('-w', '--workdir', dest='wd', default='./products', \ type=str, help='Specify directory to deposit all outputs. Default is ' '"products" in local directory where script is launched.') - parser.add_argument('-s', '--start', dest='start', default='20140101', type=str, + parser.add_argument('-s', '--start', default='20140101', type=str, help='Start date as YYYYMMDD; If none provided, starts at beginning ' 'of Sentinel record (2014).') - parser.add_argument('-e', '--end', dest='end', default='21000101', type=str, + parser.add_argument('-e', '--end', default='21000101', type=str, help='End date as YYYYMMDD. If none provided, ends today.') - parser.add_argument('-u', '--user', dest='user', default=None, type=str, + parser.add_argument('-u', '--user', default=None, type=str, help='NASA Earthdata URS user login. Users must add "GRFN Door ' '(PROD)" and "ASF Datapool Products" to their URS approved ' 'applications.') @@ -74,21 +73,21 @@ def createParser(): help='Take pairs with a temporal baseline -- days greater than this ' 'value. Example, annual pairs: ariaDownload.py -t 004 ' '--daysmore 364.') - parser.add_argument('-nt', '--num_threads', dest='num_threads', \ - default='1', type=str, + parser.add_argument('-nt', '--num_threads', default='1', type=str, help='Specify number of threads for multiprocessing ' 'download. By default "1". Can also specify "All" to use all ' 'available threads.') - parser.add_argument('-i', '--ifg', dest='ifg', default=None, type=str, + parser.add_argument('-i', '--ifg', default=None, type=str, help='Retrieve one interferogram by its start/end date, specified as ' 'YYYYMMDD_YYYYMMDD (order independent)') parser.add_argument('-d', '--direction', dest='flightdir', default=None, \ type=str, help='Flight direction, options: ascending, a, descending, d') - parser.add_argument('--version', dest='version', default=None, + parser.add_argument('--version', default=None, help='Specify version as str, e.g. 2_0_4 or all prods; default: ' - 'newest') - parser.add_argument('-v', '--verbose', dest='v', action='store_true', + 'newest. All products are downloaded. Unspecified versions are ' + 'stored in "workdir"/duplicated_products') + parser.add_argument('-v', '--verbose', action='store_true', help='Print products to be downloaded to stdout') return parser @@ -108,12 +107,6 @@ def cmdLineParse(iargs=None): if not inps.track and not inps.bbox: raise Exception('Must specify either a bbox or track') - if not inps.output.lower() in ['count', 'kmz', 'kml', 'url', 'download']: - raise Exception ('Incorrect output keyword. Choose "count", "kmz", ' - '"url", or "download"') - - inps.output = 'Kml' if inps.output.lower() == 'kmz' or \ - inps.output.lower() == 'kml' else inps.output.title() return inps @@ -235,10 +228,10 @@ def __call__(self): if self.inps.output == 'Count': log.info('\nFound -- %d -- products', len(scenes)) - elif self.inps.output == 'Kml': - dst = self._fmt_dst() - self.log.error('Kml option is not yet supported. '\ - 'Revert to an older version of ARIAtools') + # elif self.inps.output == 'Kml': + # dst = fmt_dst(inps) + # log.error('Kml option is not yet supported. '\ + # 'Revert to an older version of ARIAtools') elif self.inps.output == 'Url': dst = fmt_dst(inps) @@ -260,6 +253,9 @@ def __call__(self): scenes.download(self.inps.wd, processes=nt) log.info(f'Wrote -- {len(scenes)} -- products to: {self.inps.wd}') + if inps.verbose: + [print (scene.geojson()['properties']['sceneName']) for scene in scenes] + return From e218f449b3467f07902784be7fad8587fbc32c39 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Thu, 26 May 2022 10:49:04 -0700 Subject: [PATCH 02/13] update help regarding gacos --- tools/ARIAtools/extractProduct.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/ARIAtools/extractProduct.py b/tools/ARIAtools/extractProduct.py index 70c393fb..9146e9ba 100755 --- a/tools/ARIAtools/extractProduct.py +++ b/tools/ARIAtools/extractProduct.py @@ -49,7 +49,8 @@ def createParser(): parser.add_argument('-w', '--workdir', dest='workdir', default='./', help='Specify directory to deposit all outputs. Default is local directory where script is launched.') parser.add_argument('-tp', '--tropo_products', dest='tropo_products', type=str, default=None, - help='Path to director(ies) or tar file(s) containing GACOS products.') + help='Path to director(ies) or tar file(s) containing GACOS products. Will use new version of products (.tif) if they exist.'\ + 'Further information on GACOS available at: http://www.gacos.net.') parser.add_argument('-l', '--layers', dest='layers', default=None, help='Specify layers to extract as a comma deliminated list bounded by single quotes. Allowed keys are: "unwrappedPhase", "coherence", "amplitude", "bPerpendicular", "bParallel", "incidenceAngle", "lookAngle", "azimuthAngle", "ionosphere". If "all" is specified, then all layers are extracted. If blank, will only extract bounding box.') parser.add_argument('-d', '--demfile', dest='demfile', type=str, @@ -118,7 +119,7 @@ def __call__(self, line, pix, h): class metadata_qualitycheck: """Metadata quality control function. - + Artifacts recognized based off of covariance of cross-profiles. Bug-fix varies based off of layer of interest. Verbose mode generates a series of quality control plots with @@ -1041,9 +1042,9 @@ def tropo_correction(full_product_dict, tropo_products, bbox_file, ] # Check and report if tropospheric product falls outside of standard product range - latest_start = max(aria_rsc_dict['azimuthZeroDopplerMidTime'] + latest_start = max(aria_rsc_dict['azimuthZeroDopplerMidTime'] + [min(tropo_rsc_dict['TIME_OF_DAY'])]) - earliest_end = min(aria_rsc_dict['azimuthZeroDopplerMidTime'] + earliest_end = min(aria_rsc_dict['azimuthZeroDopplerMidTime'] + [max(tropo_rsc_dict['TIME_OF_DAY'])]) delta = (earliest_end - latest_start).total_seconds() + 1 if delta<0: @@ -1087,7 +1088,7 @@ def tropo_correction(full_product_dict, tropo_products, bbox_file, tropo_product = np.subtract(tropo_secondary, tropo_product) # Convert troposphere to rad - tropo_product = np.divide(tropo_product, + tropo_product = np.divide(tropo_product, float(metadata_dict[1][i][0]) \ / (4*np.pi)) # Account for lookAngle From f7402d42d07901f033db21056614fd21809de5db Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Thu, 26 May 2022 11:12:24 -0700 Subject: [PATCH 03/13] Add messages to ariaDownload; bug in computeMisclosure --- tools/ARIAtools/computeMisclosure.py | 4 +++- tools/bin/ariaDownload.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/ARIAtools/computeMisclosure.py b/tools/ARIAtools/computeMisclosure.py index c8c2a15d..3b4bdb61 100644 --- a/tools/ARIAtools/computeMisclosure.py +++ b/tools/ARIAtools/computeMisclosure.py @@ -149,6 +149,7 @@ def __init__(self,imgfile,workdir='./', self.basename = os.path.basename(self.imgfile) self.imgdir = os.path.dirname(self.imgfile) self.workdir = os.path.abspath(workdir) + self.verbose = verbose # Check if output directory exists if not os.path.exists(self.workdir): @@ -164,7 +165,8 @@ def __init__(self,imgfile,workdir='./', self.excludePairs = excludePairs # Other - if self.verbose: logger.setLevel(logging.DEBUG) + if self.verbose: + logger.setLevel(logging.DEBUG) # Read stack data and retrieve list of dates diff --git a/tools/bin/ariaDownload.py b/tools/bin/ariaDownload.py index f0448043..10cd3179 100755 --- a/tools/bin/ariaDownload.py +++ b/tools/bin/ariaDownload.py @@ -244,6 +244,7 @@ def __call__(self): scenes = asf.ASFSearchResults(scenes) nt = int(self.inps.num_threads) # so legacy works ## allow a user to specify username / password + log.info (f'Downloading {len(scenes)} products...') if self.inps.user is not None: session = asf.ASFSession() session.auth_with_creds(self.inps.user, self.inps.passw) @@ -251,7 +252,7 @@ def __call__(self): else: scenes.download(self.inps.wd, processes=nt) - log.info(f'Wrote -- {len(scenes)} -- products to: {self.inps.wd}') + log.info(f'Download complete. Wrote -- {len(scenes)} -- products to: {self.inps.wd}') if inps.verbose: [print (scene.geojson()['properties']['sceneName']) for scene in scenes] From 70639c67606853299f4adfb882414eaa4e5e4697 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Thu, 26 May 2022 15:13:02 -0700 Subject: [PATCH 04/13] Update version info --- tools/ARIAtools.egg-info/PKG-INFO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ARIAtools.egg-info/PKG-INFO b/tools/ARIAtools.egg-info/PKG-INFO index 30ba7ee9..34abbf29 100644 --- a/tools/ARIAtools.egg-info/PKG-INFO +++ b/tools/ARIAtools.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ARIAtools -Version: 1.1.0 +Version: 1.1.2 Summary: This is the ARIA tools package without RelaxIV support Home-page: UNKNOWN License: UNKNOWN From c8460de745dc9b86847b588d93f7a5e0aa24836b Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Thu, 26 May 2022 15:17:34 -0700 Subject: [PATCH 05/13] update tag --- tools/ARIAtools.egg-info/PKG-INFO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ARIAtools.egg-info/PKG-INFO b/tools/ARIAtools.egg-info/PKG-INFO index 34abbf29..6fc263e9 100644 --- a/tools/ARIAtools.egg-info/PKG-INFO +++ b/tools/ARIAtools.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ARIAtools -Version: 1.1.2 +Version: 1.1.3 Summary: This is the ARIA tools package without RelaxIV support Home-page: UNKNOWN License: UNKNOWN From a93e28fc5d45cc0b43d16e3068a82b0bb215b486 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Fri, 27 May 2022 10:55:54 -0700 Subject: [PATCH 06/13] fix circleci bug --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff39565d..3241e0c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,8 +30,8 @@ jobs: export PATH="$HOME/miniconda/bin:$PATH" source $HOME/miniconda/etc/profile.d/conda.sh conda install mamba -n base -c conda-forge --yes - mamba update -y conda - mamba update -y mamba + # mamba update -y conda + # mamba update -y mamba mamba env create -f environment.yml mamba install -c anaconda git @@ -55,6 +55,7 @@ jobs: export GDAL_HTTP_COOKIEJAR=/tmp//cookies.txt export VSI_CACHE=YES echo $CC_OT > ~/.topoapi + echo gdalinfo --version chmod 600 ~/.topoapi python setup.py build python setup.py install From c58bd4a8a0e66bf3b384f709e90b3ddfa7861378 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Fri, 27 May 2022 17:14:07 -0700 Subject: [PATCH 07/13] update sets to list to address future warning --- tools/bin/ariaAOIassist.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/bin/ariaAOIassist.py b/tools/bin/ariaAOIassist.py index c7a362b4..c73c05e4 100755 --- a/tools/bin/ariaAOIassist.py +++ b/tools/bin/ariaAOIassist.py @@ -297,7 +297,7 @@ def checkContinuity(self,removeIncompleteDates=False): for date in dates: # Indices of frames matching non-RAW and date dateIndices=self.metadata[self.metadata['Common Date']==date].index - passIndices=set(SLCindices).intersection(dateIndices) + passIndices=list(set(SLCindices).intersection(dateIndices)) # Sort tracks south-north and compare latitude extents # "satPass" refers to all the acquisitions from a single satellite pass @@ -437,8 +437,8 @@ def plotFrameCenters(self,flagPartialCoverage=False,plotRaw=False): if flagPartialCoverage==True: slcIndices=self.metadata[self.metadata['Processing Level']=='SLC'].index partialIndices=self.metadata[self.metadata['Extent Covered']==False].index - partialIndices=set(slcIndices).intersection(partialIndices) - partialDates=set([date for date in self.metadata.loc[partialIndices,'Common Date']]) + partialIndices=list(set(slcIndices).intersection(partialIndices)) + partialDates=list(set([date for date in self.metadata.loc[partialIndices,'Common Date']])) # Change date label to red if only partial coverage [self.ax.get_xticklabels()[n].set_color('r') for n,date in enumerate(datelabels) if @@ -506,7 +506,7 @@ def save2kml(self): for date in dates: dateIndices=self.metadata[self.metadata['Common Date']==date].index - dateIndices=set(slcIndices).intersection(dateIndices) + dateIndices=list(set(slcIndices).intersection(dateIndices)) # Create KML layer layer=DS.CreateLayer(date,None,ogr.wkbPolygon) @@ -597,7 +597,7 @@ def __mergeFramesbyDate__(self,date): # Collect indices of date dateIndices=self.metadata[self.metadata['Common Date']==date].index - dateIndices=set(slcIndices).intersection(dateIndices) + dateIndices=list(set(slcIndices).intersection(dateIndices)) # Compute polygons datePolygons=[] @@ -727,7 +727,7 @@ def __saveAOI__(self,AOI): print ('ARIA-tools Version:', get_distribution('ARIAtools').version) except: pass - + inps = cmdLineParse(iargs=None) From 4092c943a3d810c128850987b4242faa7f838a2e Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Sat, 28 May 2022 13:36:12 -0700 Subject: [PATCH 08/13] restrict gdal versions, newer arent backward compatible --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 77ca6088..9626586e 100644 --- a/environment.yml +++ b/environment.yml @@ -11,7 +11,7 @@ dependencies: - python>=3.6 - asf_search - cartopy - - gdal>=3.2.1 + - gdal>=3.2.1, <3.4.2 - hdf5 - joblib - libgdal From 5973ad688a2c9dd336aed5693187e79ae3540129 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Tue, 31 May 2022 11:12:59 -0700 Subject: [PATCH 09/13] Force NLCD mask reading of .msk extension GDAL seems no longer able to read .msk extensions. We should update all of these to reflect correct filetype. --- tools/ARIAtools/mask_util.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/ARIAtools/mask_util.py b/tools/ARIAtools/mask_util.py index 8011b362..3056a750 100755 --- a/tools/ARIAtools/mask_util.py +++ b/tools/ARIAtools/mask_util.py @@ -146,7 +146,8 @@ def prep_mask(product_dict, maskfilename, bbox_file, prods_TOTbbox, proj, del mask_file, amp_file # crop/expand mask to DEM size? - mask = gdal.Warp('', maskfilename, format='MEM', + ## just double check you cant lfush it out/mas + mask = gdal.Warp('', f'{maskfilename}.vrt', format='MEM', cutlineDSName=prods_TOTbbox, outputBounds=bounds, width=arrshape[1], height=arrshape[0], multithread=True, options=[f'NUM_THREADS={num_threads}']) @@ -161,6 +162,7 @@ def prep_mask(product_dict, maskfilename, bbox_file, prods_TOTbbox, proj, except: pass + mask.FlushCache() return mask @@ -252,6 +254,7 @@ def __init__(self, path_aria, lc=[11, 12, 90, 95]): self.lc = lc # landcover classes to mask gdal.PushErrorHandler('CPLQuietErrorHandler') + def __call__(self, proj, bounds, arrshape, outputFormat='ENVI', test=False): """ view=True to plot the mask; test=True to apply mask to dummy data """ import matplotlib.pyplot as plt @@ -279,8 +282,9 @@ def __call__(self, proj, bounds, arrshape, outputFormat='ENVI', test=False): path_mask = op.join(self.path_aria, 'mask') os.mkdirs(path_mask) if not op.exists(path_mask) else '' dst = op.join(path_mask, 'NLCD_crop.msk') - ds = gdal.Translate(dst, ds_mask, options=gdal.TranslateOptions(format=outputFormat, outputType=gdal.GDT_Byte)) - gdal.BuildVRT(dst + '.vrt' ,ds) + ds = gdal.Translate(dst, ds_mask, format=outputFormat, outputType=gdal.GDT_Byte) + + gdal.BuildVRT(dst + '.vrt', ds) ## save a view of the mask arr = ds.ReadAsArray() @@ -290,6 +294,9 @@ def __call__(self, proj, bounds, arrshape, outputFormat='ENVI', test=False): plt.savefig(op.join(path_mask, 'NLCD_crop.msk.png')) if test: self.__test__(ds_mask) + for dss in [ds_crop, ds_resamp, ds_mask, ds]: + ds.FlushCache() + del dss return dst From 9680c1d5843be295b44ff195b6d75166746b834e Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Tue, 31 May 2022 18:07:15 -0700 Subject: [PATCH 10/13] Remove a gdal config option that sometimes causes /vsi/ to not be read on leffe --- tools/ARIAtools/ARIAProduct.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/ARIAtools/ARIAProduct.py b/tools/ARIAtools/ARIAProduct.py index edb39355..66437f08 100644 --- a/tools/ARIAtools/ARIAProduct.py +++ b/tools/ARIAtools/ARIAProduct.py @@ -14,12 +14,12 @@ from osgeo import gdal from ARIAtools.url_manager import url_versions -from ARIAtools.shapefile_util import open_shapefile,save_shapefile +from ARIAtools.shapefile_util import open_shapefile, save_shapefile from ARIAtools.logger import logger gdal.UseExceptions() gdal.PushErrorHandler('CPLQuietErrorHandler') -gdal.SetConfigOption('CPL_VSIL_CURL_USE_HEAD', 'NO') +# gdal.SetConfigOption('CPL_VSIL_CURL_USE_HEAD', 'NO') log = logging.getLogger(__name__) @@ -28,6 +28,7 @@ def unwrap_self_readproduct(arg): # arg is the self argument and the filename is of the file to be read return ARIA_standardproduct.__readproduct__(arg[0], arg[1])[0] + class ARIA_standardproduct: #Input file(s) and bbox as either list or physical shape file. """ @@ -41,9 +42,9 @@ class ARIA_standardproduct: #Input file(s) and bbox as either list or physical s def __init__(self, filearg, bbox=None, workdir='./', num_threads=1, url_version='None', verbose=False): """ - + Parse products and input bounding box (if specified) - + """ # If user wants verbose mode # Parse through file(s)/bbox input From 30f5a1df86ca4d4af6d8dccaf32779a7a291b604 Mon Sep 17 00:00:00 2001 From: bbuzz31 Date: Tue, 31 May 2022 18:07:47 -0700 Subject: [PATCH 11/13] Flush mask for new gdal --- tools/ARIAtools/mask_util.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/ARIAtools/mask_util.py b/tools/ARIAtools/mask_util.py index 3056a750..d21f739c 100755 --- a/tools/ARIAtools/mask_util.py +++ b/tools/ARIAtools/mask_util.py @@ -146,8 +146,7 @@ def prep_mask(product_dict, maskfilename, bbox_file, prods_TOTbbox, proj, del mask_file, amp_file # crop/expand mask to DEM size? - ## just double check you cant lfush it out/mas - mask = gdal.Warp('', f'{maskfilename}.vrt', format='MEM', + mask = gdal.Warp('', maskfilename, format='MEM', cutlineDSName=prods_TOTbbox, outputBounds=bounds, width=arrshape[1], height=arrshape[0], multithread=True, options=[f'NUM_THREADS={num_threads}']) @@ -281,25 +280,25 @@ def __call__(self, proj, bounds, arrshape, outputFormat='ENVI', test=False): ## write mask to disk path_mask = op.join(self.path_aria, 'mask') os.mkdirs(path_mask) if not op.exists(path_mask) else '' - dst = op.join(path_mask, 'NLCD_crop.msk') + dst = op.join(path_mask, f'NLCD_crop.msk') ds = gdal.Translate(dst, ds_mask, format=outputFormat, outputType=gdal.GDT_Byte) - gdal.BuildVRT(dst + '.vrt', ds) + ds1 = gdal.BuildVRT(dst+'.vrt', ds) ## save a view of the mask arr = ds.ReadAsArray() plt.imshow(arr, cmap=plt.cm.Greys_r, interpolation='nearest') plt.colorbar(); plt.title(f'Resampled mask\nDims: {arr.shape}') - plt.savefig(op.join(path_mask, 'NLCD_crop.msk.png')) + plt.savefig(f'{op.splitext(dst)[0]}.png') if test: self.__test__(ds_mask) - for dss in [ds_crop, ds_resamp, ds_mask, ds]: - ds.FlushCache() - del dss + + del ds, ds1, ds_crop, ds_resamp, ds_mask return dst + def __test__(self, ds_maskre): ## apply mask to dummy data FOR TESTING import matplotlib.pyplot as plt @@ -311,6 +310,7 @@ def __test__(self, ds_maskre): plt.imshow(arr, cmap='jet_r', interpolation='nearest'); plt.colorbar() plt.title('Mask applied to dummy data'); plt.show() + def _dummy_data(self, ds2match): """ Create raster of dummy data using the dem (for sizing); For test """ if isinstance(ds2match, str) and op.exists(ds2match): @@ -324,6 +324,7 @@ def _dummy_data(self, ds2match): arr1 = ds.ReadAsArray() return ds + def _apply_mask(self, ds_mask, ds_2mask): """ Apply mask to test viewing """ arr = ds_mask.ReadAsArray() From 633b22f3c59c19e534a1670ade9d0b37226fd99a Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Mon, 13 Jun 2022 17:48:50 -0700 Subject: [PATCH 12/13] Removing f string Perhaps was a vestige? --- tools/ARIAtools/mask_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ARIAtools/mask_util.py b/tools/ARIAtools/mask_util.py index 920b541d..edf0595a 100755 --- a/tools/ARIAtools/mask_util.py +++ b/tools/ARIAtools/mask_util.py @@ -280,7 +280,7 @@ def __call__(self, proj, bounds, arrshape, outputFormat='ENVI', test=False): ## write mask to disk path_mask = op.join(self.path_aria, 'mask') os.mkdirs(path_mask) if not op.exists(path_mask) else '' - dst = op.join(path_mask, f'NLCD_crop.msk') + dst = op.join(path_mask, 'NLCD_crop.msk') ds = gdal.Translate(dst, ds_mask, format=outputFormat, outputType=gdal.GDT_Byte) ds1 = gdal.BuildVRT(dst+'.vrt', ds) From 092d052e5c332246454162f6f6f5cfcf7b8f3b97 Mon Sep 17 00:00:00 2001 From: Simran S Sangha Date: Mon, 13 Jun 2022 17:51:02 -0700 Subject: [PATCH 13/13] Minor codacy fixes --- tools/bin/ariaDownload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bin/ariaDownload.py b/tools/bin/ariaDownload.py index 10cd3179..931022f8 100755 --- a/tools/bin/ariaDownload.py +++ b/tools/bin/ariaDownload.py @@ -13,7 +13,6 @@ import re from datetime import datetime import logging -import warnings import asf_search as asf from ARIAtools.logger import logger from ARIAtools.url_manager import url_versions @@ -255,7 +254,8 @@ def __call__(self): log.info(f'Download complete. Wrote -- {len(scenes)} -- products to: {self.inps.wd}') if inps.verbose: - [print (scene.geojson()['properties']['sceneName']) for scene in scenes] + for scene in scenes: + print(scene.geojson()['properties']['sceneName']) return