Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud mode missing in O3 products #9

Open
Johaney-s opened this issue Aug 5, 2024 · 0 comments
Open

Cloud mode missing in O3 products #9

Johaney-s opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Johaney-s
Copy link

Describe the bug
This line of code requires cloud_mode property in the S5p metadata of O3 products:

product_metadata.py, line 556:
"o3:cloud_mode": str(self._root.cloud_mode),

but the cloud_mode is missing in some O3 data.

To reproduce
I get this error for example on product 5b2ec3d2-cfa5-4c2d-8b25-b1894d1ffdb5: S5P_NRTI_L2__O3__PR_20240726T024524_20240726T025024_35152_03_020600_20240726T042829.nc
Expected behavior
I guess skipping it if missing and not throwing an exception would be suitable.

Traceback

Traceback (most recent call last):
  File "/home/johaney/Projects/DhusPytools/register_stac.py", line 436, in main
    item = stactools.sentinel5p.stac.create_item(os.path.join(metadata_dir, title))
  File "/home/johaney/Projects/DhusPytools/.venv/lib/python3.10/site-packages/stactools/sentinel5p/stac.py", line 87, in create_item
    item.properties.update({**product_metadata.metadata_dict})
  File "/home/johaney/Projects/DhusPytools/.venv/lib/python3.10/site-packages/stactools/sentinel5p/product_metadata.py", line 556, in metadata_dict
    "o3:cloud_mode": str(self._root.cloud_mode),
  File "src/netCDF4/_netCDF4.pyx", line 3131, in netCDF4._netCDF4.Dataset.__getattr__
  File "src/netCDF4/_netCDF4.pyx", line 3076, in netCDF4._netCDF4.Dataset.getncattr
  File "src/netCDF4/_netCDF4.pyx", line 1617, in netCDF4._netCDF4._get_att
  File "src/netCDF4/_netCDF4.pyx", line 2113, in netCDF4._netCDF4._ensure_nc_success
AttributeError: NetCDF: Attribute not found
@Johaney-s Johaney-s added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant