def get_lon_lat_dims(dataarray):
	"""
	Get the name of lon and lat corresponding to an dataarray (based on the dimensions of the dataarray).
	"""
	# get correct grid
	dims = dataarray.dims
	lon_name = 'lon_rho'
	lat_name = 'lat_rho'
	for dim in dims:
		if dim.startswith('eta') or dim.startswith('lon'):
			lon_name = dim.replace('eta_', 'lon_')
		if dim.startswith('xi') or dim.startswith('lat'):
			lat_name = dim.replace('xi_', 'lat_')
	assert lon_name.replace('lon_', '') == lat_name.replace('lat_', ''), 'Ey, lon_rho != lon_u altough eta_rho == eta_u'
	return lon_name, lat_name