DRB Image Extractor
Project description
DRB Image Extractor
It's an applicative part using DRB allowing to extract image from data according its topic.
Metadata
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 thecortex.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 nome to extract
image:
<name>: # Variable name
freq: [270, 300] # Frequency of the image
source:
- <extractor>: <extractor_content> # An extractor
<name_2>: # Variable name
freq: [310, 405] # Frequency of the image
source:
- <extractor>: <extractor_content> # An extractor
---
topic: <topic_uuid>
image:
<name>: # Variable name
source:
- <extractor>: <extractor_content> # An extractor
resolution: <resolution> # Add a resolution value
- <extractor>: <extractor_content> # An extractor
resolution: <resolution> # Add a resolution value
<another_otion> : ... # 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
resolution: 10m
- script: sentinel1.image_addon:my_method
resolution: 20m
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 corresponding to the product
extract = AddonImage.create(node)
# Retrieve the drb-driver-image node corresponding to the addon using the default extraction, here thumbnail
base_node = extract.node(node)
# Retrieve the drb-driver-image node corresponding to the image name and by default the first resolution
base_node = extract.node(node=node, image_name='QuickLook')
# Retrieve the drb-driver-image node corresponding to the image_name and resolution given in argument
base_node = extract.node(node=node, image_name='QuickLook', resolution='10m')
# This will raise an DrbException because it can't find any image addon
base_node = extract.node(node=node, image_name='Not_existing_image')
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.0.0.tar.gz
(27.2 kB
view hashes)
Built Distribution
Close
Hashes for drb_image-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f8cd86c6eac9a1db036ee451de940d95261a5ebaf238a70ba2404bed8707423 |
|
MD5 | d2d95fe9340d6793660f004fbeec3141 |
|
BLAKE2b-256 | ae1e5e92075fd4e69e7d90b0d6559a775bc2c87cecfec458359aae2f638af77e |