BoldingBruggeman / pyncview

PyNcView is a cross-platform NetCDF viewer written in Python. It provides an easy-to-use graphical user interface to the creation of animations and publication-quality figures.
GNU General Public License v2.0
18 stars 1 forks source link

Wrong time units in axis label #8

Open markusReinert opened 6 months ago

markusReinert commented 6 months ago

When opening the NetCDF file in this test_dataset.zip in PyNcView and looking at its time variable, the units of the vertical axis are wrong. The units claim that the data is in "seconds since 2000-01-01 00:00:00", which are the units given in the dataset. However, PyNcView (or maybe xmlplot) has converted the values internally to days since 1970-01-01. In consequence, the shown values do not match the shown units. This is particularly confusing when looking at a single value, where the same false information is printed in text.

The mismatch is shown in the following screenshot. Every marker corresponds to one day in November 2001, as correctly shown on the x-axis, but according to the y-axis, the markers are only 1 second apart. Screenshot from 2024-03-26 15-22-55 I think, if PyNcView (or xmlplot) converts the time-axis, the "units" should be adjusted accordingly. I've tried to identify the location where this error is made, but haven't found it yet. (I've only found a typo in line 2150 of plot.py: it's probably "tick", not "tock".)

Thanks for taking a look at this!

P.S.: I've previously observed an issue that could be related: When displaying a variable with the attribute "coordinates", then the values of the given coordinates are combined with the labels and units of the actual dimensions, leading again to a mismatch of values and labels.