import metpy.calc as mpcalc
from metpy.units import units

"""
Explanation: Angle to Direction
Demonstrate how to convert angles to direction strings.
The code below shows how to convert angles into directional text.
It also  demonstrates the function's flexibility.
End of explanation
"""


angle_deg = 70 * units('degree')
print(angle_deg)

"""
Explanation: Create a test value of an angle
End of explanation
"""


dir_str = mpcalc.angle_to_direction(angle_deg)
print(dir_str)

"""
Explanation: Now throw that angle into the function to
get the corresponding direction
End of explanation
"""


angle_deg_list = [0, 361, 719]
dir_str_list = mpcalc.angle_to_direction(angle_deg_list)
print(dir_str_list)

"""
Explanation: The function can also handle array of angles,
rounding to the nearest direction, handling angles > 360,
and defaulting to degrees if no units are specified.
End of explanation
"""


full_dir_str_list = mpcalc.angle_to_direction(angle_deg_list, full=True)
print(full_dir_str_list)

"""
Explanation: If you want the unabbrieviated version, input full=True
End of explanation
"""


