<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def thin(self, thin_interval):
 """Thins the samples on disk using the given thinning interval. Parameters thin_interval : int The interval to thin by. """

        # read thinned samples into memory
        params = self[self.samples_group].keys()
        samples = self.read_raw_samples(params, thin_start=0,
                                        thin_interval=thin_interval,
                                        thin_end=None,
                                        flatten=False)
        # now resize and write the data back to disk
        group = self[self.samples_group]
        for param in params:
            data = samples[param]
            # resize the arrays on disk
            group[param].resize(data.shape)
            # and write
            group[param][:] = data
        # store the interval that samples were thinned by
        self.thinned_by *= thin_interval
        # If a default thin interval and thin start exist, reduce them by the
        # thinned interval. If the thin interval is not an integer multiple
        # of the original, we'll round up, to avoid getting samples from
        # before the burn in / at an interval less than the ACL.
        self.thin_start = int(numpy.ceil(self.thin_start/thin_interval))
        self.thin_interval = int(numpy.ceil(self.thin_interval/thin_interval))