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
Please advise on an additional way to source values from the .h5 file, or another workaround for the tutorial.
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.
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.