[obspy-users] UTCdate time

izgi at itu.edu.tr izgi at itu.edu.tr
Fri Jun 8 12:54:09 CEST 2018


Hi everyone,
Before I start I should say that I am a newbie.
I am using lots of scripts which were giving perfect results one or  
two months ago. But now despite I didn't change anything in the  
script, I am getting the following traceback.
Further help would be appreciated.

AttributeError                            Traceback (most recent call last)
/run/media/anatolia/Elements/Scattering_PROJECT/qopen_2016_12_26/DANA_NAF_POYRAZ/Qopen_utils_with2segments/plotting_01_plot_example_fits.py in  
<module>()
      424  
#==============================================================================
      425 ax = plt.subplot(gs[3:4,0:1])
--> 426 plotting(tup1,0,40,'event 1',color_ev1,'0.75 Hz')
      427 ax.set_xlim(xmin=xmin,xmax=xmax)
      428 ax.set_ylim(ymin=ymin,ymax=ymax)

/run/media/anatolia/Elements/Scattering_PROJECT/qopen_2016_12_26/DANA_NAF_POYRAZ/Qopen_utils_with2segments/plotting_01_plot_example_fits.py in plotting(tup, index, smooth, ev_num, color,  
freq)
      102         evid, station = get_pair(energy)
      103         r = st.distance
--> 104         t = _get_times(energy) + r / v0 - (st.sonset - st.origintime)
      105          
#--------------------------------------------------------------------------
      106         G_ = Gsmooth(G_func, r, t, v0, g0, smooth=0.1,  
smooth_window='bartlett')

/run/media/anatolia/Elements/Scattering_PROJECT/qopen_2016_12_26/DANA_NAF_POYRAZ/Qopen_utils_with2segments/plotting_01_plot_example_fits.py in  
_get_times(tr)
       73  
#------------------------------------------------------------------------------
       74 def _get_times(tr):
---> 75     t0 = tr.stats.starttime - tr.stats.origintime
       76     return np.arange(len(tr)) * tr.stats.delta + t0
       77  
#------------------------------------------------------------------------------

/home/anatolia/UTILS/anaconda2/lib/python2.7/site-packages/obspy/core/utcdatetime.pyc in __sub__(self,  
value)
      939         """
      940         if isinstance(value, UTCDateTime):
--> 941             return round((self._ns - value._ns) / 1e9,  
self.__precision)
      942         elif isinstance(value, datetime.timedelta):
      943             # see datetime.timedelta.total_seconds

/home/anatolia/UTILS/anaconda2/lib/python2.7/site-packages/obspy/core/utcdatetime.pyc in  
_get_ns(self)
      381
      382     def _get_ns(self):
--> 383         return self.__ns
      384
      385     def _set_ns(self, value):

AttributeError: 'UTCDateTime' object has no attribute '_UTCDateTime__ns'




More information about the obspy-users mailing list