<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_cinema_params(self, cinema_mode, fps):
 """Populate compression parameters structure for cinema2K. Parameters params : ctypes struct Corresponds to compression parameters structure used by the library. cinema_mode : {'cinema2k', 'cinema4k} Use either Cinema2K or Cinema4K profile. fps : {24, 48} Frames per second. """

        if re.match("1.5|2.0", version.openjpeg_version) is not None:
            msg = ("Writing Cinema2K or Cinema4K files is not supported with "
                   "OpenJPEG library versions less than 2.1.0.  The installed "
                   "version of OpenJPEG is {version}.")
            msg = msg.format(version=version.openjpeg_version)
            raise IOError(msg)

        # Cinema modes imply MCT.
        self._cparams.tcp_mct = 1

        if cinema_mode == 'cinema2k':
            if fps not in [24, 48]:
                msg = 'Cinema2K frame rate must be either 24 or 48.'
                raise IOError(msg)

            if fps == 24:
                self._cparams.rsiz = core.OPJ_PROFILE_CINEMA_2K
                self._cparams.max_comp_size = core.OPJ_CINEMA_24_COMP
                self._cparams.max_cs_size = core.OPJ_CINEMA_24_CS
            else:
                self._cparams.rsiz = core.OPJ_PROFILE_CINEMA_2K
                self._cparams.max_comp_size = core.OPJ_CINEMA_48_COMP
                self._cparams.max_cs_size = core.OPJ_CINEMA_48_CS

        else:
            # cinema4k
            self._cparams.rsiz = core.OPJ_PROFILE_CINEMA_4K