diff --git a/__pycache__/utils_all_down.cpython-39.pyc b/__pycache__/utils_all_down.cpython-39.pyc index 26f99d9..4c1d1c1 100644 Binary files a/__pycache__/utils_all_down.cpython-39.pyc and b/__pycache__/utils_all_down.cpython-39.pyc differ diff --git a/__pycache__/utils_paper.cpython-39.pyc b/__pycache__/utils_paper.cpython-39.pyc index 17db23c..dcb91fd 100644 Binary files a/__pycache__/utils_paper.cpython-39.pyc and b/__pycache__/utils_paper.cpython-39.pyc differ diff --git a/data_overview_mod.csv b/data_overview_mod.csv new file mode 100644 index 0000000..0dc6f41 --- /dev/null +++ b/data_overview_mod.csv @@ -0,0 +1,1977 @@ +,cell,cell_type,d_isf_all,d_osf_all,d_isf1,d_osf1,var_stim,var_spikes,c_orig,c_unit,c_len,start,end,sd,rep,names_mt_gwn,data_between_2017_2018,trial_nr,snippets,cv_wo_burstcorr,fr_wo_burstcorr,ser,dev,way,loop,trials,stimulus_length,eodf_size,response_modulation,response_variation,response_modulation05,response_variation05,cv,fr,ser_first,ser_sum,mt_nr_last,cv_stim,ser_first_stim,fr_stim,ser_stim,ser_sum_stim,brainregion,structure,sampling,species,eod_fr,amp,burst_factor_burst_corr_stim,burst_fraction_burst_corr_stim,burst_factor_burst_corr2.5_stim,burst_fraction_burst_corr2.5_stim,burst_factor_burst_corr_individual_stim,burst_fraction_burst_corr_individual_stim,isi_nr,celltype,nfft,duration,file_name,file_name2,stimulus,cell_type_reclassified,burst_factor_burst_corr_base,burst_factor_burst_corr_individual_base,sum_corr_base,cv_base,fr_base,ser_first_base,ser_base,burst_fraction_burst_corr_base,burst_fraction_burst_corr_individual_base,lim_individual,cv_min,cv_base_w_burstcorr,fr_base_w_burstcorr,cv_base_w_burstcorr1.5,fr_base_w_burstcorr1.5,cv_given,amp_eodf,coherence_max_,coherence_,coherence_abs_,transfer_,csd_,mutual_informaiton_,mutual_informaiton_abs_,linear_kernel_,linear_kernel_abs_,max(diag1Hz)/med_diagonal_proj_fr,max(diag5Hz)/med_diagonal_proj_fr,max(diag50Hz)/med_diagonal_proj_fr,max(diag1Hz)/med_diagonal_proj_fr_base_w_burstcorr,max(diag5Hz)/med_diagonal_proj_fr_base_w_burstcorr,max(diag50Hz)/med_diagonal_proj_fr_base_w_burstcorr,max(diag1Hz)/med_diagonal_proj_fr_base_w_burstcorr1.5,max(diag5Hz)/med_diagonal_proj_fr_base_w_burstcorr1.5,max(diag50Hz)/med_diagonal_proj_fr_base_w_burstcorr1.5,max(diag1Hz)/med_diagonal_proj_eodf/2,max(diag5Hz)/med_diagonal_proj_eodf/2,max(diag50Hz)/med_diagonal_proj_eodf/2,perc99_diagonal_proj,med_diagonal_proj,stdthunder_diagonal_proj,stdthunder2.576_diagonal_proj,stdsigma_diagonal_proj,stdorig_diagonal_proj,center_diagonal_proj,perc99/_diagonal_proj,perc99/med_diagonal_proj,perc99/stdthunder_diagonal_proj,perc99.9_diagonal_proj,perc99.9/_diagonal_proj,perc99.9/med_diagonal_proj,perc99.9/stdthunder_diagonal_proj,perc99-med/_diagonal_proj,perc99-med/med_diagonal_proj,perc99-med/stdthunder_diagonal_proj,perc99.9-med/_diagonal_proj,perc99.9-med/med_diagonal_proj,perc99.9-med/stdthunder_diagonal_proj,perc99-center/_diagonal_proj,perc99-center/med_diagonal_proj,perc99-center/stdthunder_diagonal_proj,perc99.9-center/_diagonal_proj,perc99.9-center/med_diagonal_proj,perc99.9-center/stdthunder_diagonal_proj,perc99-m/_diagonal_proj,perc99-m/med_diagonal_proj,perc99-m/stdthunder_diagonal_proj,perc99.9-m/_diagonal_proj,perc99.9-m/med_diagonal_proj,perc99.9-m/stdthunder_diagonal_proj,max(diag1Hz)/med_diagonal_proj_eodf,max(diag5Hz)/med_diagonal_proj_eodf,max(diag50Hz)/med_diagonal_proj_eodf,pi_integral,pi_single_freqs,coherence_diff,contrast_single_freqs,contrast_integral,ratio_integral,ratio_single_freqs,coherence_diff_direct,contrast_single_freqs_direct,contrast_integral_direct,ratio_integral_direct,ratio_single_freqs_direct,coherence_diff_first,contrast_single_freqs_first,contrast_integral_first,ratio_integral_first,ratio_single_freqs_first,coherence_diff_direct_first,contrast_single_freqs_direct_first,contrast_integral_direct_first,ratio_integral_direct_first,ratio_single_freqs_direct_first +0,2012-07-03-ak-invivo-1, P-unit,0.0105005183677266,62.75536849180772,0.013657851936776,52.47526521779722,0.0029710185626039,127044159.23076925,2.5,%,2.0,919.81355,1004.51225,0.2999999999999999,FileStimulus_1,gwn300Hz10s0,0,54.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,26.0,2.0,1.7421633005142212,20.163790872752998,41.637051258670354,20.163790872752998,41.637051258670354,0.2235143324104716,119.11077428318808,-0.2890705610757366,,25.0,0.2647858498922106,-0.3683418512516709,118.96153846153854,-0.0028479957175606,-0.5126392291609113,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,2.5,0.0020093648924548,0.0019975369787648,0.0070832553822952,0.0070055003594508,0.0020093648924548,0.0019975369787648,233.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,12.951849679631774,0.8706940143517728,0.2966403086781904,0.2966403086781904,15529.851342459877,9.993670720515138e-06,179.28895225983945,179.28895225983948,59.78043047174431,59.78043047174431,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.2421420949119135,4.2863978944717465,4.2863978944717465,44949111.24335834,20093948.02655765,4939282.297285148,12723591.19780654,7485239.54515319,9239490.219418664,20218730.71941402,44949111.24335834,2.239293982211908,14.088955387393607,79075952.1064604,79075952.1064604,3.94930206248526,22.90017904993841,24855163.21680071,1.2392939822119082,7.55263439485584,58982004.07990277,2.9493020624852595,16.363858057400652,24730380.52394433,1.2331186477255576,7.503448111484626,58857221.38704639,2.9431267279989104,16.31467177402944,44949110.24335834,1.2392939822119082,13.088955387393607,79075951.1064604,2.9493020624852595,21.90017904993841,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0233344852616147,91.25839845073337,0.0303507820817244,80.39157049383412,0.0132045269449066,144756660.13793105,5.0,%,2.0,1007.7343,1097.4033999999997,0.3,FileStimulus_2,gwn300Hz10s0,0,60.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,29.0,2.0,1.7424869537353516,36.58462628672508,41.909116646780696,36.58462628672508,41.909116646780696,0.2235143324104716,119.11077428318808,-0.2890705610757366,,54.0,0.3570325754713218,-0.3937811619376437,121.75862068965525,-0.0030380066024297,-0.5438031818349319,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,5.0,0.0161287985835657,0.0158116118184801,0.0375534173267327,0.0361296467452,0.0161287985835657,0.0158116118184801,245.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,13.912222251315562,0.9117097699830266,0.3739081548846319,0.373908154884632,9115.830260007724,5.651960267580706e-05,243.7202927379549,243.7202927379549,62.74350470859873,62.74350470859873,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.4085182015853348,3.620625531450442,3.620625531450442,10521689.946123376,5201345.300157793,1312319.6912854249,3380535.524751253,1814667.638661426,2087310.312124444,5249432.0036779605,10521689.946123376,2.024296133802481,8.604935620835496,17316674.15946555,17316674.15946555,3.3342219006499016,14.147200071833632,5320344.6459655855,1.0242961338024812,4.3825271397378085,12115328.859307762,2.3342219006499016,9.924791590735936,5272257.94244542,1.015188911301909,4.345765619908836,12067242.155787593,2.3251146781493293,9.888030070906964,10521688.946123376,1.0242961338024812,7.604935620835497,17316673.15946555,2.3342219006499016,13.147200071833632,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0451133381724551,136.90457517318734,0.0586781786913339,143.2140274410827,0.0510575041869723,156110973.7142857,10.0,%,2.0,1101.7972000000009,1191.4643499999988,0.2999999999999999,FileStimulus_3,gwn300Hz10s0,0,58.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,28.0,2.0,1.760293960571289,57.67441608634364,41.89688370790317,57.67441608634364,41.89688370790317,0.2235143324104716,119.11077428318808,-0.2890705610757366,,82.0,0.5098917185735471,-0.4114683813130072,135.8035714285715,-0.0034366157733794,-0.7354357755031983,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,10.0,0.0726964975229262,0.0676057074702495,0.132779897557143,0.1168766696913678,0.0726964975229262,0.0676057074702495,267.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,14.119164274230943,0.9461002671202732,0.4632297318133661,0.4632297318133661,5541.073006127838,0.0003430084045805,328.5882646922607,328.5882646922607,70.7035322575708,70.7035322575708,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.3089550558650809,2.2603456670329822,2.368814625915653,2663258.8180235587,1360545.885421276,355741.537270964,916390.2000100032,461809.94189763727,484570.7400054328,1348599.9085419371,2663258.8180235587,1.9594381224101929,8.674383905565088,3693557.141970156,3693557.141970156,2.7189441579968965,11.860432660663893,1302712.9326022826,0.9594381224101924,4.2862203618347925,2333011.25654888,1.7189441579968965,7.472269116933598,1314658.9094816218,0.9678606901189308,4.353975476777155,2344957.233428219,1.7273667257056349,7.540024231875961,2663257.8180235587,0.9594381224101924,7.674383905565086,3693556.141970156,1.7189441579968965,10.860432660663893,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0105005183677266,62.75536849180772,0.013657851936776,52.47526521779722,0.0029710185626039,127044159.23076925,2.5,%,2.0,919.81355,1004.51225,0.2999999999999999,FileStimulus_1,gwn300Hz10s0,0,54.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,26.0,2.0,1.7421633005142212,20.163790872752998,41.637051258670354,20.163790872752998,41.637051258670354,0.2235143324104716,119.11077428318808,-0.2890705610757366,,25.0,0.2647858498922106,-0.3683418512516709,118.96153846153854,-0.0028479957175606,-0.5126392291609113,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,2.5,0.0020093648924548,0.0019975369787648,0.0070832553822952,0.0070055003594508,0.0020093648924548,0.0019975369787648,233.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,12.951849679631774,0.8706940143517728,0.2966403086781904,0.2966403086781904,15529.851342459877,9.993670720515138e-06,179.28895225983945,179.28895225983948,59.78043047174431,59.78043047174431,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.2421420949119135,4.2863978944717465,4.2863978944717465,44949111.24335834,20093948.02655765,4939282.297285148,12723591.19780654,7485239.54515319,9239490.219418664,20218730.71941402,44949111.24335834,2.239293982211908,14.088955387393607,79075952.1064604,79075952.1064604,3.94930206248526,22.90017904993841,24855163.21680071,1.2392939822119082,7.55263439485584,58982004.07990277,2.9493020624852595,16.363858057400652,24730380.52394433,1.2331186477255576,7.503448111484626,58857221.38704639,2.9431267279989104,16.31467177402944,44949110.24335834,1.2392939822119082,13.088955387393607,79075951.1064604,2.9493020624852595,21.90017904993841,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0233344852616147,91.25839845073337,0.0303507820817244,80.39157049383412,0.0132045269449066,144756660.13793105,5.0,%,2.0,1007.7343,1097.4033999999997,0.3,FileStimulus_2,gwn300Hz10s0,0,60.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,29.0,2.0,1.7424869537353516,36.58462628672508,41.909116646780696,36.58462628672508,41.909116646780696,0.2235143324104716,119.11077428318808,-0.2890705610757366,,54.0,0.3570325754713218,-0.3937811619376437,121.75862068965525,-0.0030380066024297,-0.5438031818349319,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,5.0,0.0161287985835657,0.0158116118184801,0.0375534173267327,0.0361296467452,0.0161287985835657,0.0158116118184801,245.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,13.912222251315562,0.9117097699830266,0.3739081548846319,0.373908154884632,9115.830260007724,5.651960267580706e-05,243.7202927379549,243.7202927379549,62.74350470859873,62.74350470859873,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.4085182015853348,3.620625531450442,3.620625531450442,10521689.946123376,5201345.300157793,1312319.6912854249,3380535.524751253,1814667.638661426,2087310.312124444,5249432.0036779605,10521689.946123376,2.024296133802481,8.604935620835496,17316674.15946555,17316674.15946555,3.3342219006499016,14.147200071833632,5320344.6459655855,1.0242961338024812,4.3825271397378085,12115328.859307762,2.3342219006499016,9.924791590735936,5272257.94244542,1.015188911301909,4.345765619908836,12067242.155787593,2.3251146781493293,9.888030070906964,10521688.946123376,1.0242961338024812,7.604935620835497,17316673.15946555,2.3342219006499016,13.147200071833632,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0451133381724551,136.90457517318734,0.0586781786913339,143.2140274410827,0.0510575041869723,156110973.7142857,10.0,%,2.0,1101.7972000000009,1191.4643499999988,0.2999999999999999,FileStimulus_3,gwn300Hz10s0,0,58.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,28.0,2.0,1.760293960571289,57.67441608634364,41.89688370790317,57.67441608634364,41.89688370790317,0.2235143324104716,119.11077428318808,-0.2890705610757366,,82.0,0.5098917185735471,-0.4114683813130072,135.8035714285715,-0.0034366157733794,-0.7354357755031983,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,10.0,0.0726964975229262,0.0676057074702495,0.132779897557143,0.1168766696913678,0.0726964975229262,0.0676057074702495,267.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,14.119164274230943,0.9461002671202732,0.4632297318133661,0.4632297318133661,5541.073006127838,0.0003430084045805,328.5882646922607,328.5882646922607,70.7035322575708,70.7035322575708,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.3089550558650809,2.2603456670329822,2.368814625915653,2663258.8180235587,1360545.885421276,355741.537270964,916390.2000100032,461809.94189763727,484570.7400054328,1348599.9085419371,2663258.8180235587,1.9594381224101929,8.674383905565088,3693557.141970156,3693557.141970156,2.7189441579968965,11.860432660663893,1302712.9326022826,0.9594381224101924,4.2862203618347925,2333011.25654888,1.7189441579968965,7.472269116933598,1314658.9094816218,0.9678606901189308,4.353975476777155,2344957.233428219,1.7273667257056349,7.540024231875961,2663257.8180235587,0.9594381224101924,7.674383905565086,3693556.141970156,1.7189441579968965,10.860432660663893,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0105005183677266,62.75536849180772,0.013657851936776,52.47526521779722,0.0029710185626039,127044159.23076925,2.5,%,2.0,919.81355,1004.51225,0.2999999999999999,FileStimulus_1,gwn300Hz10s0,0,54.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,26.0,2.0,1.7421633005142212,20.163790872752998,41.637051258670354,20.163790872752998,41.637051258670354,0.2235143324104716,119.11077428318808,-0.2890705610757366,,25.0,0.2647858498922106,-0.3683418512516709,118.96153846153854,-0.0028479957175606,-0.5126392291609113,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,2.5,0.0020093648924548,0.0019975369787648,0.0070832553822952,0.0070055003594508,0.0020093648924548,0.0019975369787648,233.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,12.951849679631774,0.8706940143517728,0.2966403086781904,0.2966403086781904,15529.851342459877,9.993670720515138e-06,179.28895225983945,179.28895225983948,59.78043047174431,59.78043047174431,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.671998229555124,2.347349355532392,2.4884015175860794,1.2421420949119135,4.2863978944717465,4.2863978944717465,44949111.24335834,20093948.02655765,4939282.297285148,12723591.19780654,7485239.54515319,9239490.219418664,20218730.71941402,44949111.24335834,2.239293982211908,14.088955387393607,79075952.1064604,79075952.1064604,3.94930206248526,22.90017904993841,24855163.21680071,1.2392939822119082,7.55263439485584,58982004.07990277,2.9493020624852595,16.363858057400652,24730380.52394433,1.2331186477255576,7.503448111484626,58857221.38704639,2.9431267279989104,16.31467177402944,44949110.24335834,1.2392939822119082,13.088955387393607,79075951.1064604,2.9493020624852595,21.90017904993841,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0233344852616147,91.25839845073337,0.0303507820817244,80.39157049383412,0.0132045269449066,144756660.13793105,5.0,%,2.0,1007.7343,1097.4033999999997,0.3,FileStimulus_2,gwn300Hz10s0,0,60.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,29.0,2.0,1.7424869537353516,36.58462628672508,41.909116646780696,36.58462628672508,41.909116646780696,0.2235143324104716,119.11077428318808,-0.2890705610757366,,54.0,0.3570325754713218,-0.3937811619376437,121.75862068965525,-0.0030380066024297,-0.5438031818349319,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,5.0,0.0161287985835657,0.0158116118184801,0.0375534173267327,0.0361296467452,0.0161287985835657,0.0158116118184801,245.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,13.912222251315562,0.9117097699830266,0.3739081548846319,0.373908154884632,9115.830260007724,5.651960267580706e-05,243.7202927379549,243.7202927379549,62.74350470859873,62.74350470859873,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.2781015973333,1.7162150911236176,1.8952409564185089,1.4085182015853348,3.620625531450442,3.620625531450442,10521689.946123376,5201345.300157793,1312319.6912854249,3380535.524751253,1814667.638661426,2087310.312124444,5249432.0036779605,10521689.946123376,2.024296133802481,8.604935620835496,17316674.15946555,17316674.15946555,3.3342219006499016,14.147200071833632,5320344.6459655855,1.0242961338024812,4.3825271397378085,12115328.859307762,2.3342219006499016,9.924791590735936,5272257.94244542,1.015188911301909,4.345765619908836,12067242.155787593,2.3251146781493293,9.888030070906964,10521688.946123376,1.0242961338024812,7.604935620835497,17316673.15946555,2.3342219006499016,13.147200071833632,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0451133381724551,136.90457517318734,0.0586781786913339,143.2140274410827,0.0510575041869723,156110973.7142857,10.0,%,2.0,1101.7972000000009,1191.4643499999988,0.2999999999999999,FileStimulus_3,gwn300Hz10s0,0,58.0,4.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,28.0,2.0,1.760293960571289,57.67441608634364,41.89688370790317,57.67441608634364,41.89688370790317,0.2235143324104716,119.11077428318808,-0.2890705610757366,,82.0,0.5098917185735471,-0.4114683813130072,135.8035714285715,-0.0034366157733794,-0.7354357755031983,, Nerve,20000.0, Apteronotus leptorhynchus,931.2075660342268,10.0,0.0726964975229262,0.0676057074702495,0.132779897557143,0.1168766696913678,0.0726964975229262,0.0676057074702495,267.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3short,gwn300Hz10s0.3short,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,14.119164274230943,0.9461002671202732,0.4632297318133661,0.4632297318133661,5541.073006127838,0.0003430084045805,328.5882646922607,328.5882646922607,70.7035322575708,70.7035322575708,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.005118144675292,1.3083405847354732,1.7348659037326364,1.3089550558650809,2.2603456670329822,2.368814625915653,2663258.8180235587,1360545.885421276,355741.537270964,916390.2000100032,461809.94189763727,484570.7400054328,1348599.9085419371,2663258.8180235587,1.9594381224101929,8.674383905565088,3693557.141970156,3693557.141970156,2.7189441579968965,11.860432660663893,1302712.9326022826,0.9594381224101924,4.2862203618347925,2333011.25654888,1.7189441579968965,7.472269116933598,1314658.9094816218,0.9678606901189308,4.353975476777155,2344957.233428219,1.7273667257056349,7.540024231875961,2663257.8180235587,0.9594381224101924,7.674383905565086,3693556.141970156,1.7189441579968965,10.860432660663893,,,,,,,,,,,,,,,,,,,,,,,,, +0,2012-07-03-ak-invivo-1, P-unit,0.0019683141043325,11.004959642658568,0.0022327938062947,9.636189136424576,0.000599937495258,28058712.0,2.5,%,2.0,1192.9469,1202.9469,0.3,FileStimulus_4,gwn300Hz10s0,0,11.0,11.0,0.2235143324104716,119.11077428318808,-0.0035674123523059,original,code,loop,1.0,10.0,1.737144947052002,71.2354834365232,0.0,71.2354834365232,0.0,0.2235143324104716,119.11077428318808,-0.2890705610757365,,83.0,0.2379683604878458,-0.395924864186961,74.2,0.0002751173585156,0.189830977375806,, Nerve,20000.0, Apteronotus leptorhynchus,931.207566034226,2.5,0.0,0.0,0.005427408412483,0.0053981106612685,0.0,0.0,741.0, P-unit,0.5sec,0.5,gwn300Hz10s0.3,gwn300Hz10s0.3,, P-unit,0.0,0.0,-13.2707739505783,0.2235143324104716,119.11077428318808,-0.2890705610757365,-0.0035674123523059,0.0,0.0,1.5,0.2235143324104716,0.2232566559426869,119.07919666540356,0.2235143324104716,119.11077428318808,0.217,14.033831293845902,0.5395619514802179,0.1380549103015235,0.1380549103015234,9589.858941832284,3.2737625971979494e-05,69.04490925975156,69.04490925975153,64.9461186420363,64.9461186420363,1.0084593486387303,1.4694893076298223,3.359975494240252,1.0084593486387303,1.4694893076298223,3.359975494240252,1.0084593486387303,1.4694893076298223,3.359975494240252,1.5106201615580326,3.89478303341889,3.89478303341889,30293438.09783977,11587810.078113245,1607732.7483019372,4141519.559625792,2804196.1052186675,4870795.086146097,12012711.471695982,30293438.09783977,2.6142504833641724,18.842334417729088,43291423.37358956,43291423.37358956,3.735945194282851,26.927002276537127,18705628.01972653,1.6142504833641722,11.634786962872484,31703613.29547632,2.735945194282851,19.719454821680525,18280726.62614379,1.5775825201581406,11.370500877992075,31278711.90189358,2.6992772310768194,19.45516873680011,30293437.09783977,1.6142504833641722,17.842334417729088,43291422.37358956,2.735945194282851,25.927002276537127,,,,,,,,,,,,,,,,,,,,,,,,, +0,2018-05-08-ae-invivo-1, P-unit,0.0220774958565704,153.5320481643063,0.0214373477721726,74.18404097083116,0.0132526239763741,883073832.0,0.05,,2.0,574.1859599999998,607.6914300000002,0.3,FileStimulus_0,FileStimulus-file-gaussian noise-white noise psd(f) ~ 1 f 1) & (len(np.unique(frame.RAM_noise)) > 1): grid_lowpass2 = gridspec.GridSpecFromSubplotSpec(4, 1, @@ -307,7 +308,7 @@ def model_and_data2(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1 ax_n, ff, pp, ff_am, pp_am = plot_lowpass2([grid_lowpass[2]], time, noise_final_c, deltat, eod_fr, extract=False, color1='grey', lw=1) remove_yticks(ax_n) - if g == 2: + if g == 1: ax_n.set_xlabel('Time [ms]', labelpad = -0.5) else: remove_xticks(ax_n) @@ -330,25 +331,26 @@ def model_and_data2(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1 ax_external.text(1, 1, 'RAM', ha='right', color='red', transform=ax_external.transAxes) ax_intrinsic.text(start_pos_modeldata(), 1, signal_component_name(), ha='right', color='purple', transform=ax_intrinsic.transAxes) - + #embed() set_same_ylim(ax_ams, up='up') # embed() axes = np.concatenate([ax_data, ax_model]) - axes = [ax_ams[0], axes[0], axes[1], axes[2], ax_ams[1], axes[3], axes[4], ax_ams[2], axes[5], - axes[6], ] - axd1 = plt.subplot(grid[1, 1]) - axd2 = plt.subplot(grid[2, 1]) + axes = [ax_ams[0], axes[1], axes[2], ax_ams[1], axes[3], axes[4], ]#ax_ams[2], axes[5], axes[6], + #axd1 = plt.subplot(grid[1, 1]) + #axd2 = plt.subplot(grid[2, 1]) #ax_data.extend([,]) - axd1.show_spines('') - axd2.show_spines('') + #axd1.show_spines('') + #axd2.show_spines('') #embed() #axes = [[ax_ams[0],ax_data[0],axes[2], axes[3]],[ax_ams[1],axd1,axes[4], axes[5]],[axd2,axd2, axes[6], axes[7]]] - fig.tag([axes[0:4]], xoffs=-3, yoffs=1.6) # ax_ams[3], - fig.tag([[axes[4]]], xoffs=-3, yoffs=1.6, minor_index=0) # ax_ams[3], - fig.tag([axes[5:7]], xoffs=-3, yoffs=1.6, major_index = 1, minor_index = 2) # ax_ams[3], - fig.tag([[axes[7]]], xoffs=-3, yoffs=1.6, major_index=2,minor_index=0) # ax_ams[3], - fig.tag([axes[8::]], xoffs=-3, yoffs=1.6, major_index=2, minor_index=2) # ax_ams[3], + + fig.tag([ax_data], xoffs=-3, yoffs=1.6) # ax_ams[3], + fig.tag([axes[0:3]], xoffs=-3, yoffs=1.6) # ax_ams[3], + #fig.tag([[axes[4]]], xoffs=-3, yoffs=1.6, minor_index=0) # ax_ams[3], + fig.tag([axes[3:6]], xoffs=-3, yoffs=1.6) #, major_index = 1, minor_index = 2 ax_ams[3], + #fig.tag([[axes[7]]], xoffs=-3, yoffs=1.6, major_index=2,minor_index=0) # ax_ams[3], + #fig.tag([axes[8::]], xoffs=-3, yoffs=1.6, major_index=2, minor_index=2) # ax_ams[3], #fig.tag([axes[7::]], xoffs=-3, yoffs=1.6) # ax_ams[3], #fig.tag([ax_ams[0],ax_data[0],axes[2], axes[3]], xoffs=-3, yoffs=1.6)#ax_ams[3], diff --git a/susceptibility1.tex.bak b/susceptibility1.tex.bak index 0f1f488..cb03b84 100644 --- a/susceptibility1.tex.bak +++ b/susceptibility1.tex.bak @@ -623,8 +623,9 @@ The nonlinearity in this work were found in low-CV P-units. For this nonlinear e %\subsubsection{A heterogeneous readout is required to cover all female-intruder combinations} -A heterogeneous readout might be not only physiologically plausible but also required since nonlinear effects depending on cell property \fbase{} and not on stimulus properties might be not behaviorally relevant. Nonlinear effects might facilitate the encoding of faint signals during a three fish setting, the electrosensory cocktail party. The EOD frequencies of the encoutered three fish would be drawn from the EOD frequency distribution of these fish and a stable faint signal detection would require a response irrespective of the individual EOD frequencies. In this work, nonlinear effects were always found only for specific frequencies in relation to \fbase{}, corresponding to findings from previous literature \citealp{Voronenko2017}. Weather integrating from a heterogeneous population with different \fbasesolid{} (50--450\,Hz, \citealp{Grewe2017, Hladnik2023}) would cover the behaviorally relevant range in the electrosensory cocktail party should be addressed in further studies. +A heterogeneous readout might be not only physiologically plausible but also required since nonlinear effects depending on cell property \fbase{} and not on stimulus properties might be not behaviorally relevant. Nonlinear effects might facilitate the encoding of faint signals during a three fish setting, the electrosensory cocktail party. The EOD frequencies of the encoutered three fish would be drawn from the EOD frequency distribution of these fish and a stable faint signal detection would require a response irrespective of the individual EOD frequencies. Weather integrating from a heterogeneous population with different \fbasesolid{} (50--450\,Hz, \citealp{Grewe2017, Hladnik2023}) would cover the behaviorally relevant range in the electrosensory cocktail party should be addressed in further studies. +%In this work, nonlinear effects were always found only for specific frequencies in relation to \fbase{}, corresponding to findings from previous literature \citealp{Voronenko2017}. %Only a heterogeneous population could cover the whole stimulus space required during the electrosensory cocktail party. %If pyramidal cells would integrate only from P-units with the same mean baseline firing rate \fbasesolid{} not all fish encounters, relevant for the context of the electrosensory cocktail party, could be covered. @@ -642,7 +643,9 @@ A heterogeneous readout might be not only physiologically plausible but also req %These low-frequency modulations of the amplitude modulation are \subsection{Encoding of secondary envelopes}%($\n{}=49$) Whether this population of envelope encoders was in addition bursty was not addressed in the corresponding study -The RAM stimulus used in this work is an approximation of the three-fish scenario, where the two generated beats are often slowly modulated at the difference between the two beat frequencies \bdiff{}, known as secondary or social envelope \citealp{Stamper2012Envelope}. In previous works it was demonstrated that low-frequency secondary envelopes are extracted not in P-units but downstream of them in the ELL \citealp{Middleton2006} utilizing threshold nonlinear response curves of the involved neuron \citealp{Middleton2007}. Based on our work we would predict that only a small class of cells, with very low CVs, should encode the social envolope at the difference frequency. The sample in that previous work \citealp{Middleton2007} was limited, and if it did not contain cells as low CVs as mentioned here, this might be in line with the findings that P-units were determined as no envelope encoders. +The RAM stimulus used in this work is an approximation of the three-fish scenario, where the two generated beats are often slowly modulated at the difference between the two beat frequencies \bdiff{}, known as secondary or social envelope \citealp{Stamper2012Envelope}. + +In previous works it was demonstrated that low-frequency secondary envelopes are extracted not in P-units but downstream of them in the ELL \citealp{Middleton2006} utilizing threshold nonlinear response curves of the involved neuron \citealp{Middleton2007}. Based on our work we would predict that only a small class of cells, with very low CVs, should encode the social envelope at the difference frequency. If the sample in that previous work \citealp{Middleton2007} did not contain low CVs cells, This could explain the conclusion that P-units were identified not as envelope encoders. On the other hand in previous literature the encoding of social envelopes was attributed to a subpopulation of P-units with strong nonlinearities, low firing rates and high CVs \citealp{Savard2011}. These findings are in contrast to the findings in the previously mentioned work \citealp{Middleton2007} and on first glance also to our findings. The missing link, that has not been considered in this work, might be bursting of P-units, the repeated firing of spikes after one EOD period interleaved with quiescence (unpublished work). Bursting was not explicitly addressed in the work \citealp{Savard2011}, still the high CVs of the envelope encoding P-units indicate a higher rate of bursting. How bursts influence the second-order susceptibility of P-units will be addressed in following works (in preparation). diff --git a/utils_all_down.py b/utils_all_down.py index 7b1ca01..a5f972c 100644 --- a/utils_all_down.py +++ b/utils_all_down.py @@ -1678,7 +1678,6 @@ def do_withenoise_stimulus(deltat, eod_fr, stimulus_length, a_fe=0.2): stimulus_here[stimulus_here < 0] = 0 return stimulus_here - def model_sheme_split(grid_sheme_orig, time_transform=1000, ws=0.1, nfft=4096 * 6, stimulus_length=5, fft_type='mppsd', a_fr=1, a_fe=0.2, v_exp=1, exp_tau=0.1, counter=0, counterp=0, color='darkgrey', log=True, @@ -1727,6 +1726,411 @@ def model_sheme_split(grid_sheme_orig, time_transform=1000, ws=0.1, nfft=4096 * # ult_settings(column=2, length=5) # # fdefaig = plt.figure() + # for mult_nr in range(len(eod_fe)): + c_sigs = [1, 1, 1, 0.9] + c_sigs = [0, 0, 0, 0.9] + var_types = ['', '', '', 'additiv_cv_adapt_factor_scaled'] # ''#'additiv_cv_adapt_factor_scaled' + # 'additiv_visual_d_4_scaled', ''] + # a_fes = + nrs = [1, 2, 3, 4] + a_fes = [0, 0.02, 0.1, 0]#alpha\alpha + titles = ['Baseline', r'Contrast$\,=2\,\%$', r'Contrast$\,=20\,\%$', noise_name()] + + ######################################################################################### + # first row for the stimulus, and then three cols for the sheme, and the power 1 and power 3 + grid0 = gridspec.GridSpecFromSubplotSpec(1, len(a_fes) + 1, subplot_spec=grid_sheme_orig, + width_ratios=[1.5, 2, 2, 2, 2], wspace=0.45) + + ##################################################### + # Grid for the sheme + try: + grid_sheme = gridspec.GridSpecFromSubplotSpec(6, 1, + subplot_spec=grid0[0], wspace=0.2, hspace=0.9, + height_ratios=[1, 1, 1, 1, 0, 1]) # 0.95 + except: + print('grid thing1') + embed() + + axshemes = [] + axsheme = plt.subplot(grid_sheme[0]) + axshemes.append(axsheme) + plot_sheme_nonlinearity(axsheme, color_p3, color_p1, color_diagonal=color_diagonal) + axsheme = plt.subplot(grid_sheme[1]) + axshemes.append(axsheme) + # axsheme.set_aspect('equal') + plot_sheme_lowpass(axsheme) + + axsheme = plt.subplot(grid_sheme[2]) + axshemes.append(axsheme) + plot_sheme_noise(axsheme) + + axsheme = plt.subplot(grid_sheme[3]) + axshemes.append(axsheme) + # axsheme.set_aspect('equal') + plot_sheme_IF(axsheme, exp_tau, v_exp) + + ################################################################################### + + lw = 0.5 + + xlim = 0.065 + axps = [] + axps_lowpass = [] + axps_stimulus = [] + pps = [] + pps_lowpass = [] + pps_stimulus = [] + ax_am_sp_s = [] + ax_ams = [] + ax_noise = [] + colors_chosen = [] + counter_g = 0 + mult_nr = 0 + + # A grid for a single POWER column + + axt_stims = [] + + for c, c_sig in enumerate(c_sigs): + + a_fe = a_fes[c] + + ###################################### + # colors = ['grey', 'grey', 'grey', 'grey'] + # embed() + grid_power_col = gridspec.GridSpecFromSubplotSpec(6, 1, + subplot_spec=grid0[nrs[counter_here]], wspace=0.45, + hspace=0.5, height_ratios=[1, 1, 1, 1, 0, 1]) + + noise_final_c, spike_times, stimulus, stimulus_here, time, v_dent_output, v_mem_output,frame = get_flowchart_params( + a_fes, a_fr, c, c_sig, cell, deltat, eod_fr, model_params, stimulus_length, v_offset, var_types, eod_fe, + color_p1, color_p3, mult_nr=mult_nr, load_name=load_name, exp_tau=exp_tau, v_exp=v_exp) + print(len(stimulus_here)) + ############################################## + # titles = [titles[1]] + # for g, stimulus_here in enumerate([stimuli[1]]): + add = 0 + color = colors[counter_here] + + # FIRST Row: Rectified stimulus + + plot_point = [[], [], [], 'yes'] + # counter, ax_rec[counter_here], ff, pp, axp = plot_rec_stimulus(eod_fr,grid_lowpass, time_transform, stimulus_here, color, color, + # time, counter, eod_fr, titles, g, deltat, + # fft_type, nfft, log, counterp,shift = shift, delta_f = delta_f, plot_point = plot_point[counter_here], lw = lw, xlim = xlim) + power_extra = False + wr2 = [1, 1.2] + if power_extra: + wr = [1, 1.2] + + col = 2 + else: + col = 1 + wr = [1] + + #################################################################### + # stimulus + grid_lowpass = gridspec.GridSpecFromSubplotSpec(1, col, + subplot_spec=grid_power_col[0], wspace=ws, hspace=1.3, + width_ratios=wr) + ax_rec[counter_here], ff, pp, ff_am, pp_am = plot_lowpass2(grid_lowpass, time, stimulus_here, deltat, eod_fr, + shift, nfft, time_transform, color, fft_type, lw=lw, + xlim=xlim) + + # ax_rec[counter.] + ax_rec[counter_here].show_spines('b') + remove_xticks(ax_rec[counter_here]) + axt_stims.append(ax_rec[counter_here]) + + pps_stimulus.append(pp_am) + + if power_extra: + axp_p2 = plt.subplot(grid_lowpass[1]) + axp_p2.set_xticks_blank() + axps_stimulus.append(axp) + colors_chosen.append(color) + + # if counter_here == 0: + # ax_rec[counter_here].text(-7, 0, '0', color='black', ha='center', va='center') + + # if colorful_title: + # rainbow_title(fig, ax_rec[counter_here], titles[g], add_pos[g], color_add_pos[g]) + # else:#add_pos[g] + #embed() + ax_rec[counter_here].text(0, 0.935, titles[c] + '\n'+r'$\rm{CV}=%s$' %( + np.round(np.std(np.diff(spike_times)) / np.mean(np.diff(spike_times)), 2)) + '\n$f_{Base}=%s$' %( + int(np.round(1 / np.mean(np.diff(spike_times))))) + '\,Hz', transform=ax_rec[counter_here].transAxes, + va='bottom') # verticalalignment='right', + # And plot correspoding sheme + # if g == 0: + + # REMAINING Rows: dendridic filter / LIF /EIF stimulus + + # for ee, exponential in enumerate(exponentials): + + # model + # v_offset, model_params, load_name= implement_three_core(cell,amp_frame, titles, g, cell_nr = cell_nr) + # for hard coding the offset here i check the change of the baseline + + # if (ee == 0): + # SECOND Row: Dendridic Low pass filter + plot_point = [[], [], [], 'yes'] + # ax_low[counter_here] + grid_lowpass = gridspec.GridSpecFromSubplotSpec(1, col, + subplot_spec=grid_power_col[1], wspace=ws, hspace=1.3, + width_ratios=wr) + axt2, ff, pp, ff_am, pp_am = plot_lowpass2(grid_lowpass, time, v_dent_output, deltat, eod_fr, shift, nfft, + time_transform, color, fft_type, lw=lw, xlim=xlim) + axt2.show_spines('b') + remove_xticks(axt2) + axt_stims.append(axt2) + + pps_stimulus.append(pp_am) + if power_extra: + axp_p2 = plt.subplot(grid_lowpass[1]) + axp_p2.set_xticks_blank() + axps_stimulus.append(axp_p2) + colors_chosen.append(color) + + # if counter_here == 0: + # ax_low[counter_here].text(-7, 0, '0', color='black', ha='center', va='center') + + #################################################################### + # spikes + + # embed() + grid_lowpass = gridspec.GridSpecFromSubplotSpec(1, 1, + subplot_spec=grid_power_col[-3], wspace=ws, hspace=1.3, + ) # width_ratios=wr2 + + # add = adds[g][2+ee] + plot_point = ['yes', 'yes', [], 'yes'] + # embed() + axt_spikes, axp_IF, ff, pp, axp_s, pp_s = plot_spikes(grid_lowpass, time_transform, v_mem_output, time, color, + spike_times, shift, deltat, fft_type, nfft, eod_fr, + xlim=xlim, + counter_here=counter_here, psd=False) # , add = add + + grid_lowpass_p = gridspec.GridSpecFromSubplotSpec(1, 1, + subplot_spec=grid_power_col[-1], wspace=ws, hspace=1.3, + ) # width_ratios=wr2 + axp_s = plt.subplot(grid_lowpass_p[0]) + + in_omega = False + if in_omega: + axp_s.set_xlabel('$\omega/\omega_1$') + else: + + arrow = True + name = r'$f/f_{EOD}$'#r'$\frac{f}{f_{EOD}}$' + if arrow: + set_xlabel_arrow_core(axp_s, name ) + #axp_s.text(1.05, -0.25, name, ha='center', va='center', + # transform=axp_s.transAxes) + axp_s.arrow_spines('b') + else: + axp_s.set_xlabel(name) + + + # pps.append(pp) + # axps.append(axp_IF) + axps.append(axp_s) + pps.append(pp_s) + # colors_chosen.append(color) + colors_chosen.append('black') + # if ee == 0: + + axt_spikes.show_spines('b') + axt_IF1.append(axt_spikes) + # axt_stims,axt_IF1 + # else: + # axt_IF2.append(axt_IF) + # if g == 0: + + ################################ + # plot noise split + noise = np.random.randn(len(stimulus)) + # noise *= noise_strength / np.sqrt(deltat) + noise_strength = model_params["noise_strength"] # .iloc[0] + # if 'd_right' in load_name: + noise_length = len(stimulus) + + # noise_final = np.random.randn(noise_length) # len(stimulus) + # noise_strength_new = np.sqrt(noise_strength * 2) + # noise_final *= noise_strength_new / np.sqrt(deltat) # 0.05370289258320868 0.0015532069917408744 + + no_noise = False + if no_noise: + c_noise = c_sig + noise_final_c = np.random.randn(noise_length) # len(stimulus) + variance = (noise_strength * c_noise) * 2 / deltat + noise_strength_new = np.sqrt(variance) + noise_final_c *= noise_strength_new # 0.0015532069917408744 + grid_lowpass = gridspec.GridSpecFromSubplotSpec(1, col, width_ratios=wr, + subplot_spec=grid_power_col[2], wspace=ws, + hspace=1.45) + + ax_n, ff, pp, ff_am, pp_am = plot_lowpass2(grid_lowpass, time, noise_final_c, deltat, eod_fr, shift, nfft, + time_transform, color, fft_type, extract=False, lw=lw, xlim=xlim) + ax_n.show_spines('b') + ax_noise.append(ax_n) + remove_xticks(ax_n) + pps_lowpass.append(pp) + if power_extra: + axp_p2 = plt.subplot(grid_lowpass[1]) + axp_p2.set_xticks_blank() + axps_lowpass.append(axp_p2) + # pps_stimulus.append(pp) + # axps_stimulus.append(axp_p2) + # axps.append(axp_p2) + # pps.append(pp) + + counter_g += 1 + # embed() + # plt.show() + counter_here += 1 + + # embed() + + + # embed() + devide = np.max(np.max(pps)) + # plot_points = np.array([[], [], [], 'yes', + # [], [], [], 'yes' + # ,'yes','yes',[],'yes' + # ,'yes','yes',[],'yes']) + # von oben nach unten von links nach rechts + + # plot psd with shared log lim + + #################################### + # cut first parts + # because otherwise there is a dip at the beginning and thats a problem for the range thing + ff, pps_stimulus, pps_lowpass, pps = cut_first_parts(ff, pps_stimulus, pps_lowpass, pps, ll=0) + + # here I calculate the log and do the same range for all power spectra + # this is kind of complicated but some cells spike even withouth thresholding and we want to keep their noise floor down + # not to see the peaks in the noise + # pp3_stimulus = create_same_max(np.concatenate([pps_stimulus, pps_lowpass]), same=True) + + if power_extra: + pp3_stimulus = create_same_max(pps_stimulus, same=True) + pp3_noise = create_same_max(pps_lowpass, same=True) + pps3 = create_same_max(pps, same=True) + + # pp3_stimulus = np.concatenate(pp3_stimulus) + # axps_stimulus = np.concatenate([axps_stimulus,axps_lowpass]) + # pp3_stimulus = create_same_range_ps(axps, pps_stimulus) + + pp3 = create_same_range(np.concatenate([pp3_stimulus, pp3_noise, pps3])) + axps_stimulus = np.concatenate([axps_stimulus, axps_lowpass, axps]) + else: + axps_stimulus = axps + pp3 = pps + # embed() + + # pp3[4] = np.array([float('nan')]*len(pp3[4])) + # embed() + # ok i do this because most cells dont spike, but they are not nice to show because of the very high offset between persynaptci potenatil and spike + # there are only few cells where the distance is not so high and this cells spike occationally but very randomly still we dont wanna se their power specturm + # therefore we dont show it + colors = [color_diagonal, color_p1, color_p1, color_p3, + color_diagonal, color_p1, color_p1, color_p3, + color_diagonal, color_p1, color_p1, color_p3, ] + + plot_points = ['yes', 'yes', 'yes', 'yes', + 'yes', 'yes', 'yes', 'yes', + 'yes', 'yes', 'yes', 'yes', + 'yes', 'yes', 'yes', 'yes', ] + plot_points = [[], 'yes', [], 'yes', + [], 'yes', [], 'yes', + [], 'yes', [], 'yes', + [], 'yes', [], 'yes', ] + + axt_stims[0].get_shared_y_axes().join(*axt_stims) + axt_IF1[0].get_shared_y_axes().join(*axt_IF1) + ax_noise[0].get_shared_y_axes().join(*ax_noise) + set_same_ylim(ax_noise) + # embed() + ax = np.transpose([axt_stims[0::2], axt_stims[1::2],ax_noise, axt_IF1, axps_stimulus]) + + fig = plt.gcf() + #fig.tag(ax, xoffs=-3.5, yoffs = 1.5) + nr = 1.7#2#.24 + tag2(fig, axshemes, xoffs=-3.5, yoffs=5.5) + tag2(fig, np.transpose(ax), xoffs=-3.5)#yoffs = [5.5,nr,nr,nr,nr-0.2] + # get_ylim_same + + ######################################################### + # plot psds + for a, axp in enumerate(axps_stimulus): + lw_p = 0.8 + # gemeinsamen Limit setzten + pp_here = 2*10 * np.log10(pp3[a] / np.max(pp3))# der faktor 2 ist falsch + plot_power_common_lim(axp, pp_here, 0, ff / eod_fr, colors[a], lw_p, plot_points[a], delta_f / eod_fr, + log=False, + devide=devide) + + axp.show_spines('b') + axp.set_ylim(-22, 1) # -8.5 + if a == 3: # % 4 == 3: + axp.yscalebar(1.1, 0.6, 20, 'dB', va='center', ha='right') + #axp.yscalebar(1.1, 0.8, 20, 'dB', va='center', ha='right') + #embed() + + axps_stimulus[0].get_shared_y_axes().join(*axps_stimulus) + # if power_extra: + # axps_stimulus[0].get_shared_y_axes().join(*axps_stimulus) + + +def model_sheme_split2(grid_sheme_orig, time_transform=1000, ws=0.1, nfft=4096 * 6, stimulus_length=5, fft_type='mppsd', + a_fr=1, a_fe=0.2, + v_exp=1, exp_tau=0.1, counter=0, counterp=0, color='darkgrey', log=True, + shift=0.25): + load_name = 'models_big_fit_d_right.csv' + cell_nr = 8 # 5#5#6#3 + # model_params = load_model(load_name=load_name, cell_nr = cell_nr) + models = resave_small_files("models_big_fit_d_right.csv", load_folder='calc_model_core') + flowchart_cell = '2012-07-03-ak-invivo-1' + model_params = models[models['cell'] == flowchart_cell].iloc[0] + print('cell='+str(flowchart_cell)) + # amp_frame = pd.read_csv('peak_amplitudes_power.csv') + + cell = model_params.pop('cell') # .iloc[0]# Werte für das Paper nachschauen + eod_fr = model_params['EODf'] # .iloc[0] + deltat = model_params.pop("deltat") # .iloc[0] + v_offset = model_params.pop("v_offset") # .iloc[0] + + sampling_rate = 1/deltat + nfft = 2**20#int(sampling_rate / 4) + #embed() + cell_nr = 8 # 5#5#6#3 + # embed() + + eod_fe = [eod_fr + 50] # eod_fr*1+50,, eod_fr * 2 + 50 + mult_nr = 0 + + # REMAINING rows + color_p3 = 'grey' # 'red'#palette['red'] + color_p1 = 'grey' # 'blue'#palette['blue'] + color_diagonal = 'grey' # 'cyan'#palette['cyan'] + colors = [color_diagonal, color_p1, color_p1, color_p3] + + ax_rec = [[]] * 4 + ax_n = [[]] * 4 + axt_IF1 = [] + axt_IF2 = [] + adds = [[0, 0, 0, 0], [0, 0, 2, 10]] + nrs_grid = [0, 1, 3, 4] + # delta_f = (eod_fe[mult_nr] - eod_fr) - eod_fr + delta_f = [50] # create_beat_corr(np.array([eod_fe[mult_nr] - eod_fr]), np.array([eod_fr]))[0] + + # time, stimulus_here, eod_fish_r, eod_fish_e, stimulus = make_paramters( + # stimulus_length, deltat, eod_fr, a_fr, a_fe, eod_fe, mult_nr) + counter_here = 0 + # ult_settings(column=2, length=5) + # # fdefaig = plt.figure() + # for mult_nr in range(len(eod_fe)): c_sigs = [1, 1, 0.9]#1, c_sigs = [0, 0, 0.9]#'',0,