Skip to content

Tig fails for some VIIRS_NPP-NAVO-L2P-v3.0 granules #72

@jamesfwood

Description

@jamesfwood

empty granules can't make tig images

Traceback (most recent call last):
  File "/Users/simonl/Library/Caches/pypoetry/virtualenvs/podaac-tig-55lOuxh_-py3.8/bin/tig", line 5, in <module>
    main()
  File "/Users/simonl/Desktop/work/tig/podaac/tig/cli.py", line 29, in main
    image_gen.generate_images(granule_id=args.input_file.split('/')[-1])
  File "/Users/simonl/Desktop/work/tig/podaac/tig/tig.py", line 186, in generate_images
    output_dimensions = (int(height_deg * self.ppd), int(width_deg * self.ppd))
  File "/Users/simonl/Library/Caches/pypoetry/virtualenvs/podaac-tig-55lOuxh_-py3.8/lib/python3.8/site-packages/numpy/ma/core.py", line 4386, in __int__
    raise MaskError('Cannot convert masked element to a Python int.')
numpy.ma.core.MaskError: Cannot convert masked element to a Python int. 

Traceback (most recent call last):
File "/Users/simonl/Library/Caches/pypoetry/virtualenvs/podaac-tig-55lOuxh_-py3.8/bin/tig", line 5, in
main()
File "/Users/simonl/Desktop/work/tig/podaac/tig/cli.py", line 29, in main
image_gen.generate_images(granule_id=args.input_file.split('/')[-1])
File "/Users/simonl/Desktop/work/tig/podaac/tig/tig.py", line 186, in generate_images
output_dimensions = (int(height_deg * self.ppd), int(width_deg * self.ppd))
File "/Users/simonl/Library/Caches/pypoetry/virtualenvs/podaac-tig-55lOuxh_-py3.8/lib/python3.8/site-packages/numpy/ma/core.py", line 4386, in int
raise MaskError('Cannot convert masked element to a Python int.')
numpy.ma.core.MaskError: Cannot convert masked element to a Python int.
Seems like some of the granules are empty which will create the above error. Tested with the below granule.

20180226053734-NAVO-L2P_GHRSST-SST1m-VIIRS_NPP-v02.0-fv03.0

https://search.earthdata.nasa.gov/search/granules?p=C1996881636-POCLOUD&pg[0][v]=f&pg[0][id]=20180226053734-NAVO-L2P_GHRSST-SST1m-VIIRS_NPP-v02.0-fv03.0&pg[0][gsk]=-start_date&tl=1660683274.928!3

From Simon:
I believe what we are seeing is that we have empty granules, it seems the lon and lat 2d array is all full of NaNs, so im not sure we even have images to generate. Unsure what solution should be for these types of granules.

Moved from https://jira.jpl.nasa.gov/browse/PODAAC-4776

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions