-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetCDF time axis - last touch needed #24
Comments
Thanks for the kind words :) Are you using version 2.0.3 of the plugin? Because I couldn't reproduce the problem with your example file. If yes, then could you post the full exception trace. |
Cheers!
Thank you for your answer - so if you do not see the problem, it should be
something else, because I have updated version to 2.0.3, on QGIS v3.14 (Pi).
From the traceback, I see the numpy used here is of version 1.19.1,
installed in .local dir (my local install using pip).
I have updated it to 1.21, but the problem persisted.
I also checked more and my nc-time-axis version was 1.2.0. I have updated
it by pip to the current 1.4.0. The problem persists.
I have upgraded matplotlib from 3.0.2 to v. 3.5.0 using pip - but now, i
cannot see any plot at all as this matplotlib doesn't have some qt4 module
or something.
ok... I will just conclude now that the problem is my mess with python3
libraries and their paths.
still very strange that your tool works fine for me only after i first plot
something without using netcdf time dimensions, and then i tick to 'use
netcdf time dimension'
note - I have removed the matplotlib upgrade and did the same again. now
the time axis doesn't show time but values from 6728 to some 6736 or so.
so i have downgraded the nc-time-axis back to 1.2. it didn't change -
again, values 6728-6736.
well, do you have any recommendation, e.g. what versions of python
libraries should really work?
the full exception trace is :
Traceback (most recent call last):
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/temporalprofileplugin.py",
line 176, in leftClicked
self.doubleClicked(point)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/temporalprofileplugin.py",
line 181, in doubleClicked
self.doprofile.calculatePointProfile(point, self.mdl,
self.plotlibrary)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/tools/doprofile.py",
line 117, in calculatePointProfile
PlottingTool().attachCurves(self.dockwidget, self.profiles,
model, library)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/tools/plottingtool.py",
line 154, in attachCurves
line = wdg.plotWdg.figure.get_axes()[0].plot(xx, yy, gid =
profileId)[0]
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py",
line 1812, in inner
return func(ax, *args, **kwargs)
File
"/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py", line 1612, in
plot
self.add_line(line)
File
"/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 1895, in
add_line
self._update_line_limits(line)
File
"/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 1917, in
_update_line_limits
path = line.get_path()
File "/usr/lib/python3/dist-packages/matplotlib/lines.py",
line 945, in get_path
self.recache()
File "/usr/lib/python3/dist-packages/matplotlib/lines.py",
line 640, in recache
x = _to_unmasked_float_array(xconv).ravel()
File
"/usr/lib/python3/dist-packages/matplotlib/cbook/__init__.py", line 1365,
in _to_unmasked_float_array
return np.asarray(x, float)
File
"/home/espi/.local/lib/python3.7/site-packages/numpy/core/_asarray.py",
line 83, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number, not
'real_datetime'
st 24. 11. 2021 v 20:20 odesílatel Radoslaw Guzinski <
***@***.***> napsal:
… Thanks for the kind words :) Are you using version 2.0.3 of the plugin?
Because I couldn't reproduce the problem with your example file. If yes,
then could you post the full exception trace.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYYKSI4NRUT2AMYWYTBDDUNVCIPANCNFSM5IVXJ5OA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I never set specific versions of Python packages but use whatever is provided by OSGeo4W. Currently that's matplotlib 3.3.2, numpy 1.20.2. nc_time_axis is bundled together with the plugin and it's version 1.2. Could you try the changes in https://github.com/DHI-GRAS/qgis-temporal-profile/tree/fix_netcdf_time |
hi Radoslaw,
I tried different strategy - on another computer, with Windows, I installed
new fresh QGIS and your tool.
I loaded my netcdf file and set Time and 'Use NetCDF...'.
then, when I click on a point it shows another error - that NetCDF4 cannot
be found:
2021-11-26T19:02:01 WARNING Traceback (most recent call last):
File
"C:\Users/earmla/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\temporalprofiletool\tools\doprofile.py",
line 276, in setXAxisSteps
import netCDF4
File
"C:\PROGRA~1/QGIS32~1.3/apps/qgis/./python\qgis\utils.py", line 799, in
_import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'netCDF4'
During handling of the above exception, another exception
occurred:
ok, so I suppose there are some links to also other modules that are not
distributed with the tool.
can you please check about this?
cheers!
Milan
pá 26. 11. 2021 v 10:15 odesílatel Radoslaw Guzinski <
***@***.***> napsal:
… I never set specific versions of Python packages but use whatever is
provided by OSGeo4W. Currently that's matplotlib 3.3.2, numpy 1.20.2.
nc_time_axis is bundled together with the plugin and it's version 1.2.
Could you try the changes in
https://github.com/DHI-GRAS/qgis-temporal-profile/tree/fix_netcdf_time
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYYKWABGWNI4YKLIDLVRTUN5M3DANCNFSM5IVXJ5OA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The only Python package bundled with the plugin is nc_time_axis because it's small and not installable through OSGeo4W. I work on Windows so all the other package (netCDF4, numpy, etc.) come from OSGeo4W. Did you have a chance to try the https://github.com/DHI-GRAS/qgis-temporal-profile/tree/fix_netcdf_time branch? |
right,
i see installation of NetCDF4 must be done through the 'Advanced' tab of
OSGeo4W, it is not in by default.
now, I don't know what versions OSGeo4W is using or will be using further
on, but my cftime version is 1.5.1 and your fix now gives error:
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/nc_time_axis/__init__.py",
line 288, in convert
ut = cftime.utime(cls.standard_unit,
calendar=first_value.calendar)
AttributeError: module 'cftime' has no attribute 'utime'
ok, this is because nc_time_axis 1.2 expects older cftime. I have updated
both to their latest versions but it then doesn't work, as your tool must
use the older v 1.2 - bound to old cftime v 1.0.x
so i have returned the correct versions back. but unfortunately it still
doesn't work (although at least the workaround by not using the time dim.,
and then using the time dim., this time works). the error message now is:
Traceback (most recent call last):
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/temporalprofileplugin.py",
line 176, in leftClicked
self.doubleClicked(point)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/temporalprofileplugin.py",
line 181, in doubleClicked
self.doprofile.calculatePointProfile(point, self.mdl,
self.plotlibrary)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/tools/doprofile.py",
line 117, in calculatePointProfile
PlottingTool().attachCurves(self.dockwidget, self.profiles,
model, library)
File
"/home/espi/.local/share/QGIS/QGIS3/profiles/default/python/plugins/temporalprofiletool/tools/plottingtool.py",
line 152, in attachCurves
wdg.plotWdg.figure.get_axes()[0].set_xlim([minimumValueX,
maximumValueX])
File
"/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 3241, in
set_xlim
left, right = mtransforms.nonsingular(left, right,
increasing=False)
File
"/usr/lib/python3/dist-packages/matplotlib/transforms.py", line 2889, in
nonsingular
if (not np.isfinite(vmin)) or (not np.isfinite(vmax)):
TypeError: ufunc 'isfinite' not supported for the input types,
and the inputs could not be safely coerced to any supported types according
to the casting rule ''safe''
so probably the minimumValueX and maximumValueX there should be numbers?
when i include print and type commands after line 151 in
tools/plottingtool.py, i see that:
minimumValueX: 2015-01-07 00:00:00
maximumValueX: 2021-07-16 00:00:00
<class 'cftime._cftime.real_datetime'>
any ideas?
po 29. 11. 2021 v 8:00 odesílatel Radoslaw Guzinski <
***@***.***> napsal:
… The only Python package bundled with the plugin is nc_time_axis because
it's small and not installable through OSGeo4W. I work on Windows so all
the other package (netCDF4, numpy, etc.) come from OSGeo4W.
Did you have a chance to try the
https://github.com/DHI-GRAS/qgis-temporal-profile/tree/fix_netcdf_time
branch?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYYKVQM2MVVXHOWGNWDU3UOMXIFANCNFSM5IVXJ5OA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi,
first of all - the tool is really useful. I want to recommend it as the primary time series viewer solution after our specific open-source tool.
please improve the viewing of nc files - there is probably a minor (annoying) bug - let me explain:
...
File "/home/espi/.local/lib/python3.7/site-packages/numpy/core/_asarray.py", line 83, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: float() argument must be a string or a number, not 'real_datetime'
My 'plot library' is matplotlib.
I assume this should be some quick-to-fix issue for you. I will then launch your tool for a global awareness (including NASA ;) )
cheers!
The text was updated successfully, but these errors were encountered: