Open martindurant opened 4 years ago
cc @Bertin-fap
In fact it's work. I'm not categoric, but it seems that xrviz requires the coordinates to be expressed with physical unities.
I don't believe that should be the case, so long as they are defined. There is some logic to try to infer whether the coordinates are geo-location, and that could perhaps get tripped up on coordinate units.
I just retry. When the unit of x and y are u.a. (number of pixels) no plot is possible. But when the unit of x and y are expressed in µm the plot works fine.
If you could generate a minimal, reproducible example, it should be posted as a bug at xrviz.
The bug comme from a "wrong interpretation" of the unit cm-1 which is used in spectroscopy. This link, https://github.com/Bertin-fap/bug-xrviz/blob/master/xrviz_test.ipynb, , provides a minimal reproducible example. (I'm a newcomer in Github and and I dont know how to post a bug...)
I'm sure... cm-1 not the same as 1/cm :)
The xrviz project was pushed by the geospatial/climate community, so it tends to be more correct around latitude/longitude and such rather than physical units. I can see from your example that removing the units attributes does make plotting work.
(replying here to make the conversation public and searchable)
Since I don’t have access to your raw data, I am not certain what data type you are passing to xrviz, but you should note that it only works with xarray DataSets, not simple NumPy arrays. Of course, you can create these datasets from simple arrays, if you want. However, I suspect your data may be a data frame, in which case you want the dfviz package instead. In any case, you generally have to select the variables/fields that you want to plot before being able to click on the plot button.
Please note further, that xrviz was a summer project from last year, and the main author is continuing his studies, so all help would be appreciated in maintaining the project! I particular, it would make sense to automatically convert a numpy array to xarray when appropriate.