Closed suraj44 closed 6 years ago
Hi,
You can try update the .radar.sqlite file by (obj = davitpy.pydarn.radar.updateRadars()). If that still does not work, try to download radars.dat and hdw.dat files if you do not have them locally or update them as suggested here: https://github.com/vtsuperdarn/davitpy/pull/300.
Even after setting the environment variables SD_RADAR and SD_HDWPATH to the local paths of the respective files, I get the following error.
I'm not sure why os.getenv('SD_HDWPATH')
in radInfoIo.py would return None after the environment variables are set.
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 None
ERROR:root:radarRead: cannot read None
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/davitpy-0.8-py2.7-linux-x86_64.egg/davitpy/pydarn/radar/radInfoIo.py", line 67, in radarRead
file_net = open(pathOpen, 'r')
TypeError: coercing to Unicode: need string or buffer, NoneType found
You may be getting this error because your computer cannot contact an appropriate internet server to get the latest radar.dat information. You can use a local file instead by setting the SD_RADAR environment variable to the location of a local copy of radar.dat.
Example, you might add a similar line to your .bashrc: export SD_RADAR=/home/username/tables/radar.dat
Also, make sure your SD_HDWPATH also points to the location of your hdw.dat files. You can get the latest hdw.dat files from https://github.com/vtsuperdarn/hdw.dat Example, you might add a similar line to your .bashrc: export SD_HDWPATH=/home/username/tables/hdw.dat/
ERROR:root:Could not update .radars.sqlite file with hdw.dat info
Can you see if you're access to port 27017 to sd-work9.ece.vt.edu is available with netcat? Something like:
nc -vz sd-work9.ece.vt.edu 27017
if this does not succeed, then the issue is you're not able to connect to the database. Sounds like there may be an issue with how you're setting the environment variables though.
When I run the netcat command, it says
Connection to sd-work9.ece.vt.edu 27017 port [tcp/*] succeeded!
but when I trying importing davitpy on python it says it can't. I figured out where I was going wrong in setting the environment variables though. Thanks for helping out!
On Thu, Mar 1, 2018 at 7:05 PM, Kevin Sterne notifications@github.com wrote:
Can you see if you're access to port 27017 to sd-work9.ece.vt.edu is available with netcat? Something like: nc -vz sd-work9.ece.vt.edu 27017 if this does not succeed, then the issue is you're not able to connect to the database. Sounds like there may be an issue with how you're setting the environment variables though.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vtsuperdarn/davitpy/issues/339#issuecomment-369593024, or mute the thread https://github.com/notifications/unsubscribe-auth/AbWyw5sdeu5f5opeToi3n2PlSelGtZQSks5tZ_k1gaJpZM4SSVvk .
-- Regards, Suraj
Hey Tushar,
I faced that same error as well but it has nothing to do with environment variables. When I ran the command while connected to my university's campus WiFi, I faced the error. But when I tried connecting using a mobile hotspot, it worked perfectly fine. Weird issue
On 5 Mar 2018 05:21, "Tushar Goel" notifications@github.com wrote:
hey there, when i run the command "nc -vz sd-work9.ece.vt.edu 27017" it shows nc: connect to sd-work9.ece.vt.edu http://sd-work9.ece.vt.edu port 27017 (tcp) failed: Connection timed out Is this an issue with the environment variables?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vtsuperdarn/davitpy/issues/339#issuecomment-370276130, or mute the thread https://github.com/notifications/unsubscribe-auth/AbWyw9RqkJ39b7SdpdNp75wJWcEHuwg1ks5tbH33gaJpZM4SSVvk .
It sounds like this was an issue with the ISP blocking certain ports. If you're satisfied here @suraj44, mind closing the issue?
I tried running the 'SuperDARN Data Plotting.ipynb' but I'm getting the following error: (I'm running Ubuntu 16.04)
I'm using Python 2.7.12 Is that an issue?
ERROR:root:/tmp/sd/.radars.sqlite not found Traceback (most recent call last): File "test1.py", line 12, in
figs = pydarn.plotting.rti.plot_rti(sTime, radar, eTime=eTime, bmnum=beam)
File "/usr/local/lib/python2.7/dist-packages/davitpy-0.8-py2.7-linux-x86_64.egg/davitpy/pydarn/plotting/rti.py", line 248, in plot_rti
fileName=fileName)
File "/usr/local/lib/python2.7/dist-packages/davitpy-0.8-py2.7-linux-x86_64.egg/davitpy/pydarn/sdio/radDataRead.py", line 174, in radDataOpen
stid=int(network().getRadarByCode(radcode).id),
File "/usr/local/lib/python2.7/dist-packages/davitpy-0.8-py2.7-linux-x86_64.egg/davitpy/pydarn/radar/radStruct.py", line 234, in getRadarByCode
radar = self.getRadarBy(code, by='code')
File "/usr/local/lib/python2.7/dist-packages/davitpy-0.8-py2.7-linux-x86_64.egg/davitpy/pydarn/radar/radStruct.py", line 261, in getRadarBy
for irad in xrange(self.nradar):
AttributeError: 'network' object has no attribute 'nradar'