@@ -209,7 +209,7 @@ def _create_plane_projection_v3(proj_helper, bounds):
209209#########################
210210# Version 3 element creation
211211
212- def create_sidd_structure_v3 (ortho_helper , bounds , product_class , pixel_type ):
212+ def create_sidd_structure_v3 (ortho_helper , bounds , product_class , pixel_type , remap_function = None ):
213213 """
214214 Create a SIDD version 3.0 structure based on the orthorectification helper
215215 and pixel bounds.
@@ -244,9 +244,9 @@ def _create_display_v3():
244244 NonInteractiveProcessing = [NonInteractiveProcessingType3 (
245245 ProductGenerationOptions = ProductGenerationOptionsType3 (
246246 DataRemapping = NewLookupTableType3 (
247- LUTName = 'DENSITY' ,
247+ LUTName = remap_function . name . upper () ,
248248 Predefined = PredefinedLookupType3 (
249- DatabaseName = 'DENSITY' ))),
249+ DatabaseName = remap_function . name . upper () ))),
250250 RRDS = RRDSType3 (DownsamplingMethod = 'DECIMATE' ),
251251 band = i + 1 ) for i in range (bands )],
252252 InteractiveProcessing = [InteractiveProcessingType3 (
@@ -326,7 +326,7 @@ def _create_exploitation_v3():
326326#########################
327327# Version 2 element creation
328328
329- def create_sidd_structure_v2 (ortho_helper , bounds , product_class , pixel_type ):
329+ def create_sidd_structure_v2 (ortho_helper , bounds , product_class , pixel_type , remap_function = None ):
330330 """
331331 Create a SIDD version 2.0 structure based on the orthorectification helper
332332 and pixel bounds.
@@ -361,9 +361,9 @@ def _create_display_v2():
361361 NonInteractiveProcessing = [NonInteractiveProcessingType2 (
362362 ProductGenerationOptions = ProductGenerationOptionsType2 (
363363 DataRemapping = NewLookupTableType (
364- LUTName = 'DENSITY' ,
364+ LUTName = remap_function . name . upper () ,
365365 Predefined = PredefinedLookupType (
366- DatabaseName = 'DENSITY' ))),
366+ DatabaseName = remap_function . name . upper () ))),
367367 RRDS = RRDSType2 (DownsamplingMethod = 'DECIMATE' ),
368368 band = i + 1 ) for i in range (bands )],
369369 InteractiveProcessing = [InteractiveProcessingType2 (
@@ -521,7 +521,7 @@ def _create_exploitation_v1():
521521##########################
522522# Switchable version SIDD structure
523523
524- def create_sidd_structure (ortho_helper , bounds , product_class , pixel_type , version = 3 ):
524+ def create_sidd_structure (ortho_helper , bounds , product_class , pixel_type , version = 3 , remap_function = None ):
525525 """
526526 Create a SIDD structure, with version specified, based on the orthorectification
527527 helper and pixel bounds.
@@ -550,6 +550,6 @@ def create_sidd_structure(ortho_helper, bounds, product_class, pixel_type, versi
550550 if version == 1 :
551551 return create_sidd_structure_v1 (ortho_helper , bounds , product_class , pixel_type )
552552 elif version == 2 :
553- return create_sidd_structure_v2 (ortho_helper , bounds , product_class , pixel_type )
553+ return create_sidd_structure_v2 (ortho_helper , bounds , product_class , pixel_type , remap_function = remap_function )
554554 else :
555- return create_sidd_structure_v3 (ortho_helper , bounds , product_class , pixel_type )
555+ return create_sidd_structure_v3 (ortho_helper , bounds , product_class , pixel_type , remap_function = remap_function )
0 commit comments