dopplerchase / DRpy

python package to open GPM-DPR files into xarray to leverage xarray perks
MIT License
32 stars 11 forks source link

Issue with downloading the data #20

Closed syedhamidali closed 1 year ago

syedhamidali commented 1 year ago
io = drpy.io.netrunner(servername='Research',username='hamidsyed37@gmail.com',
                       start_time=dt.datetime(2021,2,18,11,10),
                       end_time=dt.datetime(2021,2,18,12,10))

Error is:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In [15], line 1
----> 1 io = drpy.io.netrunner(servername='Research',username='hamidsyed37@gmail.com',
      2                        start_time=dt.datetime(2021,2,18,11,10),
      3                        end_time=dt.datetime(2021,2,18,12,10))

File ~/miniconda3/envs/syed/lib/python3.9/site-packages/drpy/io/io.py:48, in netrunner.__init__(self, servername, username, start_time, end_time, autorun, savedir)
     46 self.locate_file()
     47 #this will download it locally
---> 48 self.download(savedir=savedir)

File ~/miniconda3/envs/syed/lib/python3.9/site-packages/drpy/io/io.py:192, in netrunner.download(self, savedir)
    190     print('Ope: Multiple file downloads not currently supported. Sorry.')
    191 else:
--> 192     url = self.server + self.filename[0]
    193     print('Downloading: {}'.format(url))
    194     cmd = 'curl -s -u ' + self.username+':'+self.username+' ' + url + ' -o ' + \
    195     os.path.basename(savedir+self.filename[0])

IndexError: index 0 is out of bounds for axis 0 with size 0
dopplerchase commented 1 year ago

Hi Syed Hamid Ali,

Thanks for pointing this out. I never built the code to do multi-file originally. I have now added this in and made an improvement where we can see download progress. Let me know if this works for you. Please update your repo and re-install

  1. cd into DRpy dir
  2. git pull
  3. pip install .
dopplerchase commented 1 year ago

Its been a few weeks. Things seem to be working as expected. Going to close this. Feel free to re-open if issues occur