Commit 0430a91c authored by Boers, Frank's avatar Boers, Frank
Browse files

update performance polt

parent 553bf9e4
#!/usr/bin/env python
"""
gDCNN label_check
......@@ -19,6 +21,8 @@ import os.path as op
from mne.report import Report
from distutils.dir_util import mkpath
__version__= "2020.08.04.001"
logger = setup_script_logging()
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -42,7 +46,7 @@ cfg = DCNN_CONFIG(verbose=True)
cfg.load(fname=fnconfig)
dcnn = DCNN(**cfg.config)
dcnn.verbose = True
# dcnn.verbose = True
# -- update basedir
dcnn.path.basedir = basedir
......
......@@ -19,7 +19,7 @@ from mne.viz import topomap
from dcnn_utils import logger, isFile, isPath, rescale, read_raw, get_raw_filename,expandvars
from dcnn_utils import apply_noise_reduction_4d,fig2rgb_array
__version__ = "2020.07.06.001"
__version__ = "2020.08.04.001"
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# SLOTS class
......
......@@ -23,7 +23,7 @@ import inspect
from distutils.dir_util import mkpath
import logging
__version__="2020.07.06.001"
__version__="2020.08.04.001"
try:
# https://github.com/borntyping/python-colorlog
......
......@@ -603,11 +603,11 @@ class DCNN(object):
"-"*30,
"name : {}".format(name)]
logger.info("\n".join(msg))
logger.info("\n -> ".join(msg))
for ichop in range( self.ica.chop.n_chop ):
captions.append('AR %s ... Chop#%d' % (name.split(",")[0], ichop))
logger.info((" -> plot ARP ICA chop: {} caption: {}".format(ichop,captions[-1])))
logger.info("plot ARP ICA chop: {} caption: {}".format(ichop,captions[-1]))
ica = self.ica.chop.ica[ichop].copy()
......@@ -796,20 +796,16 @@ class DCNN(object):
# for k, v in npz.items():
# logger.info("gDCNN data: {}\n{}".format(k, v))
# get details
# init clases
self.path.init(**npz.get('path').item()) # load dict
logger.info("path:\n -> {}".format(self.path))
self.model = npz.get('model').item() # load dict
#logger.info("model:\n -> {}".format(self.model))
# data objects
# data objects cls
self.meg.init(**npz['meg'].item()) # get dict from np.array
self.ica.init(**npz['ica'].item()) # get dict from np.array
self.sources.init(**npz['sources'].item()) # get dict from np.array
#logger.info("sources:\n -> {}".format(self.sources))
return npz
......
......@@ -376,7 +376,7 @@ class PERFORMANCE_PLOT(CalcSignal):
"""
self._update_from_kwargs(**kwargs)
title = kwargs.get("title")
evt = kwargs.get("events")
counts = evt.shape[0]
......@@ -392,7 +392,6 @@ class PERFORMANCE_PLOT(CalcSignal):
if self.idx == 1:
self.figures.append( plt.figure(self.fig_nr) )
self._fig = self.figures[-1]
title = kwargs.get("title")
if title:
self.figure.suptitle(title ,fontsize=12)
suptitle = kwargs.get("suptitle")
......@@ -423,9 +422,13 @@ class PERFORMANCE_PLOT(CalcSignal):
self._plot(ax4,t,sig_ref * scl.get("factor"),scl.get("unit"),"green")
ax4.tick_params(axis='y',labelcolor=color)
ax4.legend(["Clean " + self.ch_name + " cnts {}".format(counts)],loc=2,prop={ 'size':8 })
try:
ax1.set_ylim(ylim[0],ylim[1])
ax2.set_ylim(ylim[0],ylim[1])
except:
ax1.set_ylim(-1.0,1.0)
ax2.set_ylim(-1.0,1.0)
logger.error("ERROR in performance plot : can not set ylim : {}".format(title))
plt.tight_layout()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment