From 9a849541cdcabea70f10a104c427c8e88fbe9fce Mon Sep 17 00:00:00 2001 From: Steffan Davies <50405969+SteffanDavies@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:47:19 +0100 Subject: [PATCH] Updated orbit download for faster performance ~5x faster performance. Repeated dates using same orbit where slow to verify. This skips verification and applies downloaded orbit to all products of the same date (different subswaths or frames). --- pygmtsar/pygmtsar/SBAS_orbits.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pygmtsar/pygmtsar/SBAS_orbits.py b/pygmtsar/pygmtsar/SBAS_orbits.py index 90631b28..29b32fe6 100644 --- a/pygmtsar/pygmtsar/SBAS_orbits.py +++ b/pygmtsar/pygmtsar/SBAS_orbits.py @@ -27,11 +27,11 @@ def download_orbits(self): """ from eof.download import download_eofs - df = self.df[self.df['orbitpath'].isna()] - - # download all the misssed orbit files - for record in df.itertuples(): - #print (date, mission) + # For each date get a single product with missing orbit + sbas_df_missingorb = self.df.where(self.df.orbitpath.isna()) + sbas_df_missingorb = sbas_df_missingorb[~sbas_df_missingorb.index.duplicated(keep="first")] + + # Apply orbit to products of same date + for record in sbas_df_missingorb.itertuples(): orbitpath = download_eofs([record.datetime], [record.mission], save_dir=self.basedir)[0] - #print ('orbitpath', orbitpath) - self.df.loc[self.df.datetime == record.datetime,'orbitpath'] = orbitpath + self.df.at[record.Index, "orbitpath"] = orbitpath