Skip to content

02 — Exploring instruments ​

Instrument objects expose core metadata, optional fields, extension data, references, and generated relationships.

python
import xeo

instrument = xeo.instruments.MSI_S2A
instrument

Core and optional metadata ​

Required catalogue fields are always available. Optional fields such as end_date and notes return None when absent, while optional link lists default to an empty list.

python
metadata = {
    "id": instrument.id,
    "name": instrument.name,
    "acronym": instrument.acronym,
    "type": instrument.type,
    "platform_type": instrument.platform_type,
    "platform": instrument.platform,
    "operator": instrument.operator,
    "contributors": instrument.contributors,
    "start_date": instrument.start_date,
    "end_date": instrument.end_date,
    "status": instrument.status,
    "availability": instrument.availability,
}
metadata

Extensions ​

Extensions contain domain-specific metadata. Use extension_names to discover them before reading a particular extension.

python
print(instrument.extension_names)
for name, extension in instrument.extensions.items():
    print(name, "->", list(extension))

Relationships ​

family is the instrument family, such as "OLI" for both OLI and OLI2; it defaults to the acronym. family_members lists the other instruments of the same family and platform_companions the other instruments carried by the same platform. Both lists store instrument identifiers that can be resolved through xeo.instruments.

python
family_members = [xeo.instruments[item] for item in instrument.family_members]
companions = [xeo.instruments[item] for item in instrument.platform_companions]

print("Family:", instrument.family)
print("Family members:", family_members)
print("Platform companions:", companions)

References document the metadata provenance. Data links point to locations where products can be accessed.

python
print("References:")
for reference in instrument.references:
    print("-", reference)

print("\nData links:")
for link in instrument.data_links:
    print("-", link)

Released under the MIT License.