def pyprf_sim(strPrior, strStmApr, lgcNoise=False, lgcRtnNrl=True,<EOL>lstRat=None, lgcTest=False):
<EOL>dicCnfg = load_config(strPrior, lgcTest=lgcTest)<EOL>cfg = cls_set_config(dicCnfg)<EOL>if lstRat is not None:<EOL><INDENT>cfg.strPathOut = cfg.strPathOut + '<STR_LIT>'<EOL><DEDENT>lstWnrPrm = [cfg.strPathOut + '<STR_LIT>',<EOL>cfg.strPathOut + '<STR_LIT>',<EOL>cfg.strPathOut + '<STR_LIT>']<EOL>errorMsg = '<STR_LIT>'<EOL>assert os.path.isfile(lstWnrPrm[<NUM_LIT:0>]), errorMsg<EOL>assert os.path.isfile(lstWnrPrm[<NUM_LIT:1>]), errorMsg<EOL>assert os.path.isfile(lstWnrPrm[<NUM_LIT:2>]), errorMsg<EOL>aryIntGssPrm = load_res_prm(lstWnrPrm,<EOL>lstFlsMsk=[cfg.strPathNiiMask])[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>if lstRat is not None:<EOL><INDENT>lstPathBeta = [cfg.strPathOut + '<STR_LIT>']<EOL>aryBetas = load_res_prm(lstPathBeta,<EOL>lstFlsMsk=[cfg.strPathNiiMask])[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>lstPathRat = [cfg.strPathOut + '<STR_LIT>']<EOL>aryRat = load_res_prm(lstPathRat, lstFlsMsk=[cfg.strPathNiiMask])[<NUM_LIT:0>][<NUM_LIT:0>]<EOL><DEDENT>aryLgcMsk, aryLgcVar, hdrMsk, aryAff, _, tplNiiShp = prep_func(<EOL>cfg.strPathNiiMask, cfg.lstPathNiiFunc, varAvgThr=<NUM_LIT>)<EOL>aryIntGssPrm = aryIntGssPrm[aryLgcVar, :]<EOL>if lstRat is not None:<EOL><INDENT>aryBetas = aryBetas[aryLgcVar, :]<EOL>aryRat = aryRat[aryLgcVar]<EOL><DEDENT>aryStmApr = np.load(strStmApr)<EOL>tplStmApr = aryStmApr.shape[:<NUM_LIT:2>]<EOL>vecIntX, vecIntY, vecIntSd = rmp_deg_pixel_xys(aryIntGssPrm[:, <NUM_LIT:0>],<EOL>aryIntGssPrm[:, <NUM_LIT:1>],<EOL>aryIntGssPrm[:, <NUM_LIT:2>],<EOL>tplStmApr,<EOL>cfg.varExtXmin,<EOL>cfg.varExtXmax,<EOL>cfg.varExtYmin,<EOL>cfg.varExtYmax)<EOL>aryIntGssPrmPxl = np.column_stack((vecIntX, vecIntY, vecIntSd))<EOL>print('<STR_LIT>')<EOL>aryMdlRsp = crt_mdl_rsp(aryStmApr, tplStmApr, aryIntGssPrmPxl, cfg.varPar)<EOL>if lstRat is not None:<EOL><INDENT>aryIntGssPrmPxlSur = np.copy(aryIntGssPrmPxl)<EOL>aryIntGssPrmPxlSur[:, <NUM_LIT:2>] = np.multiply(aryIntGssPrmPxlSur[:, <NUM_LIT:2>],<EOL>aryRat)<EOL>aryMdlRspSur = crt_mdl_rsp(aryStmApr, tplStmApr, aryIntGssPrmPxlSur,<EOL>cfg.varPar)<EOL>varGainRat = np.divide(aryBetas[:, <NUM_LIT:0>], aryBetas[:, <NUM_LIT:1>])<EOL>aryMdlRsp = np.subtract(aryMdlRsp,<EOL>np.multiply(varGainRat, aryMdlRspSur))<EOL><DEDENT>aryMdlRspUps = np.repeat(aryMdlRsp, cfg.varTmpOvsmpl, axis=-<NUM_LIT:1>)<EOL>arySimRsp = crt_prf_tc(aryMdlRspUps, aryMdlRsp.shape[-<NUM_LIT:1>], cfg.varTr,<EOL>cfg.varTmpOvsmpl, <NUM_LIT:1>, tplStmApr, cfg.varPar)<EOL>if arySimRsp.shape[<NUM_LIT:1>] > <NUM_LIT:1>:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>arySimRsp = np.squeeze(arySimRsp)<EOL>del(aryMdlRspUps)<EOL>if lgcNoise:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>lstNiiNames = ['<STR_LIT>']<EOL>lstNiiNames = [cfg.strPathOut + strNii + '<STR_LIT>' for strNii in<EOL>lstNiiNames]<EOL>print('<STR_LIT>')<EOL>export_nii(arySimRsp, lstNiiNames, aryLgcMsk, aryLgcVar, tplNiiShp,<EOL>aryAff, hdrMsk, outFormat='<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>if lgcRtnNrl:<EOL><INDENT>lstNiiNames = ['<STR_LIT>']<EOL>lstNiiNames = [cfg.strPathOut + strNii + '<STR_LIT>' for strNii in<EOL>lstNiiNames]<EOL>print('<STR_LIT>')<EOL>export_nii(aryMdlRsp, lstNiiNames, aryLgcMsk, aryLgcVar, tplNiiShp,<EOL>aryAff, hdrMsk, outFormat='<STR_LIT>')<EOL>print('<STR_LIT>')<EOL><DEDENT>
Simulate pRF response given pRF parameters and stimulus apertures.

Parameters
----------
strPrior : str
    Absolute file path of config file used for pRF fitting.
strStmApr : str
    Absolute file path to stimulus aperture used in in-silico experiment.
lgcNoise : boolean
    Should noise be added to the simulated pRF time course. By default, no
    noise is added.
lgcRtnNrl : boolean
    Should neural time course, unconvolved with hrf, be returned as well?
lstRat : None or list
    Ratio of size of center to size of suppressive surround.
lgcTest : boolean
    Whether this is a test (pytest). If yes, absolute path of pyprf libary
    will be prepended to config file paths.

Notes
-----
[1] This function does not return any arguments but, instead, saves nii
    filex to disk.
[2] strStmApr should be a path to a npy file that contains a 3D numpy
    array. This arrays consists of binary images in boolean array from that
    represent the stimulus aperture. Images are stacked along last axis.