From 8766fb81a2a4342521d94806b482384e72ad15ad Mon Sep 17 00:00:00 2001 From: Patrik Bohlinger Date: Wed, 22 Nov 2023 20:06:06 +0100 Subject: [PATCH] added number of seeds for x track computations as kwargs in _generate_xtrack_footprints --- wavy/filtermod.py | 8 ++++---- wavy/quicklookmod.py | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wavy/filtermod.py b/wavy/filtermod.py index e6150f70..969a8203 100644 --- a/wavy/filtermod.py +++ b/wavy/filtermod.py @@ -501,13 +501,12 @@ def filter_footprint_land_interaction(self, **kwargs): Filters away the ones that do interact and returns a clean data set. """ print("Apply filter_footprint_land_interaction") - domain = kwargs.get('domain', 'lonlat') new = deepcopy(self) if "fpr" in list(new.vars.keys()): pass else: new = new.compute_pulse_limited_footprint_radius() - _, _, _, _, ls_idx_lst = new._generate_xtrack_footprints(domain) + _, _, _, _, ls_idx_lst = new._generate_xtrack_footprints(**kwargs) # apply indices to dataset new.vars = new.vars.isel(time=ls_idx_lst) print(" Number of disregarded values:", @@ -515,8 +514,9 @@ def filter_footprint_land_interaction(self, **kwargs): print(" Number of remaining values:", len(new.vars['time'])) return new - def _generate_xtrack_footprints(self, domain): - n = 500 + 1 + def _generate_xtrack_footprints(self, **kwargs): + domain = kwargs.get('domain', 'lonlat') + n = kwargs.get('number_of_seeds', 250) + 1 new = deepcopy(self) lons = new.vars.lons.values lats = new.vars.lats.values diff --git a/wavy/quicklookmod.py b/wavy/quicklookmod.py index 962b7768..6c308af4 100755 --- a/wavy/quicklookmod.py +++ b/wavy/quicklookmod.py @@ -148,8 +148,11 @@ def quicklook(self, a=False, projection=None, **kwargs): # plot sat if kwargs.get("plot_xtrack_pulse_limited_fpr") is not None: domain = kwargs.get('domain', 'lonlat') + number_of_seeds = kwargs.get('number_of_seeds', 100) lons_perp, lats_perp, _, _, ls_idx_lst = \ - self._generate_xtrack_footprints(domain) + self._generate_xtrack_footprints( + domain=domain, + number_of_seeds=number_of_seeds) sc2 = ax.scatter(lons_perp, lats_perp, s=.2, c='b', marker='.', edgecolor='face',