Get comprehensive metadata info from Product (Snappy)

Hi guys,

How to get the:

  • orbit (ascending/descending)
  • look direction (left/right)
  • near incident angle
  • far incident angle

from the class “Product” using Snappy?



Hi @gusortiz

I’d have a look at the documentation for Product, although it’s the Java documentation you can call the same methods within snappy. I’m not 100% sure but I’m guessing product.getMetadataRoot() might be what you’re looking for, you can call getElementNames() which looks like it will give you all the metadata types available.

The documentation should give you an idea how to step around the methods to find what you need :slight_smile:

It might be product.getMetadataRoot.getElementNames() or product.getMetadataRoot().getAttributeNames() and then you can access either by getAttribute(string) or getElement(string)


Thank you very much, @CiaranEvans!

The resulting commands are:

orbit = product.getMetadataRoot().getElement('Abstracted_Metadata').getAttribute('PASS').getData()
look = product.getMetadataRoot().getElement('Abstracted_Metadata').getAttribute('antenna_pointing').getData()

Awesome, glad you managed to get what you needed!

…to get values as DOUBLE use:
inc_far = product.getMetadataRoot().getElement(‘Abstracted_Metadata’).getAttributeDouble(‘incidence_far’)



I would like to apply snappy to get ZENITH_ANGLE value from metadata.

According to I was reading

Get comprehensive metadata info from Product (Snappy) I should apply something like this:

data = df.getMetadataRoot().getElement(‘Granules’).getAttribute(‘Geometric_Info’).getData()

However, I´m not able to get a retrieval. Could someone guide me about it?

My image is a subset from S2 L2A, so the extension file is .dim.

Thanks in advance

I have found help in Extracting the platform heading with snapppy? - #14 by elmerehbi :relaxed: