topostats#
Topostats.
Submodules#
- topostats.__main__
- topostats.entry_point
- topostats.filters
- topostats.grains
- topostats.grainstats
- topostats.io
- topostats.logs
- topostats.plotting
- topostats.plottingfuncs
- topostats.processing
- topostats.run_modules
- topostats.scars
- topostats.statistics
- topostats.theme
- topostats.thresholds
- topostats.tracing
- topostats.unet_masking
- topostats.utils
- topostats.validation
Attributes#
Classes#
Class for setting the Colormap. |
Functions#
|
Logger setup. |
Package Contents#
- topostats.setup_logger(log_name: str = LOGGER_NAME) logging.Logger [source]#
Logger setup.
The logger for the module is initialised when the module is loaded (as this functions is called from __init__.py). This creates two stream handlers, one for general output and one for errors which are formatted differently (there is greater information in the error formatter). To use in modules import the ‘LOGGER_NAME’ and create a logger as shown in the Examples, it will inherit the formatting and direction of messages to the correct stream.
- Parameters:
log_name (str) – Name under which logging information occurs.
- Returns:
Logger object.
- Return type:
logging.Logger
Examples
To use the logger in (sub-)modules have the following.
import logging from topostats.logs.logs import LOGGER_NAME
LOGGER = logging.getLogger(LOGGER_NAME)
LOGGER.info(‘This is a log message.’)
- class topostats.Colormap(name: str = 'nanoscope')[source]#
Class for setting the Colormap.
- Parameters:
name (str) – Name of colormap to use.
- name = 'nanoscope'#
- cmap = None#
- __str__() str [source]#
Return string representation of object.
- Returns:
String detailing the colormap.
- Return type:
str
- set_cmap(name: str) None [source]#
Set the ColorMap.
- Parameters:
name (str) – Name of the colormap to return.
- get_cmap() matplotlib.cm [source]#
Return the matplotlib.cm colormap object.
- Returns:
Matplotlib Color map object.
- Return type:
matplotlib.cm
- static nanoscope() matplotlib.colors.LinearSegmentedColormap [source]#
Matplotlib compatible colormap that replicates the Bruker Nanoscope colorscale.
The colormap is implemented in Gwyddion’s GwyGradient via ‘Nanoscope.txt’.
- Returns:
MatplotLib LinearSegmentedColourmap that replicates Bruker Nanoscope colorscale.
- Return type:
LinearSegmentedColormap
- static gwyddion() matplotlib.colors.LinearSegmentedColormap [source]#
Set RGBA colour map for the Gwyddion.net colour gradient.
- Returns:
The ‘gwyddion’ colormap.
- Return type:
LinearSegmentedColormap
- topostats.LOGGER#
- topostats.release#
- topostats.__version__ = ''#