<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def sample_id(self, lon):
        ''' Return the corresponding sample

        Args:
            lon (int): longidute in degree

        Returns:
            Correponding sample

        '''
        if self.grid == 'WAC':
            sample = np.rint(float(self.SAMPLE_PROJECTION_OFFSET) + 1.0 +
                             (lon * np.pi / 180.0 - float(self.CENTER_LONGITUDE)) *
                             self.A_AXIS_RADIUS *
                             np.cos(self.CENTER_LATITUDE * np.pi / 180.0)
                             / (self.MAP_SCALE * 1e-3))
        else:
            sample = np.rint(float(self.SAMPLE_PROJECTION_OFFSET) + float(self.MAP_RESOLUTION)
                             * (lon - float(self.CENTER_LONGITUDE))) + 1
        return self._control_sample(sample)