Loading pysen/misc.py +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ _LOG_LEVELS={ _MIN_LEVEL=0 _MAX_LEVEL=3 def setup_logger(level=DEFAULT_LOG_LEVEL): def setup_logger(level=DEFAULT_LOG_LEVEL, filename=None): "setup logger" level = max(min(level,_MAX_LEVEL),_MIN_LEVEL) loglevel = _LOG_LEVELS.get(level, logging.INFO) Loading @@ -25,7 +25,7 @@ def setup_logger(level=DEFAULT_LOG_LEVEL): log_format=r'%(message)s' if level<logging.INFO: log_format=r'%(levelname)s: %(funcName)s: %(message)s' logging.basicConfig(level=loglevel, format=log_format) logging.basicConfig(filename=filename, level=loglevel, format=log_format) return logging.getLogger() def dictionary_hash(arg): Loading pysen/plot/nseplot.py +6 −5 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ data = [ _ , axes = plt.subplots(figsize=(8,6)) _ , qlim = plot_coverage(axes, *data, center=center, errors=errors, cmap=mpl.cm.get_cmap(cmap), full=full) cmap=mpl.colormaps.get_cmap(cmap), full=full) axes.set_ylim(0.9*qlim[0], 1.1*qlim[1]) axes.set_xlabel(r'$\tau$ [ns]') axes.set_ylabel(r'Q [$\AA^{-1}$]') Loading Loading @@ -429,13 +429,14 @@ def add_datreat_options(subparser, parents=None): def add_plotmap_options(subparser, parents=None): "map plot" pars = subparser.add_parser('maps', parents=parents, pars = subparser.add_parser('map', parents=parents, help='map', description='create map plots') pars.set_defaults(map_type='up',) pars.add_argument('file', metavar='filename', help='file to process', nargs='+') add_extend_argument(pars, '--tau', dest='taus', metavar='tau', type=int, nargs='*', help='select list of taus') pars.add_argument('--map-type', dest='map_type', choices=['all', 'up', 'down'], pars.add_argument('--map-type', dest='map_type', choices=['all', 'up', 'down', 'phase'], help='(default: %(default)s)') pars.add_argument('--num-pix', '-N', dest='npix', type=int, help='set pixel binning (default=%(default)s)') Loading Loading @@ -544,7 +545,7 @@ def main(): # datreat plot #add_datreat_options(subparsers, parents=[pars_com]) # map plot #add_plotmap_options(subparsers, parents=[pars_com,]) add_plotmap_options(subparsers, parents=[pars_com,]) # magnetic field add_bfield_options(subparsers, parents=[pars_com,]) # qtau plot Loading @@ -563,7 +564,7 @@ def main(): action = dict( echo=action_echo, ec=action_echo, atari=action_atari, at=action_atari, maps=action_maps, map=action_maps, bfield=action_bfield, bf=action_bfield, xyz=action_xyz, diffrun=action_diffrun, df=action_diffrun, Loading pysen/plot/qplot.py +4 −4 Original line number Diff line number Diff line Loading @@ -11,8 +11,8 @@ import itertools from io import StringIO import numpy as np import matplotlib as mpl from numpy import sqrt from matplotlib import cm from matplotlib.patches import Polygon from matplotlib.colors import LogNorm #pylint: disable=no-name-in-module Loading Loading @@ -40,7 +40,7 @@ def plot_detector_image(axis, results, outfile=None, **kwargs): minz = kwargs.pop('vmin', None) maxz = kwargs.pop('vmax', None) logz = kwargs.pop('logz', False) cmap = kwargs.pop('cmap', cm.get_cmap()) cmap = kwargs.pop('cmap', mpl.colormaps.get_cmap()) norm = kwargs.pop('normalize', None) tbin1 = kwargs.pop('tbin1', 0) tbin2 = kwargs.pop('tbin2', None) Loading Loading @@ -204,7 +204,7 @@ def plot_coverage(axes, *data, **kwargs): center = kwargs.pop('center', False) # plot coverage for the center of the detector full = kwargs.pop('full', False) # plot coverage for the entire detector errors = kwargs.pop('errors', True) # plot "errors" cmap = kwargs.pop('cmap' , cm.get_cmap()) cmap = kwargs.pop('cmap' , mpl.colormaps.get_cmap()) log = logging.getLogger() Loading Loading @@ -278,7 +278,7 @@ def plot_diffrun(axis, filenames, **kwargs): title = 'Diffraction Run Plot' out = None cmap = cm.get_cmap('hsv') cmap = mpl.colormaps.get_cmap('hsv') if output: out = open(output, 'wb') #pylint: disable=consider-using-with Loading pysen/revision.py +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ PySEN revision module """ import sys __version__ = "1.3" __release__ = "b5" __date__ = "Mar 17, 2023" __release__ = "b6" __date__ = "Mar 31, 2023" def version(full=False): "get pysen version number" Loading scripts/qtau.py +2 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ import sys import argparse #import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm from pysen import version from pysen.config import coverage Loading Loading @@ -135,7 +135,7 @@ def main(): fig, axes = plt.subplots() _, qlim = plot_coverage(axes, *data, center=args.center, errors=args.errors, cmap=cm.get_cmap(args.cmap), errors=args.errors, cmap=mpl.colormaps.get_cmap(args.cmap), full=args.full, verbose=args.verbose) if plot_custom: Loading Loading
pysen/misc.py +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ _LOG_LEVELS={ _MIN_LEVEL=0 _MAX_LEVEL=3 def setup_logger(level=DEFAULT_LOG_LEVEL): def setup_logger(level=DEFAULT_LOG_LEVEL, filename=None): "setup logger" level = max(min(level,_MAX_LEVEL),_MIN_LEVEL) loglevel = _LOG_LEVELS.get(level, logging.INFO) Loading @@ -25,7 +25,7 @@ def setup_logger(level=DEFAULT_LOG_LEVEL): log_format=r'%(message)s' if level<logging.INFO: log_format=r'%(levelname)s: %(funcName)s: %(message)s' logging.basicConfig(level=loglevel, format=log_format) logging.basicConfig(filename=filename, level=loglevel, format=log_format) return logging.getLogger() def dictionary_hash(arg): Loading
pysen/plot/nseplot.py +6 −5 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ data = [ _ , axes = plt.subplots(figsize=(8,6)) _ , qlim = plot_coverage(axes, *data, center=center, errors=errors, cmap=mpl.cm.get_cmap(cmap), full=full) cmap=mpl.colormaps.get_cmap(cmap), full=full) axes.set_ylim(0.9*qlim[0], 1.1*qlim[1]) axes.set_xlabel(r'$\tau$ [ns]') axes.set_ylabel(r'Q [$\AA^{-1}$]') Loading Loading @@ -429,13 +429,14 @@ def add_datreat_options(subparser, parents=None): def add_plotmap_options(subparser, parents=None): "map plot" pars = subparser.add_parser('maps', parents=parents, pars = subparser.add_parser('map', parents=parents, help='map', description='create map plots') pars.set_defaults(map_type='up',) pars.add_argument('file', metavar='filename', help='file to process', nargs='+') add_extend_argument(pars, '--tau', dest='taus', metavar='tau', type=int, nargs='*', help='select list of taus') pars.add_argument('--map-type', dest='map_type', choices=['all', 'up', 'down'], pars.add_argument('--map-type', dest='map_type', choices=['all', 'up', 'down', 'phase'], help='(default: %(default)s)') pars.add_argument('--num-pix', '-N', dest='npix', type=int, help='set pixel binning (default=%(default)s)') Loading Loading @@ -544,7 +545,7 @@ def main(): # datreat plot #add_datreat_options(subparsers, parents=[pars_com]) # map plot #add_plotmap_options(subparsers, parents=[pars_com,]) add_plotmap_options(subparsers, parents=[pars_com,]) # magnetic field add_bfield_options(subparsers, parents=[pars_com,]) # qtau plot Loading @@ -563,7 +564,7 @@ def main(): action = dict( echo=action_echo, ec=action_echo, atari=action_atari, at=action_atari, maps=action_maps, map=action_maps, bfield=action_bfield, bf=action_bfield, xyz=action_xyz, diffrun=action_diffrun, df=action_diffrun, Loading
pysen/plot/qplot.py +4 −4 Original line number Diff line number Diff line Loading @@ -11,8 +11,8 @@ import itertools from io import StringIO import numpy as np import matplotlib as mpl from numpy import sqrt from matplotlib import cm from matplotlib.patches import Polygon from matplotlib.colors import LogNorm #pylint: disable=no-name-in-module Loading Loading @@ -40,7 +40,7 @@ def plot_detector_image(axis, results, outfile=None, **kwargs): minz = kwargs.pop('vmin', None) maxz = kwargs.pop('vmax', None) logz = kwargs.pop('logz', False) cmap = kwargs.pop('cmap', cm.get_cmap()) cmap = kwargs.pop('cmap', mpl.colormaps.get_cmap()) norm = kwargs.pop('normalize', None) tbin1 = kwargs.pop('tbin1', 0) tbin2 = kwargs.pop('tbin2', None) Loading Loading @@ -204,7 +204,7 @@ def plot_coverage(axes, *data, **kwargs): center = kwargs.pop('center', False) # plot coverage for the center of the detector full = kwargs.pop('full', False) # plot coverage for the entire detector errors = kwargs.pop('errors', True) # plot "errors" cmap = kwargs.pop('cmap' , cm.get_cmap()) cmap = kwargs.pop('cmap' , mpl.colormaps.get_cmap()) log = logging.getLogger() Loading Loading @@ -278,7 +278,7 @@ def plot_diffrun(axis, filenames, **kwargs): title = 'Diffraction Run Plot' out = None cmap = cm.get_cmap('hsv') cmap = mpl.colormaps.get_cmap('hsv') if output: out = open(output, 'wb') #pylint: disable=consider-using-with Loading
pysen/revision.py +2 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ PySEN revision module """ import sys __version__ = "1.3" __release__ = "b5" __date__ = "Mar 17, 2023" __release__ = "b6" __date__ = "Mar 31, 2023" def version(full=False): "get pysen version number" Loading
scripts/qtau.py +2 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ import sys import argparse #import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm from pysen import version from pysen.config import coverage Loading Loading @@ -135,7 +135,7 @@ def main(): fig, axes = plt.subplots() _, qlim = plot_coverage(axes, *data, center=args.center, errors=args.errors, cmap=cm.get_cmap(args.cmap), errors=args.errors, cmap=mpl.colormaps.get_cmap(args.cmap), full=args.full, verbose=args.verbose) if plot_custom: Loading