Closed johncoxon closed 4 years ago
For anyone trying to work around this issue, here's what I did to get it working (on Ubuntu 16):
Download radar.dat from here: https://github.com/SuperDARN/rst/blob/master/tables/superdarn/radar.dat and put in ~/tables/radar.dat
Clone hdw.dat files from here: https://github.com/vtsuperdarn/hdw.dat and put in ~/tables/hwd.dat
Add these two lines to ~/.bashrc:
export SD_HDWPATH=/home/username/tables/hdw.dat/ export SD_RADAR=/home/username/tables/radar.dat
Restart terminal. It still gives me this error:
ERROR:root:Could not connect to remote DB: mongodb://sd_dbread:5d@sd-work9.ece.vt.edu:27017/radarInfo WARNING:root:Reading hdw.dat info from local files in /home/esther/tables/hdw.dat/
but it works fine.
It would be nice if there was a way to suppress the error, but it's nice to have it take less room!
Hey @johncoxon, just so you know, the solution to your problem was in the output you posted in this comment.
That being said, we should do better to document this known issue in the README and installation instructions. Long term, we are going to remove all the mongodb stuff.
It’s true I could have gone and installed the .dat file, and I tried, but I didn’t manage to find it, I suspect because I’m not at all part of the SuperDARN community. I was also trying to help you all isolate whatever the MongoDB bug is, but if it’s being removed I’ll stop trying (I’ve been poking it in my downtime).
On a broader tack, i only use Tsyganenko tracing and mapObj
, so it could be good to suppress the text above unless the user tries to actually use something that relies on hdw.dat?
Even better is to pull Tsyganenko out of davitpy and into it's own repository. It's not a SuperDARN specific thing so it doesn't need to be in a SuperDARN specific python package.
The reason why the error text gets printed, that is the reason you see the text about hdw.dat files, is that when you run import davitpy
the entire davitpy package is imported all at once.
Does every one of the modules in davitpy get imported all at once? Yes:
As you said, this isn't useful for those who only want to use a subset of davitpy. A potential fix is to remove all or some the import statements in all of the __init__.py
files.
As for the pymongo problem, this looks like an issue with the VT server running an old version of mongodb. The error you have reported is clear:
ConfigurationError: Server at sd-work9.ece.vt.edu:27017 reports wire version 0, but this version of PyMongo requires at least 2 (MongoDB 2.6).
@ksterne, what version of mongodb is running on sd-work9? Can this be updated easily?
Thanks for poking away at the code @johncoxon!
I suppose the question of having models in Davitpy/in separate repos comes down to a question of philosophy! I can see why it might be better to split them off, but it's nice having a module that has useful stuff like that all in one place. I think I'd want to keep using mapObj
(which is currently wowing colleagues with most excellent animations of AMPERE currents) though.
When I import the bits I use, I do from davitpy.models import tsyganenko
and from davitpy.utils import plotUtils
, so I suppose that's why I didn't expect the radar data to need to be there. To be honest though, once the mongodb bug is resolved (which looks promising!) it won't really matter either way.
Thanks for your help on this 😄 I am enjoying using Davitpy and I hope I'm more help than hindrance…
Upon import, I get the following error message:
As far as I can tell, this error is coming from a failure to connect to a MongoDB database on line 315 of
pydarn/radar/radInfoIo.py
, so I tried running lines 315 – 332 to see whether I could replicate the error in the console and see what happened.This seems to indicate that the computer can run everything except for
conn.server_info()
on line 317, but when I tried commenting that line out and importing davitpy in a new IPython session, I got the following, which seems to indicate that this isn't the whole story – but perhaps it's helpful?