<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_binary(self, threshold=0.0):
 """Creates a BinaryImage from the depth image. Points where the depth is greater than threshold are converted to ones, and all other points are zeros. Parameters threshold : float The depth threshold. Returns ------- :obj:`BinaryImage` A BinaryImage where all 1 points had a depth greater than threshold in the DepthImage. """

        data = BINARY_IM_MAX_VAL * (self._data > threshold)
        return BinaryImage(data.astype(np.uint8), self._frame)