SIDD product creation elements (sarpy.processing.sidd.sidd_product_creation)

Methods for creating a variety of SIDD products.

Examples

Create a variety of sidd products.

import os

from sarpy.io.complex.converter import open_complex
from sarpy.processing.ortho_rectify import BivariateSplineMethod, NearestNeighborMethod
from sarpy.processing.sidd.sidd_product_creation import create_detected_image_sidd, create_csi_sidd, create_dynamic_image_sidd

# open a sicd type file
reader = open_complex('<sicd type object file name>')
# create an orthorectification helper for specified sicd index
ortho_helper = NearestNeighborMethod(reader, index=0)

# create a sidd version 2 detected image for the whole file
create_detected_image_sidd(ortho_helper, '<output directory>', block_size=10, version=2)
# create a sidd version 2 color sub-aperture image for the whole file
create_csi_sidd(ortho_helper, '<output directory>', dimension=0, version=2)
# create a sidd version 2 dynamic image/sub-aperture stack for the whole file
create_dynamic_image_sidd(ortho_helper, '<output directory>', dimension=0, version=2)
sarpy.processing.sidd.sidd_product_creation.create_detected_image_sidd(ortho_helper, output_directory, output_file=None, block_size=10, dimension=0, bounds=None, version=3, include_sicd=True, remap_function=None)

Create a SIDD version of a basic detected image from a SICD type reader.

Parameters:
  • ortho_helper (OrthorectificationHelper) – The ortho-rectification helper object.

  • output_directory (str) – The output directory for the given file.

  • output_file (None|str) – The file name, this will default to a sensible value.

  • block_size (int) – The approximate processing block size to fetch, given in MB. The minimum value for use here will be 1.

  • dimension (int) – Which dimension to split over in block processing? Must be either 0 or 1.

  • bounds (None|numpy.ndarray|list|tuple) – The sicd pixel bounds of the form (min row, max row, min col, max col). This will default to the full image.

  • version (int) – The SIDD version to use, must be one of 1, 2, or 3.

  • include_sicd (bool) – Include the SICD structure in the SIDD file?

  • remap_function (None|MonochromaticRemap) – The applied remap function. If one is not provided, then a default is used. Required global parameters will be calculated if they are missing, so the internal state of this remap function may be modified.

Return type:

None

Examples

import os

from sarpy.io.complex.converter import open_complex
from sarpy.processing.ortho_rectify import BivariateSplineMethod, NearestNeighborMethod
from sarpy.processing.sidd.sidd_product_creation import create_detected_image_sidd

reader = open_complex('<sicd type object file name>')
ortho_helper = NearestNeighborMethod(reader, index=0)

# create a sidd version 2 file for the whole file
create_detected_image_sidd(ortho_helper, '<output directory>', block_size=10, version=2)
sarpy.processing.sidd.sidd_product_creation.create_csi_sidd(ortho_helper, output_directory, output_file=None, dimension=0, block_size=30, bounds=None, version=3, include_sicd=True, remap_function=None)

Create a SIDD version of a Color Sub-Aperture Image from a SICD type reader.

Parameters:
  • ortho_helper (OrthorectificationHelper) – The ortho-rectification helper object.

  • output_directory (str) – The output directory for the given file.

  • output_file (None|str) – The file name, this will default to a sensible value.

  • dimension (int) – The dimension over which to split the sub-aperture.

  • block_size (int) – The approximate processing block size to fetch, given in MB. The minimum value for use here will be 1.

  • bounds (None|numpy.ndarray|list|tuple) – The sicd pixel bounds of the form (min row, max row, min col, max col). This will default to the full image.

  • version (int) – The SIDD version to use, must be one of 1, 2, or 3.

  • include_sicd (bool) – Include the SICD structure in the SIDD file?

  • remap_function (None|MonochromaticRemap) – The applied remap function. For csi processing, this must explicitly be an 8-bit remap. If one is not provided, then a default is used. Required global parameters will be calculated if they are missing, so the internal state of this remap function may be modified.

Return type:

None

Examples

import os
from sarpy.io.complex.converter import open_complex
from sarpy.processing.sidd.sidd_product_creation import create_csi_sidd
from sarpy.processing.sicd.csi import CSICalculator
from sarpy.processing.ortho_rectify import NearestNeighborMethod

reader = open_complex('<sicd type object file name>')
ortho_helper = NearestNeighborMethod(reader, index=0)
create_csi_sidd(ortho_helper, '<output directory>', dimension=0, version=2)
sarpy.processing.sidd.sidd_product_creation.create_dynamic_image_sidd(ortho_helper, output_directory, output_file=None, dimension=0, block_size=10, bounds=None, frame_count=9, aperture_fraction=0.2, method='FULL', version=3, include_sicd=True, remap_function=None)

Create a SIDD version of a Dynamic Image (Sub-Aperture Stack) from a SICD type reader.

Parameters:
  • ortho_helper (OrthorectificationHelper) – The ortho-rectification helper object.

  • output_directory (str) – The output directory for the given file.

  • output_file (None|str) – The file name, this will default to a sensible value.

  • dimension (int) – The dimension over which to split the sub-aperture.

  • block_size (int) – The approximate processing block size to fetch, given in MB. The minimum value for use here will be 1.

  • bounds (None|numpy.ndarray|list|tuple) – The sicd pixel bounds of the form (min row, max row, min col, max col). This will default to the full image.

  • frame_count (int) – The number of frames to calculate.

  • aperture_fraction (float) – The relative size of each aperture window.

  • method (str) – The subaperture processing method, which must be one of (‘NORMAL’, ‘FULL’, ‘MINIMAL’).

  • version (int) – The SIDD version to use, must be one of 1, 2, or 3.

  • include_sicd (bool) – Include the SICD structure in the SIDD file?

  • remap_function (None|MonochromaticRemap) – The applied remap function. If one is not provided, then a default is used. Required global parameters will be calculated if they are missing, so the internal state of this remap function may be modified.

Return type:

None

Examples

Create a basic dynamic image.

import os
from sarpy.io.complex.converter import open_complex
from sarpy.processing.sidd.sidd_product_creation import create_dynamic_image_sidd
from sarpy.processing.sicd.csi import CSICalculator
from sarpy.processing.ortho_rectify import NearestNeighborMethod

reader = open_complex('<sicd type object file name>')
ortho_helper = NearestNeighborMethod(reader, index=0)
create_dynamic_image_sidd(ortho_helper, '<output directory>', dimension=0, version=2)