def _find_tails(self, mag, rounding=True, half=<NUM_LIT:5>, full=<NUM_LIT:10>, flag=<NUM_LIT:50>):
<EOL>if rounding:<EOL><INDENT>mag = half * (mag / half + <NUM_LIT:0.5>).astype(np.int)<EOL><DEDENT>num_flags = np.floor(mag / flag).astype(np.int)<EOL>mag = np.mod(mag, flag)<EOL>num_barb = np.floor(mag / full).astype(np.int)<EOL>mag = np.mod(mag, full)<EOL>half_flag = mag >= half<EOL>empty_flag = ~(half_flag | (num_flags > <NUM_LIT:0>) | (num_barb > <NUM_LIT:0>))<EOL>return num_flags, num_barb, half_flag, empty_flag<EOL>
Find how many of each of the tail pieces is necessary.  Flag
specifies the increment for a flag, barb for a full barb, and half for
half a barb. Mag should be the magnitude of a vector (ie. >= 0).

This returns a tuple of:

    (*number of flags*, *number of barbs*, *half_flag*, *empty_flag*)

*half_flag* is a boolean whether half of a barb is needed,
since there should only ever be one half on a given
barb. *empty_flag* flag is an array of flags to easily tell if
a barb is empty (too low to plot any barbs/flags.