#NEWLINE# def get_acquisition_id_exact( self , acquisition_dict ) : #NEWLINE# #INDENT# 'Finds the id of an acquisition record in the database.\n\n        Returns an acquisition_id if a record matching the key fields in\n        acquistion_dict is found, None otherwise. The key fields are:\n            satellite_id, sensor_id, x_ref, y_ref, start_datetime,\n            and end_datetime.\n        The acquisition_dict must contain values for all of these.\n\n        This query requires an exact match for the start and end datetimes.\n        ' #NEWLINE# sql = ( ( ( ( ( ( 'SELECT acquisition_id FROM acquisition\n' + 'WHERE satellite_id = %(satellite_id)s AND\n' ) + '    sensor_id = %(sensor_id)s AND\n' ) + ( '    x_ref = %(x_ref)s AND\n' if ( acquisition_dict [ 'x_ref' ] is not None ) else '    x_ref is null AND\n' ) ) + ( '    y_ref = %(y_ref)s AND\n' if ( acquisition_dict [ 'y_ref' ] is not None ) else '    y_ref is null AND\n' ) ) + '    start_datetime = %(start_datetime)s AND\n' ) + '    end_datetime = %(end_datetime)s;' ) #NEWLINE# result = self . execute_sql_single ( sql , acquisition_dict ) #NEWLINE# acquisition_id = ( result [ 0 ] if result else None ) #NEWLINE# return acquisition_id