#NEWLINE# def __init__( self , collection , acquisition , dataset ) : #NEWLINE# #INDENT# self . collection = collection #NEWLINE# self . datacube = collection . datacube #NEWLINE# self . db = IngestDBWrapper ( self . datacube . db_connection ) #NEWLINE# dataset_key = collection . get_dataset_key ( dataset ) #NEWLINE# self . dataset_bands = collection . new_bands [ dataset_key ] #NEWLINE# self . dataset = dataset #NEWLINE# self . mdd = dataset . metadata_dict #NEWLINE# self . dataset_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for field in self . DATASET_METADATA_FIELDS : #NEWLINE# #INDENT# self . dataset_dict [ field ] = self . mdd [ field ] #NEWLINE# #UNINDENT# self . dataset_dict [ 'acquisition_id' ] = acquisition . acquisition_id #NEWLINE# self . dataset_dict [ 'crs' ] = self . mdd [ 'projection' ] #NEWLINE# self . dataset_dict [ 'level_name' ] = self . mdd [ 'processing_level' ] #NEWLINE# self . dataset_dict [ 'level_id' ] = self . db . get_level_id ( self . dataset_dict [ 'level_name' ] ) #NEWLINE# self . dataset_dict [ 'dataset_id' ] = self . db . get_dataset_id ( self . dataset_dict ) #NEWLINE# if ( self . dataset_dict [ 'dataset_id' ] is None ) : #NEWLINE# #INDENT# self . dataset_dict [ 'dataset_id' ] = self . db . insert_dataset_record ( self . dataset_dict ) #NEWLINE# self . needs_update = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . __check_update_ok ( ) #NEWLINE# self . needs_update = True #NEWLINE# #UNINDENT# self . dataset_id = self . dataset_dict [ 'dataset_id' ]