Open onion5376 opened 4 months ago
Hi @onion5376
Can you possibly make the problem reproducible? Without the data, it's difficult to figure out the issue.
Can you also give details on what's happening? Is it throwing an error?
Why are you assigning lon/lat after calculating the spatial average?
Hi @robertjwilson, Thanks for your help.
import nctoolkit as nc
ds = nc.open_thredds("https://psl.noaa.gov/thredds/dodsC/Datasets/COBE2/sst.mon.mean.nc")
ds.subset(time = 0)
ds.plot()
The result of running the code is shown in the following screenshot, it is just a blank display
When i try to use matplotlib to plot a simple figure, it can work well with a right figure in jupyter lab. code:
import matplotlib.pyplot as plt
plt.plot([1,2],[1,3])
Additional system platform and python installer information:
Thanks @onion5376. I just tired this on Ubuntu with that set up and it worked fine.
What browser are you using to view jupyterlab?
My guess is that the issue is caused by what version of nctoolkit's dependencies are installed. Are you working in conda? If so, can you possibly share the environment? Or have you installed with pip?
Thanks for your help @robertjwilson. The browser is firefox 78.5.0esr 64-bit. The nctookit is installed with mamba. I export this environment yam file from mamba, and upload it. environment.zip
Thanks @onion5376.
I'll try to reproduce this later today.
In the meantime, you could check if these hvplot examples work for you. Internally, nctoolkit calls hvplot, so this is probably what's causing the issue.
I operate the example in website (https://hvplot.holoviz.org/user_guide/Gridded_Data.html), it also fails to show figure. When installing nctoolkit with mamba, hvplot is automatically installed as a dependency package.
Thanks @onion5376. That poins towards the problem being versioning issues. I will see if I can identify the problematic versions in the environment and maybe try adding some pinning on conda to ensure problematic versions don't get installed.
Hi @robertjwilson. I try another example in nctoolkit website (https://nctoolkit.readthedocs.io/en/v1.1.11/datasets.html). The script is shown below:
import nctoolkit as nc
ds = nc.open_thredds("https://psl.noaa.gov/thredds/dodsC/Datasets/COBE2/sst.mon.ltm.1981-2010.nc")
ds.subset(time = 0)
ds.plot()
It also get another errors:
The variable valid_yr_count has integer data type. Consider setting data type to float 'F64' or 'F32' using set_precision. Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range
Hi @onion5376. Those are warning messages, not errors.
Hi @onion5376. I just tried reproducing the problem using your environment.yml. Everything worked fine. So I'm not sure what the issue is. Most likely this is a system-level problem with your web browser. Have you tried it with a different browser? Given the hvplot examples don't work, there must be something going on at the browser level
I am new user of nctoolkit, so I follow the tutorial (https://nctoolkit.readthedocs.io/en/v1.1.11/visualization.html) to study this package.
My code is listed as following:
I had try use matlibplot to test the figure in jupyterlab,but it could work well,code is listed as following: