@classmethod<EOL><INDENT>def __intervals_from_tops(self,<EOL>tops,<EOL>values,<EOL>basis,<EOL>components,<EOL>field=None,<EOL>ignore_nan=True):<DEDENT>
<EOL>length = float(basis.size)<EOL>start, stop = basis[<NUM_LIT:0>], basis[-<NUM_LIT:1>]<EOL>tops = [start + (p/(length-<NUM_LIT:1>)) * (stop-start) for p in tops]<EOL>bases = tops[<NUM_LIT:1>:] + [stop]<EOL>list_of_Intervals = []<EOL>for i, t in enumerate(tops):<EOL><INDENT>v, c, d = values[i], [], {}<EOL>if ignore_nan and np.isnan(v):<EOL><INDENT>continue<EOL><DEDENT>if (field is not None):<EOL><INDENT>d = {field: v}<EOL><DEDENT>if components is not None:<EOL><INDENT>try:<EOL><INDENT>c = [deepcopy(components[int(v)])]<EOL><DEDENT>except IndexError:<EOL><INDENT>c = []<EOL><DEDENT>if c and (c[<NUM_LIT:0>] is None):<EOL><INDENT>c = []<EOL><DEDENT><DEDENT>interval = Interval(t, bases[i], data=d, components=c)<EOL>list_of_Intervals.append(interval)<EOL><DEDENT>return list_of_Intervals<EOL>
Private method. Take a sequence of tops in an arbitrary dimension,
and provide a list of intervals from which a striplog can be made.

This is only intended to be used by ``from_image()``.

Args:
    tops (iterable). A list of floats.
    values (iterable). A list of values to look up.
    basis (iterable). A list of components.
    components (iterable). A list of Components.

Returns:
    List. A list of Intervals.