[IOError] RHESSISummaryLightCurve

23 views
Skip to first unread message

Fernando Hidalgo

unread,
Jun 15, 2017, 2:55:06 PM6/15/17
to SunPy
I was running without problems the recipe :

from sunpy import lightcurve as lc
rhessi = lc.RHESSISummaryLightCurve.create('2012/06/01', '2012/06/05')
rhessi.peek() 

or

from sunpy.time import TimeRange
from sunpy import lightcurve as lc
rhessi = lc.RHESSISummaryLightCurve.create(TimeRange('2012/06/01', '2012/06/05'))
rhessi.peek() 

The followings lightcurves of SunPy run well: GOESLightCurve, EVELightCurve and GBMSummaryLightCurve

but to create a lightcurve from RHESSI in the last months appeared the following error:

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-18-07614f223753> in <module>()
      6 #ax.plot(rhessilc_1.data.index,rhessilc_1.data['100 - 300 keV'])
      7 from sunpy import lightcurve as lc
----> 8 rhessi = lc.RHESSISummaryLightCurve.create(TimeRange('2012/06/01', '2012/06/05'))
      9 rhessi.peek()

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\util\cond_dispatch.pyc in <lambda>(*args, **kwargs)
    211 
    212     def wrapper(self):
--> 213         return lambda *args, **kwargs: self(*args, **kwargs)
    214 
    215     def get_signatures(self, prefix="", start=0):

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\util\cond_dispatch.pyc in __call__(self, *args, **kwargs)
    194                 matched = True
    195                 if condition(*args, **kwargs):
