[MSNoise] Problem with s07plot_dtt.py

Thomas Lecocq thomas.lecocq at oma.be
Thu Oct 9 15:42:07 UTC 2014


Oscar,

Glad this works !

You see the ALL line (red) = dv/v of the average network and the green 
line, which is mean of all dv/v (1 per pair). See the paper for the 
explanation.

To export a specific pair, it's fairly easy when you know python but I 
admit it's not for beginners. I'll try to provide an "export tool" soon !

regards,

Thomas

Le 09/10/2014 17:38, Oscar Alberto Castro Artola a écrit :
> Thomas,
>
> thank you for your answer! I did remove the line 3 and now it is working.
> The plot shows five time series of dv/v in % (one for each stack:
> 1,3,5,10,20), but I don't know which station is using or what happens if I
> only need the plot for an specific pair of stations? I have 8 stations
> (only BHZ component) and have defined 5 *mov_stack *windows (1,3,5,10,20).
> Thank your for time and help!
>
> Oscar
>
> On Thu, Oct 9, 2014 at 2:58 AM, Thomas Lecocq <thomas.lecocq at oma.be> wrote:
>
>> Oscar,
>>
>> 1) remove line 3 from the code (https://github.com/ROBelgium/
>> MSNoise/blob/1.2.5/s07plot_dtt.py#L3)
>> 2) do you have more than 1 pair (2 stations) in the processing ?
>>
>> Thomas
>>
>> Le 08/10/2014 02:23, Aurélien Mordret a écrit :
>>
>>   Hi,
>>> Is the file containing the dtt results OK? Does it have results in there?
>>>
>>> Actually, I don't use the plotting function, I use my own, GMT or Matlab
>>> codes to plot the results, so I may not be able to help you further than
>>> that...
>>>
>>> Cheers,
>>> Aurelien
>>>
>>> 2014-10-07 20:12 GMT-04:00 Oscar Alberto Castro Artola <
>>> oscar.cas.art at gmail.com>:
>>>
>>>   Hi Aurelien,
>>>> thank you very much for your help! It actually worked but with an empty
>>>> figure window. I tried to assign a name to *dttname* but with the same
>>>> result.
>>>>
>>>> Any idea?
>>>>
>>>> Thanks!
>>>>
>>>> Oscar
>>>>
>>>> On Tue, Oct 7, 2014 at 5:53 PM, Aurélien Mordret <mordret at mit.edu>
>>>> wrote:
>>>>
>>>>   Hi Oscar,
>>>>> It seems to me that you miss the wxPython package. Try to install it.
>>>>>
>>>> That
>>>>
>>>>> should fix the mpl.use('WxAgg') problem.
>>>>>
>>>>> A quick dirty fix for your plot problem would be to replace line 123 by
>>>>> plt.savefig('dtt_allmovstacksNEW.png', dpi=300)
>>>>>
>>>>> And wait for advice from Thomas for a better idea.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Aurelien
>>>>>
>>>>>
>>>>> 2014-10-07 18:26 GMT-04:00 Oscar Alberto Castro Artola <
>>>>> oscar.cas.art at gmail.com>:
>>>>>
>>>>>   Aurelien,
>>>>>> thank you for your answer! I did upgrade matplotlib to 1.4.0 but the
>>>>>>
>>>>> error
>>>>>
>>>>>> message is still there. I tried to comment the line #3 in
>>>>>>
>>>>> *s07plot_dtt.py*
>>>>>
>>>>>> (mpl.use('WxAgg')) and got this error:
>>>>>>
>>>>>> *oscar at terminus:~/Doctorado/TI_2/sweet_noise$ py s07plot_dtt.py *
>>>>>>
>>>>>>
>>>>>>   */home/oscar/bin/python/anaconda/lib/python2.7/site-
>>>> packages/setuptools-3.6-py2.7.egg/pkg_resources.py:1045:
>>>>
>>>>> UserWarning: /home/oscar/.python-eggs is writable by group/others and
>>>>>> vulnerable to attack when used with get_resource_filename. Consider a
>>>>>>
>>>>> more
>>>>>
>>>>>> secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE
>>>>>> environment variable).*
>>>>>> *Traceback (most recent call last):*
>>>>>> *  File "s07plot_dtt.py", line 123, in <module>*
>>>>>> *    plt.savefig('dtt_allmovstacksNEW_%s.png' % dttname, dpi=300)*
>>>>>> *NameError: global name 'dttname' is not defined*
>>>>>>
>>>>>> I would apreciate any help! Thanks!
>>>>>>
>>>>>> Oscar
>>>>>>
>>>>>> On Tue, Oct 7, 2014 at 11:25 AM, Aurélien Mordret <mordret at mit.edu>
>>>>>>
>>>>> wrote:
>>>>>
>>>>>> Hi Oscar,
>>>>>>> I'm not very familiar with Python either but it seems that something
>>>>>>>
>>>>>> is
>>>>> wrong with matplotlib package.
>>>>>>> You can try to upgrade it...
>>>>>>>
>>>>>>>    easy_install --upgrade matplotlib
>>>>>>>
>>>>>>> Aurelien.
>>>>>>>
>>>>>>> 2014-10-07 12:19 GMT-04:00 Oscar Alberto Castro Artola <
>>>>>>> oscar.cas.art at gmail.com>:
>>>>>>>
>>>>>>>   Hi,
>>>>>>>> I have just updated to 1.2.5 and tried to run *s07plot_dtt.py
>>>>>>>>
>>>>>>> *(again
>>>>> on
>>>>>>> both PCs) and I got this error message:
>>>>>>>> oscar at terminus:~/msnoise_sismo$ py s07plot_dtt.py
>>>>>>>> Traceback (most recent call last):
>>>>>>>>     File "s07plot_dtt.py", line 13, in <module>
>>>>>>>>       import matplotlib.pyplot as plt
>>>>>>>>     File
>>>>>>>>
>>>>>>>>
>>>>>>>>   "/home/oscar/bin/python/anaconda/lib/python2.7/site-
>>>> packages/matplotlib/pyplot.py",
>>>>
>>>>> line 98, in <module>
>>>>>>>>       _backend_mod, new_figure_manager, draw_if_interactive, _show =
>>>>>>>> pylab_setup()
>>>>>>>>     File
>>>>>>>>
>>>>>>>>
>>>>>>>>   "/home/oscar/bin/python/anaconda/lib/python2.7/site-
>>>> packages/matplotlib/backends/__init__.py",
>>>>
>>>>> line 28, in pylab_setup
>>>>>>>>       globals(),locals(),[backend_name],0)
>>>>>>>>     File
>>>>>>>>
>>>>>>>>
>>>>>>>>   "/home/oscar/bin/python/anaconda/lib/python2.7/site-
>>>> packages/matplotlib/backends/backend_wxagg.py",
>>>>
>>>>> line 6, in <module>
>>>>>>>>       import backend_wx    # already uses
>>>>>>>>
>>>>>>> wxversion.ensureMinimal('2.8')
>>>>>>     File
>>>>>>>>
>>>>>>>>   "/home/oscar/bin/python/anaconda/lib/python2.7/site-
>>>> packages/matplotlib/backends/backend_wx.py",
>>>>
>>>>> line 53, in <module>
>>>>>>>>       raise ImportError(missingwxversion)
>>>>>>>> ImportError: Matplotlib backend_wx and backend_wxagg require
>>>>>>>>
>>>>>>> wxversion,
>>>>>> which was not found.
>>>>>>>> Please help!!!!!
>>>>>>>>
>>>>>>>> Oscar
>>>>>>>> _______________________________________________
>>>>>>>> MSNoise mailing list
>>>>>>>> MSNoise at mailman-as.oma.be
>>>>>>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> ==========================
>>>>>>>
>>>>>>> Aurelien Mordret
>>>>>>>
>>>>>>> Postdoctoral fellow
>>>>>>> Department of Earth, Atmospheric and Planetary Sciences
>>>>>>> Massachusetts Institute of Technology
>>>>>>> 54-526
>>>>>>> Cambridge, MA  02139-4307
>>>>>>> e-mail: mordret at mit.edu
>>>>>>> web: http://web.mit.edu/mordret/www
>>>>>>> _______________________________________________
>>>>>>> MSNoise mailing list
>>>>>>> MSNoise at mailman-as.oma.be
>>>>>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>>>>>>
>>>>>>>
>>>>>>>   _______________________________________________
>>>>>> MSNoise mailing list
>>>>>> MSNoise at mailman-as.oma.be
>>>>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>>>>>
>>>>>>
>>>>> --
>>>>> ==========================
>>>>>
>>>>> Aurelien Mordret
>>>>>
>>>>> Postdoctoral fellow
>>>>> Department of Earth, Atmospheric and Planetary Sciences
>>>>> Massachusetts Institute of Technology
>>>>> 54-526
>>>>> Cambridge, MA  02139-4307
>>>>> e-mail: mordret at mit.edu
>>>>> web: http://web.mit.edu/mordret/www
>>>>> _______________________________________________
>>>>> MSNoise mailing list
>>>>> MSNoise at mailman-as.oma.be
>>>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>>>>
>>>>>   _______________________________________________
>>>> MSNoise mailing list
>>>> MSNoise at mailman-as.oma.be
>>>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>>>
>>>>
>>>
>> _______________________________________________
>> MSNoise mailing list
>> MSNoise at mailman-as.oma.be
>> http://mailman-as.oma.be/mailman/listinfo/msnoise
>>
> _______________________________________________
> MSNoise mailing list
> MSNoise at mailman-as.oma.be
> http://mailman-as.oma.be/mailman/listinfo/msnoise



More information about the MSNoise mailing list