#NEWLINE# def _validate_inputs( self , lats , lons , times , values ) : #NEWLINE# #INDENT# 'Check that Dataset inputs are valid.\n        \n        :raises: ValueError\n        ' #NEWLINE# err_msg = None #NEWLINE# lat_dim = len ( lats . shape ) #NEWLINE# lon_dim = len ( lons . shape ) #NEWLINE# time_dim = len ( times . shape ) #NEWLINE# value_dim = len ( values . shape ) #NEWLINE# lat_count = lats . shape [ 0 ] #NEWLINE# lon_count = lons . shape [ 0 ] #NEWLINE# if ( ( lat_dim == 2 ) and ( lon_dim == 2 ) ) : #NEWLINE# #INDENT# lon_count = lons . shape [ 1 ] #NEWLINE# #UNINDENT# time_count = times . shape [ 0 ] #NEWLINE# if ( time_dim != 1 ) : #NEWLINE# #INDENT# err_msg = ( 'Time Array should be 1 dimensional.  %s dimensions found.' % time_dim ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( value_dim < 2 ) : #NEWLINE# #INDENT# err_msg = ( 'Value Array should be at least 2 dimensional.  %s dimensions found.' % value_dim ) #NEWLINE# #UNINDENT# #UNINDENT# if ( value_dim == 2 ) : #NEWLINE# #INDENT# if ( ( values . shape [ 0 ] != time_count ) and ( values . shape != ( lat_count , lon_count ) ) ) : #NEWLINE# #INDENT# err_msg = ( 'Value Array must be of shape (lats, lons) or (times, locations).\n                Expected shape (%s, %s) but received (%s, %s)' % ( lat_count , lon_count , values . shape [ 0 ] , values . shape [ 1 ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( value_dim == 3 ) and ( values . shape != ( time_count , lat_count , lon_count ) ) ) : #NEWLINE# #INDENT# err_msg = ( 'Value Array must be of shape (times, lats, lons).\n            Expected shape (%s, %s, %s) but received (%s, %s, %s)' % ( time_count , lat_count , lon_count , values . shape [ 0 ] , values . shape [ 1 ] , values . shape [ 2 ] ) ) #NEWLINE# #UNINDENT# if err_msg : #NEWLINE# #INDENT# logger . error ( lat_dim ) #NEWLINE# raise ValueError ( err_msg )