<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_sector(self, channel, nlines, ncols):
 """Determine which sector was scanned"""

        if self._is_vis(channel):
            margin = 100
            sectors_ref = self.vis_sectors
        else:
            margin = 50
            sectors_ref = self.ir_sectors

        for (nlines_ref, ncols_ref), sector in sectors_ref.items():
            if np.fabs(ncols - ncols_ref) < margin and \
                    np.fabs(nlines - nlines_ref) < margin:
                return sector

        return UNKNOWN_SECTOR