hashpy icon indicating copy to clipboard operation
hashpy copied to clipboard

hashpy with obspy

Open angelcalayag opened this issue 10 years ago • 1 comments

Hi, I was trying to use hashpy with an input file from obspy and ran into an error below.

Traceback (most recent call last):
  File "hashpyusage.py", line 23, in <module>
    hp.input(event, format="OBSPY")
  File "/Users/user/anaconda/lib/python2.7/site-packages/hashpy/hashpype.py", line 297, in input
    inputter(self, data, *args, **kwargs)
  File "/Users/user/anaconda/lib/python2.7/site-packages/hashpy/io/core.py", line 82, in __call__
    return self._input(*args, **kwargs)
  File "/Users/user/anaconda/lib/python2.7/site-packages/hashpy/io/obspyIO.py", line 31, in inputOBSPY
    hp.tstamp = _o.time.timestamp
AttributeError: 'NoneType' object has no attribute 'time'

I'm running the usage example code Mark wrote here: https://github.com/markcwill/hashpy under Input/Output.

Has anyone encountered this before?

angelcalayag avatar May 03 '15 17:05 angelcalayag

Sorry, for some reason, this got lost in my notifications. Looks like the origin you want to run HASH on is not set as preferred? I will add the option to take the first origin in Event.origins if there is no preferred one, but IMHO always better to specify...

markcwill avatar Jan 14 '16 22:01 markcwill