fleck
fleck copied to clipboard
Error in temp_cmap calculation when plotting the star
In /fleck/jax.py line 609, temp_cmap is defined as:
log_temps = np.log10(self.temperature)
def temp_cmap(x):
return to_hex(
plt.cm.YlOrRd_r(
(np.log10(x) - min(log_temps)) /
(max(log_temps) - min(log_temps)) * 0.6 + 0.4
)
)
In the event that self.temperature is an array with only one unique value (for example, if you are including only one type of active region), the denominator of this expression becomes zero. The plot will still be created, but you receive n error messages for n active regions, and the colormap defaults to black spots against a pale yellow star.
There are several different ways I can imagine dealing with this, like including the stellar Teff as the max value in the temp_cmap calculation, or fixing the min and max log_temp values.