-
Notifications
You must be signed in to change notification settings - Fork 296
Description
🐛 Bug Report
The automatic quickplot time label is unrelated to the printed time ticks and even to native cube units
Minimum Reproducible Code
Any spatio-temporal cube will do; I've saved an example of Pacific SST from a pre-Industrial control run using years 1191-1200, attached it below (be sure to remove .txt
from the name):
sst_example.nc.txt
import iris
import iris.quickplot as qplt
import esmvalcore.preprocessor as pp
ex = iris.load_cube('sst_example.nc')
m_ex = pp.meridional_statistics(ex, operator='mean')
qplt.pcolormesh(m_ex)
#prints native units of cube
Time = m_ex.coord('time')
time_meta_data = Time.metadata.units
Calendar = time_meta_data.calendar
U = time_meta_data.cftime_unit
print(U)
print(max(Time.points))
Expected behaviour
The native units of the cube m_ex
are days since 1850-1-1 00:00:00
(see printed output in the screenshot below), and the values are incredibly large negative numbers (the largest time value is -237266.5
). However, I do not expect to see tick labels in days relative to some offset, but in absolute time presented in years, ranging from 1191 to 1200. I thus expect the time axis to be labelled Year
, or Time / Year
Observed behavior
The time ticks appear as expected, as all are between 1191 and 1200. However, the automatic label says Time / days since 1970-01-01
. This is clearly not consistent with the time ticks because the presented numbers of in units of years with no time offset. Furthermore, t's completely unclear where the offset in the label came from, since the native offset of the cube being plotted (m_ex
) is 1850
. I wonder if these units have been hard-coded somewhere?