#NEWLINE# def remove_mosaics( self , dataset_filter ) : #NEWLINE# #INDENT# "Remove mosaics associated with the dataset.\n\n        This will mark mosaic files for removal, delete mosaic database\n        records if they exist, and update the tile class of overlapping\n        tiles (from other datasets) to reflect the lack of a mosaic. The\n        'dataset_filter' is a list of dataset_ids to filter on. It should\n        be the list of dataset_ids that have been locked (including this\n        dataset). It is used to avoid operating on the tiles of an\n        unlocked dataset.\n        " #NEWLINE# overlap_dict = self . db . get_overlapping_tiles_for_dataset ( self . dataset_id , input_tile_class_filter = ( TC_SINGLE_SCENE , TC_SUPERSEDED , TC_MOSAIC ) , output_tile_class_filter = ( TC_MOSAIC , ) , dataset_filter = dataset_filter ) #NEWLINE# for tile_record_list in overlap_dict . values ( ) : #NEWLINE# #INDENT# for tr in tile_record_list : #NEWLINE# #INDENT# self . db . remove_tile_record ( tr [ 'tile_id' ] ) #NEWLINE# self . collection . mark_tile_for_removal ( tr [ 'tile_pathname' ] ) #NEWLINE# #UNINDENT# #UNINDENT# overlap_dict = self . db . get_overlapping_tiles_for_dataset ( self . dataset_id , input_tile_class_filter = ( TC_SINGLE_SCENE , TC_SUPERSEDED ) , output_tile_class_filter = ( TC_SINGLE_SCENE , TC_SUPERSEDED ) , dataset_filter = dataset_filter ) #NEWLINE# for tile_record_list in overlap_dict . values ( ) : #NEWLINE# #INDENT# if ( len ( tile_record_list ) > 2 ) : #NEWLINE# #INDENT# raise DatasetError ( ( ( 'Attempt to update a mosaic of three or ' + 'more datasets. Handling for this case ' ) + 'is not yet implemented.' ) ) #NEWLINE# #UNINDENT# for tr in dataset_filter : #NEWLINE# #INDENT# if ( tr [ 'dataset_id' ] != self . dataset_id ) : #NEWLINE# #INDENT# self . db . update_tile_class ( tr [ 'tile_id' ] , TC_SINGLE_SCENE ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for tile_record_list in overlap_dict . values ( ) : #NEWLINE# #INDENT# if ( len ( tile_record_list ) > 1 ) : #NEWLINE# #INDENT# tr = tile_record_list [ 0 ] #NEWLINE# mosaic_pathname = self . __make_mosaic_pathname ( tr [ 'tile_pathname' ] ) #NEWLINE# if os . path . isfile ( mosaic_pathname ) : #NEWLINE# #INDENT# self . collection . mark_tile_for_removal ( mosaic_pathname )