--> 196                     return fun(*args, **kwargs)
    197         for fun, types in self.nones:
    198             if (matches_signature(fun, args, kwargs) and

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\util\cond_dispatch.pyc in <lambda>(cls, *args, **kwargs)
     87 def run_cls(name):
     88     """ run_cls("foo")(cls, *args, **kwargs) -> cls.foo(*args, **kwargs) """
---> 89     fun = lambda cls, *args, **kwargs: getattr(cls, name)(*args, **kwargs)
     90     fun.__name__ = str(name)
     91     fun.run_cls = True

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\lightcurve\lightcurve.pyc in from_timerange(cls, timerange, **kwargs)
    121         input to create method.
    122         """
--> 123         url = cls._get_url_for_date_range(timerange, **kwargs)
    124         filepath = cls._download(
    125             url, kwargs,

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\lightcurve\sources\rhessi.pyc in _get_url_for_date_range(*args, **kwargs)
    127         elif len(args) == 2:
    128             time_range = TimeRange(parse_time(args[0]), parse_time(args[1]))
--> 129         url = rhessi.get_obssum_filename(time_range)
    130         return url
    131 

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\instr\rhessi.pyc in get_obssum_filename(time_range)
    180     # need to download and inspect the dbase file to determine the filename
    181     # for the observing summary data
--> 182     f = get_obssumm_dbase_file(time_range)
    183     data_location = 'metadata/catalog/'
    184 

C:\Users\nandhos\Anaconda2\lib\site-packages\sunpy\instr\rhessi.pyc in get_obssumm_dbase_file(time_range)
     83     url = url_root + _time_range.start.strftime("hsi_obssumm_filedb_%Y%m.txt")
     84 
---> 85     f = urllib.request.urlretrieve(url)
     86 
     87     return f

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in urlretrieve(url, filename, reporthook, data, context)
     96     else:
     97         opener = _urlopener
---> 98     return opener.retrieve(url, filename, reporthook, data)
     99 def urlcleanup():
    100     if _urlopener:

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in retrieve(self, url, filename, reporthook, data)
    243             except IOError:
    244                 pass
--> 245         fp = self.open(url, data)
    246         try:
    247             headers = fp.info()

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in open(self, fullurl, data)
    211         try:
    212             if data is None:
--> 213                 return getattr(self, name)(url)
    214             else:
    215                 return getattr(self, name)(url, data)

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in open_http(self, url, data)
    362         else:
    363             if data is None:
--> 364                 return self.http_error(url, fp, errcode, errmsg, headers)
    365             else:
    366                 return self.http_error(url, fp, errcode, errmsg, headers, data)

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in http_error(self, url, fp, errcode, errmsg, headers, data)
    375             method = getattr(self, name)
    376             if data is None:
--> 377                 result = method(url, fp, errcode, errmsg, headers)
    378             else:
    379                 result = method(url, fp, errcode, errmsg, headers, data)

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in http_error_301(self, url, fp, errcode, errmsg, headers, data)
    671     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
    672         """Error 301 -- also relocated (permanently)."""
--> 673         return self.http_error_302(url, fp, errcode, errmsg, headers, data)
    674 
    675     def http_error_303(self, url, fp, errcode, errmsg, headers, data=None):

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in http_error_302(self, url, fp, errcode, errmsg, headers, data)
    640                             headers)
    641             result = self.redirect_internal(url, fp, errcode, errmsg,
--> 642                                             headers, data)
    643             return result
    644         finally:

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in redirect_internal(self, url, fp, errcode, errmsg, headers, data)
    667                           headers)
    668 
--> 669         return self.open(newurl)
    670 
    671     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in open(self, fullurl, data)
    211         try:
    212             if data is None:
--> 213                 return getattr(self, name)(url)
    214             else:
    215                 return getattr(self, name)(url, data)

C:\Users\nandhos\Anaconda2\lib\urllib.pyc in open_https(self, url, data)
    441             if realhost: h.putheader('Host', realhost)
    442             for args in self.addheaders: h.putheader(*args)
--> 443             h.endheaders(data)
    444             errcode, errmsg, headers = h.getreply()
    445             fp = h.getfile()

C:\Users\nandhos\Anaconda2\lib\httplib.pyc in endheaders(self, message_body)
   1036         else:
   1037             raise CannotSendHeader()
-> 1038         self._send_output(message_body)
   1039 
   1040     def request(self, method, url, body=None, headers={}):

C:\Users\nandhos\Anaconda2\lib\httplib.pyc in _send_output(self, message_body)
    880             msg += message_body
    881             message_body = None
--> 882         self.send(msg)
    883         if message_body is not None:
    884             #message_body was not a string (i.e. it is a file) and

C:\Users\nandhos\Anaconda2\lib\httplib.pyc in send(self, data)
    842         if self.sock is None:
    843             if self.auto_open:
--> 844                 self.connect()
    845             else:
    846                 raise NotConnected()

C:\Users\nandhos\Anaconda2\lib\httplib.pyc in connect(self)
   1261 
   1262             self.sock = self._context.wrap_socket(self.sock,
-> 1263                                                   server_hostname=server_hostname)
   1264 
   1265     __all__.append("HTTPSConnection")

C:\Users\nandhos\Anaconda2\lib\ssl.pyc in wrap_socket(self, sock, server_side, do_handshake_on_connect, suppress_ragged_eofs, server_hostname)
    361                          suppress_ragged_eofs=suppress_ragged_eofs,
    362                          server_hostname=server_hostname,
--> 363                          _context=self)
    364 
    365     def set_npn_protocols(self, npn_protocols):

C:\Users\nandhos\Anaconda2\lib\ssl.pyc in __init__(self, sock, keyfile, certfile, server_side, cert_reqs, ssl_version, ca_certs, do_handshake_on_connect, family, type, proto, fileno, suppress_ragged_eofs, npn_protocols, ciphers, server_hostname, _context)
    609                         # non-blocking
    610                         raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
--> 611                     self.do_handshake()
    612 
    613             except (OSError, ValueError):

C:\Users\nandhos\Anaconda2\lib\ssl.pyc in do_handshake(self, block)
    838             if timeout == 0.0 and block:
    839                 self.settimeout(None)
--> 840             self._sslobj.do_handshake()
    841         finally:
    842             self.settimeout(timeout)

IOError: [Errno socket error] [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:661)





Follow the system information after
import sunpy
sunpy.util.system_info()
==========================================================
 SunPy Installation Information

==========================================================

###########
 General
###########
Time : Thursday, 15. June 2017 06:37PM UT
System : Windows
Processor : Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
Arch : 64bit
SunPy : 0.7.8
SunPy_git : 791b9f43a9a98da3d632c4ce85dc08806cf59b9b
OS: Windows 10 10.0.15063 (Intel64 Family 6 Model 69 Stepping 1, GenuineIntel)


###########
 Required Libraries 
###########
Python: 2.7.13
NumPy: 1.11.0
SciPy: 0.17.0
matplotlib: 2.0.2
Astropy: 1.3.3
Pandas: 0.20.2


###########
 Recommended Libraries 
###########
beautifulsoup: 4.6.0
PyQt: NOT INSTALLED
SUDS: 0.6
Sqlalchemy: 1.1.9
Requests: 2.14.2

Stuart Mumford

unread,
Jun 19, 2017, 3:59:36 AM6/19/17
to su...@googlegroups.com

Hi,

I don't seem to be able to reproduce your error, however I don't have a windows box on which to test it.

It looks like the error is a result of NASA changing all its servers to HTTPS.

I can't test it, but you might find this patch fixed your problem: https://github.com/sunpy/sunpy/pull/2144

Stuart

--
You received this message because you are subscribed to the Google Groups "SunPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.
To post to this group, send email to su...@googlegroups.com.
Visit this group at https://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages