Skip to main content

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.addon.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:                                      # image is an array of object with a name, a source and auxiliaries data
  - name: 
      <extractor>: <extractor_content>      # An extrator for the images name
    source:
      <extractor>: <extractor_content>      # An extractor the images itself
    aux_data:                               # Auxiliaries data are optional
      <aux_data1>: value1
      <aux_data2>: value2


### How to extract an image ?

For the following addon description.

```yaml
topic: b0dad6fa-9ae4-4694-b00b-449cd456d32a # Sentinel-1A Interferometric Wide Swath Level 1 S Product
image:
  - name:
      constant: quicklook
    source:
      xquery: |
        /preview/quick-look.png
  - name:
      constant: thumbnail
    source:
      xquery: /thumbnail.png

The different image node can be extract with this:

from drb.image.core import ImageAddon
import drb.topics.resolver as resolver


if __name__ == '__main__':
    node = resolver.create('S1A_IW_RAW__0SDH_20220201T101715_20220201T101734_041718_04F6C6_A26E.SAFE')
    
    # Retrieve the first addon image object corresponding to the product
    # here, the quicklook image
    image = ImageAddon().apply(node)
    
    # Retrieve the addon image object corresponding to the image name
    image = ImageAddon().apply(node=node, image_name='thumbnail') 

    # Retrieve the addon image object corresponding to the image_name and resolution given in argument
    image = ImageAddon().apply(node=node, image_name='quickLook', resolution='10m')
    
    # This will raise an DrbException because it can't find any image addon
    image = ImageAddon().apply(node=node, image_name='Non_existing_image')
    
    # To retrieve the DrbNode corresponding to the image, use:
    image_node = image.image_node()

If a topic defines more than one image, and image_name is not specified, ImageAddon().apply() return 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

Metadata

Release files for drb-image 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drb-image 1.3.0
File Size Uploaded
drb-image-1.3.0.tar.gz 27.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drb-image 1.3.0
File Interpreter ABI Platform
drb_image-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / drb-image-1.3.0.tar.gz

Download URL drb-image-1.3.0.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c047dfa4f50f1431435f82800ee34f1cc0e66b4894dd2a457392bc2b97b009f7
BLAKE2b-256 checksum
How to use checksums
00b2be7f83b6fb1de10d424784e4c18ad7d641d48fd543a34b2623fb5fa1df72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.18

Release files / drb_image-1.3.0-py3-none-any.whl

Download URL drb_image-1.3.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41d264906772895fc8168c88b2aa66acbf9c608f55a21945f74f3f6bcbfd317c
BLAKE2b-256 checksum
How to use checksums
b11e85f00a49d0f7bd6a5f47f6a5c8d80524178e7ad25dcf11125131e8a3acf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.18

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page