Skip to content

Commit

Permalink
Minor changes for thesis writing needs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Du committed Oct 14, 2024
1 parent bc13c4c commit ebafe3c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion topostats/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ loading:
channel: Height # Channel to pull data from in the data files.
filter:
run: true # Options : true, false
row_alignment_quantile: 0.5 # below values may improve flattening of larger features
row_alignment_quantile: 0.5 # Lower values may improve flattening of larger features
threshold_method: std_dev # Options : otsu, std_dev, absolute
otsu_threshold_multiplier: 1.0
threshold_std_dev:
Expand Down
14 changes: 14 additions & 0 deletions topostats/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def set(self, name: str):
self.cmap = self.gwyddion()
elif name.lower() == "blu":
self.cmap = self.blu()
elif name.lower() == "white":
self.cmap = self.white()
else:
# Get one of the matplotlib colormaps
self.cmap = mpl.colormaps[name]
Expand Down Expand Up @@ -120,3 +122,15 @@ def gwyddion():
def blu():
"RGBA colour map of just the colour blue."
return ListedColormap([[32 / 256, 226 / 256, 205 / 256]], "blu", N=256)

@staticmethod
def white():
"RGBA colour map of just the colour white."
N = 256 # Number of values
vals = np.ones((N, 4)) # Initialise the array to be full of 1.0
vals[0] = [0.0, 0.0, 0.0, 1]
for i in range(1, 255):
vals[i] = [32 / 256, 226 / 256, 205 / 256, 1.0]

colormap = LinearSegmentedColormap.from_list("gwyddion", vals, N=256)
return colormap
1 change: 1 addition & 0 deletions topostats/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def validate_config(config: dict, schema: Schema, config_type: str) -> None:
"afmhot",
"nanoscope",
"gwyddion",
"white",
error="Invalid value in config for 'plotting.cmap', valid values are 'afmhot', 'nanoscope' or 'gwyddion'",
),
"mask_cmap": str,
Expand Down

0 comments on commit ebafe3c

Please sign in to comment.