Skip to main content

DRB Image Extractor

Project description

DRB Image Extractor

It's an applicative part using DRB allowing to extract image from data according its topic.

Packaging

The package python containing an addon image of a DRB topic must have the following instruction:

  • a drb.image entry point whose its value is the targeted Python package containing the cortex.yaml file

How to define an addon image ?

Addon Image are defined in a cortex.yaml file following the template:

topic: <topic_uuid>                        # target topic
image:
  <name>:                              # Variable name
     source:
      - <extractor>: <extractor_content>       # An extractor
---
topic: <topic_uuid>                        # target topic
default: <name>                            # Default name to extract
image:
  <name>:                                  # Variable name
    source:
      - <extractor>: <extractor_content>       # An extractor
  <name_2>:                                # Variable name
    source:
      - <extractor>: <extractor_content>       # An extractor
---
topic: <topic_uuid>
image:  
  <name>:                                  # Variable name
    source:
      - <extractor>: <extractor_content> # An extractor
      - <extractor>: <extractor_content> # An extractor
        <another_options> : ...            # Add another option

How to extract an image ?

For the following addon description.

topic: b0dad6fa-9ae4-4694-b00b-449cd456d32a # Sentinel-1A Interferometric Wide Swath Level 1 S Product
default: thumbnail
image:  
  QuickLook:                                  
    source:
      - xquery: /preview/quick-look.png
      - script: sentinel1.image_addon:my_method 
  thumbnail:
    source:
      - xquery: /thumbnail.png

The different image node can be extract with this:

from drb.image import AddonImage
import drb.topics.resolver as resolver


if __name__ == '__main__':
    node = resolver.create('S1A_IW_RAW__0SDH_20220201T101715_20220201T101734_041718_04F6C6_A26E.SAFE')
    
    # Retrieve the addon image object corresponding to the product
    extract = AddonImage.create(node)
    
    # Retrieve the addon image object corresponding to the image name and by default the first resolution
    extract = AddonImage.create(node=node, image_name='QuickLook') 

    # Retrieve the addon image object corresponding to the image_name and resolution given in argument
    extract = AddonImage.create(node=node, image_name='QuickLook', resolution='10m')
    
    # This will raise an DrbException because it can't find any image addon
    extract = AddonImage.create(node=node, image_name='Not_existing_image')

    # Retrieve the drb-driver-image node corresponding to the addon using the default extraction, here thumbnail
    image_node = extract.image_node() 

If a topic defines more than one image, and image_name is not specified, AddonImage.create() return the default image if it is set, or the first image declared in the topic. If the topic of the node is not found in the cortex file, it will also check all the topic's parents recursively.

Extractor

All the information about extractor can be found here

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-image-1.2.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drb_image-1.2.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for drb-image-1.2.0.tar.gz
Algorithm Hash digest
SHA256 cb5c7f48203d6faaf25e94cf968fc8833461776b5a06ff9bc282144bb9f975ae
MD5 e1066c1aecf13e13b2dbdfbb9003aa83
BLAKE2b-256 e5150d4b301d37ad21db60695e38a3e064ce2f6f6402bfe5b0043d9dfd53dd75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: drb_image-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.18

File hashes

Hashes for drb_image-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f059b96c83b4388010a35b82af8066acaa784ac119849148f75220cb85cad1c9
MD5 4483c4f7922e57081f54afe1e1420386
BLAKE2b-256 926f4b6238edd257746392f7e49747409288c30c6a38dbe59223a1d74a8116d9

See more details on using hashes here.

Supported by

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