s1tiling.libs.otbwrappers.ExtractSentinel1Metadata
- class s1tiling.libs.otbwrappers.ExtractSentinel1Metadata(cfg: Configuration)[source]
Bases:
StepFactory
Factory that takes care of extracting meta data from S1 input files.
Note: At this moment it needs to be used on a separate pipeline to make sure the meta is updated when calling
PipelineDescription.expected()
.New methods & Specialized methods
__init__
_get_canonical_input
Helper function to retrieve the canonical input associated to a list of inputs.
_update_filename_meta_post_hook
Complete meta information such as filenames, GDAL metadata from information found in the current S1 image filename.
Forward the output filename.
As there is no OTB application associated to
ExtractSentinel1Metadata
, there is no temporary filename.Complete meta information with inputs
Set the common and root information that'll get carried around.
Methods inherited from parent
Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding tasks analysis.
Instanciates the step related to the current
StepFactory
, that consumes results from the previous input steps.Abstract method used to test whether a
StepFactory
has all its external requirements fulfilled.Attributes and properties
Property image_description, used to fill
TIFFTAG_IMAGEDESCRIPTION
Step Name property.
- _do_create_actual_step(execution_parameters: Dict, input_step: AbstractStep, meta: Dict) AbstractStep
Generic variation point for the exact step creation. The default implementation returns a new
AbstractStep
.
- _update_filename_meta_pre_hook(meta: Dict) Dict
Hook meant to be overridden to complete product metadata before they are used to produce filenames or tasknames.
Called from
update_filename_meta()
- build_step_output_tmp_filename(meta: Dict) str [source]
As there is no OTB application associated to
ExtractSentinel1Metadata
, there is no temporary filename.
- check_requirements() Tuple[str, str] | None
Abstract method used to test whether a
StepFactory
has all its external requirements fulfilled. For instance,OTBStepFactory
’s will check their related OTB application can be executed.- Returns:
None
if requirements are fulfilled.- Returns:
A message indicating what is missing otherwise, and some context how to fix it.
- complete_meta(meta: Dict, all_inputs: List[Dict[str, AbstractStep]]) Dict [source]
Complete meta information with inputs
- create_step(execution_parameters: Dict, previous_steps: List[List[Dict[str, AbstractStep]]]) AbstractStep
Instanciates the step related to the current
StepFactory
, that consumes results from the previous input steps.1. This methods starts by updating metadata information through:
complete_meta()
on theinput
metadatas.2. Then it updates the GDAL image metadata information that will need to be written in the pipeline output image through
update_image_metadata()
.3. Eventually the actual step creation method is executed according to the exact kind of step factory (
ExecutableStepFactory
,AnyProducerStepFactory
,OTBStepFactory
) through the variation point_do_create_actual_step()
.While this method is not meant to be overridden, for simplity it will be in
Store
factory.Note: it’s possible to override this method to return no step (
None
). In that case, no OTB Application would be registered in the actualPipeline
.
- update_filename_meta(meta: Dict) Dict
Duplicates, completes, and returns, the meta dictionary with specific information for the current factory regarding tasks analysis.
This method is used:
while analysing the dependencies to build the task graph – in this use case the relevant information are the file names and paths.
and indirectly before instanciating a new
Step
Other metadata not filled here:
get_task_name()
which is deduced from out_filename by defaultout_extended_filename_complement()
It’s possible to inject some other metadata (that could be used from
_get_canonical_input()
for instance) thanks to_update_filename_meta_pre_hook()
.This method is not meant to be overridden. Instead it implements the template method design pattern, and expects the customization to be done through the specialization of the hooks:
_update_filename_meta_post_hook()
.