def model_creation_opt(dicCnfg, aryMdlParams, strPathHrf=None, varRat=None,<EOL>lgcPrint=True):
<EOL>cfg = cls_set_config(dicCnfg)<EOL>if cfg.lgcCrteMdl:<EOL><INDENT>arySptExpInf = np.load(cfg.strSptExpInf)<EOL>arySptExpInf = np.rot90(arySptExpInf, k=<NUM_LIT:3>)<EOL>aryTmpExpInf = np.load(cfg.strTmpExpInf)<EOL>if aryTmpExpInf.shape[-<NUM_LIT:1>] == <NUM_LIT:3>:<EOL><INDENT>vecNewCol = np.greater(aryTmpExpInf[:, <NUM_LIT:0>], <NUM_LIT:0>).astype(np.float16)<EOL>aryTmpExpInf = np.concatenate(<EOL>(aryTmpExpInf, np.expand_dims(vecNewCol, axis=<NUM_LIT:1>)), axis=<NUM_LIT:1>)<EOL><DEDENT>if varRat is not None:<EOL><INDENT>aryMdlParamsSur = np.copy(aryMdlParams)<EOL>aryMdlParamsSur[:, <NUM_LIT:2>] = aryMdlParamsSur[:, <NUM_LIT:2>] * varRat<EOL><DEDENT>aryMdlRsp = crt_mdl_rsp(arySptExpInf, (int(cfg.varVslSpcSzeX),<EOL>int(cfg.varVslSpcSzeY)),<EOL>aryMdlParams, cfg.varPar, lgcPrint=lgcPrint)<EOL>if varRat is not None:<EOL><INDENT>aryMdlRspSur = crt_mdl_rsp(arySptExpInf, (int(cfg.varVslSpcSzeX),<EOL>int(cfg.varVslSpcSzeY)),<EOL>aryMdlParamsSur, cfg.varPar,<EOL>lgcPrint=lgcPrint)<EOL><DEDENT>del(arySptExpInf)<EOL>if strPathHrf is not None:<EOL><INDENT>if lgcPrint:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>aryCstPrm = np.load(strPathHrf)<EOL>dctPrm = {}<EOL>dctPrm['<STR_LIT>'] = aryCstPrm[<NUM_LIT:0>]<EOL>dctPrm['<STR_LIT>'] = aryCstPrm[<NUM_LIT:1>]<EOL>dctPrm['<STR_LIT>'] = aryCstPrm[<NUM_LIT:2>]<EOL>dctPrm['<STR_LIT>'] = aryCstPrm[<NUM_LIT:3>]<EOL>dctPrm['<STR_LIT>'] = aryCstPrm[<NUM_LIT:4>]<EOL><DEDENT>else:<EOL><INDENT>if lgcPrint:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>dctPrm = None<EOL><DEDENT>aryPrfTc = crt_prf_ftr_tc(aryMdlRsp, aryTmpExpInf, cfg.varNumVol,<EOL>cfg.varTr, cfg.varTmpOvsmpl,<EOL>cfg.switchHrfSet, (int(cfg.varVslSpcSzeX),<EOL>int(cfg.varVslSpcSzeY)),<EOL>cfg.varPar, dctPrm=dctPrm, lgcPrint=lgcPrint)<EOL>if varRat is not None:<EOL><INDENT>if lgcPrint:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>aryPrfTcSur = crt_prf_ftr_tc(aryMdlRspSur, aryTmpExpInf,<EOL>cfg.varNumVol, cfg.varTr,<EOL>cfg.varTmpOvsmpl, cfg.switchHrfSet,<EOL>(int(cfg.varVslSpcSzeX),<EOL>int(cfg.varVslSpcSzeY)),<EOL>cfg.varPar, dctPrm=dctPrm,<EOL>lgcPrint=lgcPrint)<EOL>aryPrfTc = np.concatenate((aryPrfTc, aryPrfTcSur), axis=<NUM_LIT:1>)<EOL><DEDENT><DEDENT>return aryPrfTc<EOL>
Create or load pRF model time courses.

Parameters
----------
dicCnfg : dict
    Dictionary containing config parameters.
aryMdlParams : numpy arrays
    x, y and sigma parameters.
strPathHrf : str or None:
    Path to npy file with custom hrf parameters. If None, default
    parameters will be used.
varRat : float, default None
    Ratio of size suppressive surround to size of center pRF
lgcPrint : boolean
    Whether print statements should be executed.

Returns
-------
aryPrfTc : np.array
    4D numpy array with pRF time course models, with following dimensions:
    `aryPrfTc[x-position, y-position, SD, volume]`.