LPDAAC Tutorial Error
-
- Posts: 4
- Joined: Thu Nov 18, 2021 1:30 pm America/New_York
LPDAAC Tutorial Error
I am having trouble following the "Working with Daily NASA VIIRS Surface Reflectance Data" tutorial from the LP DAAC here: https://lpdaac.usgs.gov/resources/e-lea ... ance-data/
Issue:
Any step in the tutorial which references a .value produces an "Attribute Error." Specifically, "AttributeError: 'Dataset' object has no attribute 'value.'" I have confirmed that there is no attribute 'value' using dir(f['HDFEOS INFORMATION']['StructMetadata.0']) for step 2a below.
Steps that Error:
2a) Below, read the file metadata and store as a list
fileMetadata = f['HDFEOS INFORMATION']['StructMetadata.0'].value.split() # Read file metadata
fileMetadata = [m.decode('utf-8') for m in fileMetadata] # Clean up file metadata
fileMetadata[0:33] # Print a subset of the entire file metadata record
3a) Apply a Scale Factor
red = r.value * scaleFactor
green = g.value * scaleFactor
blue = b.value * scaleFactor
nir = n.value * scaleFactor
AND MANY MORE STEPS
Request:
Please advise on an additional way to source values from the .h5 file, or another workaround for the tutorial.
Issue:
Any step in the tutorial which references a .value produces an "Attribute Error." Specifically, "AttributeError: 'Dataset' object has no attribute 'value.'" I have confirmed that there is no attribute 'value' using dir(f['HDFEOS INFORMATION']['StructMetadata.0']) for step 2a below.
Steps that Error:
2a) Below, read the file metadata and store as a list
fileMetadata = f['HDFEOS INFORMATION']['StructMetadata.0'].value.split() # Read file metadata
fileMetadata = [m.decode('utf-8') for m in fileMetadata] # Clean up file metadata
fileMetadata[0:33] # Print a subset of the entire file metadata record
3a) Apply a Scale Factor
red = r.value * scaleFactor
green = g.value * scaleFactor
blue = b.value * scaleFactor
nir = n.value * scaleFactor
AND MANY MORE STEPS
Request:
Please advise on an additional way to source values from the .h5 file, or another workaround for the tutorial.
Filters:
-
- Posts: 4
- Joined: Thu Nov 18, 2021 1:30 pm America/New_York
Re: LPDAAC Tutorial Error
Hi I wanted to check in and see if there has been any progress addressing the tutorial issue. I have not heard anything yet.
Additionally, I went back to the tutorial to double check something and noticed that it is no longer accessible at the LP DAAC site here: https://lpdaac.usgs.gov/resources/e-lea ... ance-data/
I can still find the tutorial code on Git here: https://git.earthdata.nasa.gov/projects ... rial.ipynb
Please advice on working with VIIRS data in Python.
Additionally, I went back to the tutorial to double check something and noticed that it is no longer accessible at the LP DAAC site here: https://lpdaac.usgs.gov/resources/e-lea ... ance-data/
I can still find the tutorial code on Git here: https://git.earthdata.nasa.gov/projects ... rial.ipynb
Please advice on working with VIIRS data in Python.
-
- User Services
- Posts: 345
- Joined: Mon Sep 30, 2019 12:39 pm America/New_York
- Has thanked: 10 times
Re: LPDAAC Tutorial Error
I apologize for the delayed response. We have forwarded your inquiry to our Subject Matter Expert for further guidance.
Janice
Janice
-
- Subject Matter Expert
- Posts: 71
- Joined: Tue Nov 12, 2019 4:02 pm America/New_York
- Been thanked: 3 times
Re: LPDAAC Tutorial Error
@g.studer.ellis,
Sorry for the delay. You've identified some content that needs to be updated on our website. We'll make the updates ASAP. In the meantime, the repository with the code/notebook is up to date. Please clone or download the following repo: https://git.earthdata.nasa.gov/projects ... nce/browse. That should get you past the issue you were seeing with the '.value' calls. Note, there is an HTML file in the repo that shows the fully executed notebook without deploying a Jupyter Notebook. Let us know if you run into any issue.
Sorry for the delay. You've identified some content that needs to be updated on our website. We'll make the updates ASAP. In the meantime, the repository with the code/notebook is up to date. Please clone or download the following repo: https://git.earthdata.nasa.gov/projects ... nce/browse. That should get you past the issue you were seeing with the '.value' calls. Note, there is an HTML file in the repo that shows the fully executed notebook without deploying a Jupyter Notebook. Let us know if you run into any issue.