icesat2py / icepyx

Python tools for obtaining and working with ICESat-2 data
https://icepyx.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
207 stars 106 forks source link

ATL11 granule ID empty list #400

Closed JessicaS11 closed 1 year ago

JessicaS11 commented 1 year ago

Hi Jessica, when trying to pull ATL11 using icepyx, I kept getting an error "pop from empty list":

#get a list of granule IDs for the available granules
region_a.avail_granules(ids=True) 

Which returned the error message:

IndexError                                Traceback (most recent call last)
/var/folders/d2/jjjzv8t95113nztdlt260q8r0000gn/T/ipykernel_14830/3270823387.py in <module>
      1 #get a list of granule IDs for the available granules
      2 print(region_a.CMRparams)
----> 3 region_a.avail_granules(ids=True)

~/opt/anaconda3/lib/python3.9/site-packages/icepyx/core/query.py in avail_granules(self, ids, cycles, tracks, s3urls)
    907         if ids or cycles or tracks or s3urls:
    908             # list of outputs in order of ids, cycles, tracks, s3urls
--> 909             return granules.gran_IDs(
    910                 self.granules.avail,
    911                 ids=ids,

~/opt/anaconda3/lib/python3.9/site-packages/icepyx/core/granules.py in gran_IDs(grans, ids, cycles, tracks, dates, s3urls)
    107                 AUX,
    108                 SFX,
--> 109             ) = rx.findall(producer_granule_id).pop()
    110             gran_cycles.append(CYCL)
    111             gran_tracks.append(TRK)

IndexError: pop from empty list

I ran this identical code for ATL06 and ATl12 without any issues. It seems like there is an issue with identifying the ID's of granules for ATL11. I have adjusted the spatial boundaries and maximized the temporal ones to make sure that I am getting enough data -- but there is still this error. Thoughts?

Originally posted by @chris-picard in https://github.com/icesat2py/icepyx/issues/398#issuecomment-1400375095

JessicaS11 commented 1 year ago

Hello @chris-picard - thanks for your report. I've moved it to a new issue, as it is a distinct issue relative to the code under review in the pull request (PR).

Could you please provide the input parameters you are using for this query, along with the version of icepyx (output by ipx.__version__)? It will be easier for us to dig into what the problem is if we are able to recreate it locally. Thanks!

chris-picard commented 1 year ago

I am using icepyx version 0.6.3 and the input parameters are as follows: short_name = 'ATL11' spatial_extent = [-38.65,72.5,-38.40,72.7] date_range = ['2018-06-20','2023-01-21']

Thank you for the help with this!

JessicaS11 commented 1 year ago

Thanks @chris-picard for the inputs and your patience. With these inputs I'm able to recreate the error, so I will work on implementing a solution to include in our next release.

UPDATE: I've implemented a fix for this and included it as part of the ATL11 read-in work. Once that is merged, you can install from the development branch to use it, and it will be included in our next software release (0.6.5), anticipated after the linked PR is merged.