def wrap_valid_longitude(lon):
 return (((lon + 180.0) % 360.0) - 180.0)

def wrap_valid_longitude ( lon ) : return ( ( ( lon + 180.0 ) % 360.0 ) - 180.0 )
wrap a longitude value around to always have a value in the range [-180 .