def download(self, inventory_df, mirror=None, concurrent=2, uname=None, pword=None): # if an old inventory exists dorp download_path if 'download_path' in inventory_df: inventory_df.drop('download_path', axis=1) # check if scenes exist inventory_df = search.check_availability(inventory_df, self.download_dir, self.data_mount) # extract only those scenes that need to be downloaded download_df = inventory_df[inventory_df.download_path.isnull()] # to download or not ot download - that is here the question if not download_df.any().any(): print(' INFO: All scenes are ready for being processed.') else: print(' INFO: One or more of your scenes need to be downloaded.') download.download_sentinel1(download_df, self.download_dir, mirror=mirror, concurrent=concurrent, uname=uname, pword=pword)
def download(self, download_dir, mirror=None): if not mirror: logger.info('One or more of your scenes need to be downloaded.') print(' Select the server from where you want to download:') print(' (1) Copernicus Apihub (ESA, rolling archive)') print(' (2) Alaska Satellite Facility (NASA, full archive)') print(' (3) PEPS (CNES, 1 year rolling archive)') print(' (4) ONDA DIAS (ONDA DIAS full archive for' ' SLC - or GRD from 30 June 2019)') # print(' (5) Alaska Satellite Facility (using WGET' # ' - unstable - use only if 2 fails)') mirror = input(' Type 1, 2, 3, or 4: ') from ost.s1 import download if isinstance(download_dir, str): download_dir = Path(download_dir) if mirror == '1': uname, pword = scihub.ask_credentials() opener = scihub.connect(uname=uname, pword=pword) df = pd.DataFrame({ 'identifier': [self.scene_id], 'uuid': [self.scihub_uuid(opener)] }) elif mirror == '2': uname, pword = asf.ask_credentials() df = pd.DataFrame({'identifier': [self.scene_id]}) elif mirror == '3': uname, pword = peps.ask_credentials() df = pd.DataFrame({ 'identifier': [self.scene_id], 'uuid': [self.peps_uuid(uname=uname, pword=pword)] }) elif mirror == '4': uname, pword = onda.ask_credentials() opener = onda.connect(uname=uname, pword=pword) df = pd.DataFrame({ 'identifier': [self.scene_id], 'uuid': [self.ondadias_uuid(opener)] }) else: raise ValueError('You entered the wrong mirror.') # else: # ASF # df = pd.DataFrame({'identifier': [self.scene_id]}) # download.download_sentinel1(df, download_dir, mirror) # return download.download_sentinel1(df, download_dir, mirror, uname=uname, pword=pword) # delete credentials del uname, pword
def download(self, download_dir, mirror=None): if not mirror: print(' INFO: One or more of your scenes need to be downloaded.') print(' Select the server from where you want to download:') print(' (1) Copernicus Apihub (ESA, rolling archive)') print(' (2) Alaska Satellite Facility (NASA, full archive)') print(' (3) PEPS (CNES, 1 year rolling archive)') print(' (4) ONDA DIAS (ONDA DIAS full archive for SLC - or GRD from 30 June 2019)') print(' (5) Alaska Satellite Facility (using WGET - unstable - use only if 2 fails)') mirror = input(' Type 1, 2, 3, 4 or 5: ') from ost.s1 import download if mirror == '1': uname, pword = scihub.ask_credentials() opener = scihub.connect(uname=uname, pword=pword) df = pd.DataFrame( {'identifier': [self.scene_id], 'uuid': [self.scihub_uuid(opener)] } ) elif mirror == '3': uname, pword = peps.ask_credentials() df = pd.DataFrame( {'identifier': [self.scene_id], 'uuid': [self.peps_uuid(uname=uname, pword=pword)] } ) elif mirror == '4': uname, pword = onda.ask_credentials() opener = onda.connect(uname=uname, pword=pword) df = pd.DataFrame( {'identifier': [self.scene_id], 'uuid': [self.ondadias_uuid(opener)] } ) else: # ASF df = pd.DataFrame({'identifier': [self.scene_id]}) download.download_sentinel1(df, download_dir, mirror) return download.download_sentinel1(df, download_dir, mirror, uname=uname, pword=pword) del uname, pword
def download(self, download_dir): from ost.s1 import download df = pd.DataFrame({'identifier': [self.scene_id]}) download.download_sentinel1(df, download_dir)