OwlCyberSecurity - MANAGER
Edit File: UnitDblConverter.cpython-38.pyc
U ��]� � @ sP d Z ddlZddlmZ ddlm mZ dgZddd�Z G dd� dej �ZdS )z:UnitDblConverter module containing class UnitDblConverter.� N�UnitDblConverterc C sj t | tj d d �}|dkr&t| �S |dkr2dS |dkr>dS |d dkrZd|d � d �S d|� d �S dS )zRadian function formatter.g @g �?r � z$\pi/2$� z$\pi$�$z\pi$z\pi/2$N)�int�npZpi�str)�x�pos�n� r �O/usr/lib/python3/dist-packages/matplotlib/testing/jpl_units/UnitDblConverter.py�rad_fn s r c @ s@ e Zd ZdZdddd�Zedd� �Zedd � �Zed d� �ZdS ) r zy: A matplotlib converter class. Provides matplotlib conversion functionality for the Monte UnitDbl class. Zkm�degZsec)Zdistance�angle�timec C sn ddl m m} | r.t| t�r$| n| �� }nd}|dkrTt|jtj�rTtj� � }n|j dd�}tj||d�S )ae : Returns information on how to handle an axis that has Epoch data. = INPUT VARIABLES - unit The units to use for a axis with Epoch data. = RETURN VALUE - Returns a matplotlib AxisInfo data structure that contains minor/major formatters, major/minor locators, and default label information. r Nr F)Z useOffset)�majfmt�label) �matplotlib.testing.jpl_units�testing� jpl_units� isinstancer r �axes�polar� PolarAxesZThetaFormatterZUnitDblFormatter�unitsZAxisInfo)�unit�axis�Ur r r r r �axisinfo( s zUnitDblConverter.axisinfoc s� ddl m m} d}t�| �rNt| t�sNt| �dkr:g S � �fdd�| D �S t| |j�r^d}|rrt j �| �rr| S �dkr�t� | � ��t� jtj�r�| �� dkr�| �d�S | ���S ) ag : Convert value using unit to a float. If value is a sequence, return the converted sequence. = INPUT VARIABLES - value The value or list of values that need to be converted. - unit The units to use for a axis with Epoch data. = RETURN VALUE - Returns the value parameter converted to floats. r NTc s g | ]}t �|�� ��qS r )r �convert)�.0r �r r r r � <listcomp>\ s z,UnitDblConverter.convert.<locals>.<listcomp>Fr Zrad)r r r r �iterabler r �lenZUnitDblr �ConversionInterfaceZ is_numliker � default_unitsr r r �typer )�valuer r r ZisNotUnitDblr r"