Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfore committed May 7, 2024
1 parent 7378612 commit 3b8331a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions tools/bin/ariaAOIassist.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ def createParser():
'--plot_raw', dest='plotRaw', action='store_true',
help='Plot raw frames if included in .csv')
parser.add_argument(
'--flag_partial_coverage', dest='flagPartialCoverage', action='store_true',
'--flag_partial_coverage', dest='flagPartialCoverage',
action='store_true',
help='Flag dates that do not cover the full lat/lon extent. This '
'does not remove dates from the lat centers plot, only '
'highlights the dates in red.')
parser.add_argument(
'--remove_incomplete_dates', dest='removeIncomplete', action='store_true',
'--remove_incomplete_dates', dest='removeIncomplete',
action='store_true',
help='Automatically detect and remove dates that do not entirely '
'fill the given latitude bounds. Note that if lat bounds are '
'left as default, only dates with gaps will be automatically '
Expand Down Expand Up @@ -515,8 +517,8 @@ def plotFrameCenters(self, flagPartialCoverage=False, plotRaw=False):
partialIndices = self.metadata[
not self.metadata['Extent Covered']].index
partialIndices = list(set(slcIndices).intersection(partialIndices))
partialDates = list(
set([date for date in
partialDates = list(set([
date for date in
self.metadata.loc[partialIndices, 'Common Date']]))

# Change date label to red if only partial coverage
Expand Down
16 changes: 10 additions & 6 deletions tools/bin/ariaPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def createParser():
'track extent.')
parser.add_argument(
'-plotbperp', '--plotbperp', action='store_true', dest='plotbperp',
help="Make a baseline plot, and a histogram of perpendicular baseline.")
help="Make a baseline plot, and a histogram of perpendicular "
"baseline.")
parser.add_argument(
'-plotbperpcoh', '--plotbperpcoh', action='store_true',
dest='plotbperpcoh',
Expand Down Expand Up @@ -117,14 +118,16 @@ def createParser():
help='Specify version as str, e.g. 2_0_4 or all prods; default: all')
parser.add_argument(
'--nc_version', dest='nc_version', default='1b',
help='Specify netcdf version as str, e.g. 1c or all prods; default: 1b')
help='Specify netcdf version as str, e.g. 1c or all prods; default: '
'1b')
parser.add_argument(
'-v', '--verbose', action='store_true', dest='verbose',
help="Toggle verbose mode on.")
parser.add_argument(
'--log-level', default='warning', help='Logger log level')
return parser


def main(inps=None):
parser = createParser()
args = parser.parse_args()
Expand Down Expand Up @@ -169,9 +172,10 @@ def main(inps=None):
args.num_threads)

if args.plottracks or args.plotcoh or args.makeavgoh or args.plotbperpcoh:
# extract/merge productBoundingBox layers for each pair and update dict,
# report common track bbox (default is to take common intersection, but
# user may specify union), and expected shape for DEM.
# extract/merge productBoundingBox layers for each pair and update
# dict, report common track bbox (default is to take common
# intersection, but user may specify union), and expected shape for
# DEM.

# TODO make LHS a tuple
standardproduct_info.products[0], standardproduct_info.products[1], \
Expand All @@ -187,7 +191,7 @@ def main(inps=None):

# Load or download mask (if specified).
if args.mask is not None:
# TODO refactor these list comps, this is not understandable in any way
# TODO refactor these list comps, this is not understandable
args.mask = ARIAtools.util.mask.prep_mask(
[[item for sublist in [list(set(d['amplitude'])) for d in standardproduct_info.products[1] if 'amplitude' in d] for item in sublist],
[item for sublist in [list(set(d['pair_name'])) for d in standardproduct_info.products[1] if 'pair_name' in d] for item in sublist]],
Expand Down

0 comments on commit 3b8331a

Please sign in to comment.