Check if this code is doing what's needed
# Determine scaling and label based on units
if units is not None:
units_upper = units.upper()
if units_upper in ["BQML", "BQ/ML"]:
scale_factor = 1e6
colorbar_label = "MBq/ml"
elif units_upper in ["BQ", "BECQUEREL"]:
scale_factor = 1e6
colorbar_label = "MBq"
elif units_upper in ["CNTS", "COUNTS"]:
scale_factor = 1.0
colorbar_label = "Counts"
else:
# Unknown units, no scaling
scale_factor = 1.0
colorbar_label = units
else:
# Default: assume Bq and convert to MBq
scale_factor = 1e6
colorbar_label = "MBq"
When is displaying a colorbar that looks like this
