Skip to main content

DRB Extractor

Project description

DRB Extractor

Extractor

An extractor as its name suggests allowing to extract information/data from a node. An extractor is defined by a YAML content. Three extractor types exists currently:

Constant

This extractor nothing from the node but give always the same value.

constant: 42

Some string values are automatically converted to a specific Python type:

Value Python type
2022-01-01 datatime.date
2022-01-01T00:00:00.000Z datatime.datetime

XQuery

This extractor allowing to extract data from the node via an XQuery script. See more details about XQuery.

xquery: |
  data(./manifest.safe/XFDU/metadataSection/
  metadataObject[@ID="generalProductInformation"]/metadataWrap/xmlData/
    *[matches(name(),"standAloneProductInformation|generalProductInformation")]/
    noiseCompressionType)

Python

The Python extractor allowing to extract data from a node via a Python script. Where the node variable represents the current node.

python: |
  return node['DATASTRIP'][0]['MTD_DS.xml']['Level-1C_DataStrip_ID']
      ['General_Info']['Datatake_Info'].get_attribute('datatakeIdentifier')

Script

The Script extractor allowing to extract data from a node via a Python method. A DrbNode given in argument of the extract method will be put in argument.

script: package.module:function1 # execute complex python script to generate the preview

example:

drbItemClass: aff2191f-5b06-4121-a9fa-f3d93f6c6331
variables:
  - name: node_platform
    xquery: |
      ./manifest.safe/XFDU/metadataSection/metadataObject[@ID="platform"]/
        metadataWrap/xmlData/platform
metadata:
  - name: 'platformName'
    constant: 'Sentinel-1'
  - name: 'SatelliteNumber'
    xquery: |
      declare variable $node_platform external;
      data($node_platform/number)
  - name: 'platformIdentifier'
    python: |
      return node_platform['nssdcIdentifier'].value
  - name: 'resolutionDetail'
    python: |
      resolution = node.name[10:11]
      if resolution == 'F':
        return 'Full'
      elif resolution == 'H':
        return 'High'
      elif resolution == 'M':
        return 'Medium'
      return None
  - name: 'index_340_380'
    script: package.module:function1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drb-extractor-1.2.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

drb_extractor-1.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file drb-extractor-1.2.0.tar.gz.

File metadata

  • Download URL: drb-extractor-1.2.0.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.18

File hashes

Hashes for drb-extractor-1.2.0.tar.gz
Algorithm Hash digest
SHA256 30d260b9967cdbfb6d31217481ebfa52c22788ec535d4620aca87216c7f053ba
MD5 efec647705a35f1e13a457169ca848fb
BLAKE2b-256 010051e7af1335c2cf60ebb968780e00de2ed1f1a6d430596f851dfc0c32f771

See more details on using hashes here.

File details

Details for the file drb_extractor-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for drb_extractor-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac03e03ce4d4214835dc1f0a0e82ae636dc13197a1589e722dbac03b70fbc7b4
MD5 29f05e7518114c3d328d701fa1bb8bfe
BLAKE2b-256 55c6190ecb630e2613108d0a078f0b54d9c7a1c4f240d3a0f54160b8d12bc4c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page