parameters.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. """
  2. Settings for analysis and plotting.
  3. """
  4. import numpy as np
  5. from matplotlib import pyplot as plt
  6. from matplotlib import cm as colormaps
  7. from matplotlib.colors import to_rgb
  8. SERVERPATH = '/mnt/hux/mudata'
  9. DATAPATH = 'data/'
  10. FIGUREPATH = 'figures/'
  11. FIGSAVEFORMAT = '.svg'
  12. LABELFONTSIZE = 6
  13. COLORS = {
  14. 'spk': 'black',
  15. 'tonicspk': 'C0',
  16. 'burst': 'C3',
  17. 'pupil': 'black',
  18. 'run': 'green',
  19. 'sit': 'gray',
  20. 'imfs': colormaps.viridis,
  21. 'hht': 'black',
  22. 'spontaneous': 'gray',
  23. 'sparsenoise': 'pink',
  24. 'dark': 'black',
  25. 'natmov': 'darkblue',
  26. 'natmov_opto': 'darkblue',
  27. 'elevation': list(to_rgb('purple')) + [0.5],
  28. 'azimuth': 'purple',
  29. 'saccade': 'purple',
  30. 'phasebin2': 'mediumaquamarine',
  31. 'phasebin1': 'violet'
  32. }
  33. plt.rcParams['figure.dpi'] = 180
  34. plt.rcParams['axes.labelsize'] = LABELFONTSIZE
  35. plt.rcParams['xtick.labelsize'] = LABELFONTSIZE
  36. plt.rcParams['ytick.labelsize'] = LABELFONTSIZE
  37. plt.rcParams['legend.fontsize'] = LABELFONTSIZE
  38. NPUPILAREABINS = 10
  39. NGAMSPLINES = 20
  40. MINRATE = 0.01 # spikes / second
  41. BURSTCRITERIA = '(fp_dtsilent BETWEEN 0.099 and 0.101) AND (fp_dtburst BETWEEN 0.0039 AND 0.0041)'
  42. FIG1BEXAMPLEKEY = {'m': 'BL6_2014_0191', 's': 6, 'e': 4, 'u': 8}
  43. FIG1BEXAMPLETRANGE = 220, 520 # seconds
  44. FIG1BTBINWIDTH = 2.5 # seconds
  45. FIG1DEXAMPLEKEY = {'m': 'BL6_2014_0191', 's': 6, 'e': 4}
  46. FIG1DEXAMPLEIMF = 2
  47. FIG2BEXAMPLEKEY = {'m': 'PVCre_2019_0002', 's': 8, 'e': 8, 'u': 2}
  48. FIG2BEXAMPLEIMF = 2
  49. FIG2BEXAMPLETRANGE = 360, 420
  50. FIG5AEXAMPLEKEY = {'m':'PVCre_2018_0003', 's':3, 'e':3, 'u':53}
  51. # Locomotion bout detection
  52. RUNTHRESHOLD = 1
  53. MINRUNTIME = 2
  54. MAXSITTIME = 2
  55. MINRUNPROP = 0.5
  56. # MAXIBI = 0.5
  57. NIMFCYCLES = 4
  58. NSPIKES = 8
  59. NSHUFFLES = 1000
  60. SHUFFLE_BINWIDTH = 0.3 # seconds
  61. FREQUENCYBINS = np.logspace(-3, 0, 7)
  62. FREQUENCYXPOS = np.log10(FREQUENCYBINS[:-1]) + 0.25
  63. FREQUENCYTICKS = np.linspace(-3, 0, 4)
  64. FREQUENCYTICKLABELS = ["$10^{%d}$" % tick for tick in FREQUENCYTICKS]
  65. PHASEBINS = np.linspace(-np.pi, np.pi, 9, endpoint=True)
  66. PHASETICKS = PHASEBINS[::4]
  67. PHASETICKLABELS = ['-\u03C0', '0', '\u03C0']
  68. TRIGGEREDAVERAGES = {
  69. 'run': {
  70. 'dt': 0.05,
  71. 'bw': 0.1,
  72. 'pre': -5,
  73. 'post': 5,
  74. 'baseline': [-5, -3]
  75. },
  76. 'sit': {
  77. 'dt': 0.05,
  78. 'bw': 0.1,
  79. 'pre': -5,
  80. 'post': 5,
  81. 'baseline': [-5, -3]
  82. },
  83. 'saccade': {
  84. 'dt': 0.05,
  85. 'bw': 0.1,
  86. 'pre': -5,
  87. 'post': 5,
  88. 'baseline': [-5, -3]
  89. },
  90. 'trial_on': {
  91. 'dt': 0.05,
  92. 'bw': 0.1,
  93. 'pre': -1,
  94. 'post': 5,
  95. 'baseline': [-1, 0]
  96. }
  97. }
  98. BEHAVEXCLUSIONS = {
  99. 'run': [-2, 2],
  100. 'sit': [-1, 4],
  101. 'saccade': [-2, 2]
  102. }