Re: [MSNoise] MSNoise stack error

2016-09-20 Thread Thomas Lecocq

Hi Chris,

The design of MSNoise is that you do the moving stack of 60 days 
(=smoothing over the last 59 days) and compare that to a REF. This is 
achieved with "mov stack"= "msnoise stack -m". If you want to make the 
step stacking , i.e. only exporting the stack for each nth day, you need 
to run the "msnoise stack -s" command, but it's really not well 
documented and implemented, e.g. the dvv plots will probably fail.


The fact that the first 60 days are the same are a choice that goes back 
to the orginal codes I implemented, assuming the stack should be the 
same as long as the number of days of movstacks are not available. It's 
a bad implementation and I really would like to change this in the future.


The "-i " command is only useful if you want to re-stack data 
computed more than 1 day ago.


Let me know how it goes

Thomas


On 17/09/2016 11:49, 蒋承孜 wrote:

Hello,


I came across a stack error when using MSNoise and could not find the solution 
in the documentation. 
Ihavefinishedthecomputationofthecross-correlationsformydataandnowIwouldliketo 
do60-daystack with10-dayintervals. However, itreturned 
wrongresultswhenItriedtorun 'msnoisestack -s -i999'. Forinstance, 
Iwouldliketostackcross-correlationfunctionscomputedfrom2009-09-10to2011-07-02. 
Theresulton2009-09-10wascorrect, buttheremainingstacks were exactthesame 
with2009-09-10. Theprocesswas pastedbelow. Iamnotsurewhatiswrong. HowcanI 
resolveit?


Thankyouinadvance,


Chris Chiang
Undergraduate Student
School of Geophysics and Information Technology
China University of Geosciences, Beijing
29 Xueyuan Road, Haidian District, Beijing, China








PROCESS:


(E:\Anaconda\Anaconda2) E:\Data\Mountain\filter0.1-0.2>msnoisestack -s -i999
LetsSTACK !
2016-09-1610:14:40 [DEBUG] Startingthestepstack
[]
2016-09-1610:14:40 [DEBUG] ProcessingYP_NE41:YP_NE64-ZZ-1
2016-09-1610:14:40 [DEBUG] Found650updateddays
2016-09-1610:14:40 [DEBUG] NewDataforYP_NE41:YP_NE64-ZZ-1
2016-09-1610:14:44 [DEBUG] YP_NE41_YP_NE642009-09-10 [2009-09-10 - 2009-11-08] 
(60daystack)
e:\anaconda\anaconda2\lib\site-packages\obspy\io\sac\util.py:371: UserWarning: 
Oldheaderhasinvalidreftime.
   warnings.warn(msg)
2016-09-1610:14:44 [DEBUG] YP_NE41_YP_NE642009-11-09 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:44 [DEBUG] YP_NE41_YP_NE642010-01-08 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:45 [DEBUG] YP_NE41_YP_NE642010-03-09 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:45 [DEBUG] YP_NE41_YP_NE642010-05-08 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:45 [DEBUG] YP_NE41_YP_NE642010-07-07 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:45 [DEBUG] YP_NE41_YP_NE642010-09-05 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:46 [DEBUG] YP_NE41_YP_NE642010-11-04 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:46 [DEBUG] YP_NE41_YP_NE642011-01-03 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:46 [DEBUG] YP_NE41_YP_NE642011-03-04 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:46 [DEBUG] YP_NE41_YP_NE642011-05-03 [2009-09-10 - 2009-11-08] 
(60daystack)
2016-09-1610:14:46 [DEBUG] YP_NE41_YP_NE642011-07-02 [2009-09-10 - 2009-11-08] 
(60daystack
___
MSNoise mailing list
MSNoise@mailman-as.oma.be
http://mailman-as.oma.be/mailman/listinfo/msnoise


___
MSNoise mailing list
MSNoise@mailman-as.oma.be
http://mailman-as.oma.be/mailman/listinfo/msnoise


Re: [MSNoise] msnoise stack error

2016-08-25 Thread Crowder, Emily
Hi Tom,


Thanks for the advice. I think the problems might be there because I upgraded 
my Ubuntu to 16.04. I tried adding it to the 'my.cnf' file, I'll copy that file 
below:


#

# The MySQL database server configuration file.

#

# You can copy this to one of:

# - "/etc/mysql/my.cnf" to set global options,

# - "~/.my.cnf" to set user-specific options.

#

# One can use all long options that the program supports.

# Run program with --help to get a list of available options and with

# --print-defaults to see which it would actually understand and use.

#

# For explanations see

# http://dev.mysql.com/doc/mysql/en/server-system-variables.html


#

# * IMPORTANT: Additional settings that can override those from this file!

#   The files must end with '.cnf', otherwise they'll be ignored.

#


!includedir /etc/mysql/conf.d/

!includedir /etc/mysql/mysql.conf.d/


sql_mode=TRADITIONAL



Is that the correct way to add it? Because when I try to do 'sudo service mysql 
start' (after stopping it) I get the following error:


Job for mysql.service failed because the control process exited with error 
code. See "systemctl status mysql.service" and "journalctl -xe" for details.



Emily



~

Emily Crowder MSc BSc
PhD Student
School of Geosciences
University of Aberdeen
Aberdeen AB24 3UE
Scotland
Em: emily.crow...@abdn.ac.uk

~


From: msnoise-boun...@mailman-as.oma.be <msnoise-boun...@mailman-as.oma.be> on 
behalf of Thomas Lecocq <thomas.lec...@oma.be>
Sent: 25 August 2016 15:15:17
To: msnoise@mailman-as.oma.be
Subject: Re: [MSNoise] msnoise stack error

Hi Emily,

This is an issue with the latest MySQL release(s), you have to edit the
file my.cnf on your system and edit/add the sql_mode parameter:

sql_mode=TRADITIONAL


my.cnf is the general MySQL configuration file, usually located in one
of these:

  * /etc/my.cnf
  * /etc/mysql/my.cnf
  * $MYSQL_HOME/my.cnf
  * [datadir]/my.cnf
  * ~/.my.cnf

you'll need to restart mysqld after the change (sudo service mysqld restart)

HTH

Tom



Le 25/08/2016 à 16:07, Crowder, Emily a écrit :
> Hello,
>
>
> I have successfully run 'msnoise compute_cc' for my data so that I now have a 
> file of 1 day long cross-correlations. I would now like to stack them for the 
> whole time period (~2 years). However, when I try to run 'msnoise stack -r' 
> it fails and I get an error message. I have pasted this below. Would you be 
> able to shed some light onto it? How can I resolve this?
>
>
> Thanks in advance,
>
>
> Emily
>
>
> root@COPS-023603-L:/home/rpgsbs/r01ec15/Documents/BASS_DATA/sorted# msnoise 
> stack -r
>
> Lets STACK !
>
> 2016-08-25 15:02:55 [DEBUG] Starting the ref stack
>
> []
>
> 2016-08-25 15:02:55 [DEBUG] Processing BA_BA01:BA_BA02-TT-1
>
> Traceback (most recent call last):
>
>File "/root/anaconda2/bin/msnoise", line 11, in 
>
>  sys.exit(run())
>
>File 
> "/root/anaconda2/lib/python2.7/site-packages/msnoise/scripts/msnoise.py", 
> line 614, in run
>
>  cli(obj={})
>
>File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 
> 716, in __call__
>
>  return self.main(*args, **kwargs)
>
>File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 
> 696, in main
>
>  rv = self.invoke(ctx)
>
>File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 
> 1060, in invoke
>
>  return _process_result(sub_ctx.command.invoke(sub_ctx))
>
>File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 
> 889, in invoke
>
>  return ctx.invoke(self.callback, **ctx.params)
>
>File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 
> 534, in invoke
>
>  return callback(*args, **kwargs)
>
>File 
> "/root/anaconda2/lib/python2.7/site-packages/msnoise/scripts/msnoise.py", 
> line 301, in stack
>
>  main('ref', interval)
>
>File "/root/anaconda2/lib/python2.7/site-packages/msnoise/s04stack.py", 
> line 203, in main
>
>  updated_days = updated_days_for_dates(db, start, end, pair.replace('_', 
> '.'), jobtype='CC', 
> interval=datetime.timedelta(days=interval),returndays=True)
>
>File "/root/anaconda2/lib/python2.7/site-packages/msnoise/api.py", line 
> 1189, in updated_days_for_dates
>
>  days = session.query(Job).filter(Job.pair == pair).filter(Job.day >= 
> date1).filter(Job.day <= date2).filter(Job.jobtype == 
> jobtype).filter(Job.lastmod >= 
> lastmod).group_by(Job.day).order_by(Job.day).all()
>
>File 
> "/root/anacon

Re: [MSNoise] msnoise stack error

2016-08-25 Thread Thomas Lecocq

Hi Emily,

This is an issue with the latest MySQL release(s), you have to edit the 
file my.cnf on your system and edit/add the sql_mode parameter:


sql_mode=TRADITIONAL


my.cnf is the general MySQL configuration file, usually located in one 
of these:


 * /etc/my.cnf
 * /etc/mysql/my.cnf
 * $MYSQL_HOME/my.cnf
 * [datadir]/my.cnf
 * ~/.my.cnf

you'll need to restart mysqld after the change (sudo service mysqld restart)

HTH

Tom



Le 25/08/2016 à 16:07, Crowder, Emily a écrit :

Hello,


I have successfully run 'msnoise compute_cc' for my data so that I now have a 
file of 1 day long cross-correlations. I would now like to stack them for the 
whole time period (~2 years). However, when I try to run 'msnoise stack -r' it 
fails and I get an error message. I have pasted this below. Would you be able 
to shed some light onto it? How can I resolve this?


Thanks in advance,


Emily


root@COPS-023603-L:/home/rpgsbs/r01ec15/Documents/BASS_DATA/sorted# msnoise 
stack -r

Lets STACK !

2016-08-25 15:02:55 [DEBUG] Starting the ref stack

[]

2016-08-25 15:02:55 [DEBUG] Processing BA_BA01:BA_BA02-TT-1

Traceback (most recent call last):

   File "/root/anaconda2/bin/msnoise", line 11, in 

 sys.exit(run())

   File 
"/root/anaconda2/lib/python2.7/site-packages/msnoise/scripts/msnoise.py", line 
614, in run

 cli(obj={})

   File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 716, 
in __call__

 return self.main(*args, **kwargs)

   File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 696, 
in main

 rv = self.invoke(ctx)

   File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 1060, 
in invoke

 return _process_result(sub_ctx.command.invoke(sub_ctx))

   File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 889, 
in invoke

 return ctx.invoke(self.callback, **ctx.params)

   File "/root/anaconda2/lib/python2.7/site-packages/click/core.py", line 534, 
in invoke

 return callback(*args, **kwargs)

   File 
"/root/anaconda2/lib/python2.7/site-packages/msnoise/scripts/msnoise.py", line 
301, in stack

 main('ref', interval)

   File "/root/anaconda2/lib/python2.7/site-packages/msnoise/s04stack.py", line 
203, in main

 updated_days = updated_days_for_dates(db, start, end, pair.replace('_', 
'.'), jobtype='CC', interval=datetime.timedelta(days=interval),returndays=True)

   File "/root/anaconda2/lib/python2.7/site-packages/msnoise/api.py", line 
1189, in updated_days_for_dates

 days = session.query(Job).filter(Job.pair == pair).filter(Job.day >= 
date1).filter(Job.day <= date2).filter(Job.jobtype == jobtype).filter(Job.lastmod 
>= lastmod).group_by(Job.day).order_by(Job.day).all()

   File "/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", 
line 2613, in all

 return list(self)

   File "/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", 
line 2761, in __iter__

 return self._execute_and_instances(context)

   File "/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/orm/query.py", 
line 2776, in _execute_and_instances

 result = conn.execute(querycontext.statement, self._params)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
914, in execute

 return meth(self, multiparams, params)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 
323, in _execute_on_connection

 return connection._execute_clauseelement(self, multiparams, params)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1010, in _execute_clauseelement

 compiled_sql, distilled_params

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1146, in _execute_context

 context)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1341, in _handle_dbapi_exception

 exc_info

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 
202, in raise_from_cause

 reraise(type(exception), exception, tb=exc_tb, cause=cause)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 
1139, in _execute_context

 context)

   File 
"/root/anaconda2/lib/python2.7/site-packages/sqlalchemy/engine/default.py", 
line 450, in do_execute

 cursor.execute(statement, parameters)

   File "/root/anaconda2/lib/python2.7/site-packages/pymysql/cursors.py", line 
161, in execute

 result = self._query(query)

   File "/root/anaconda2/lib/python2.7/site-packages/pymysql/cursors.py", line 
317, in _query

 conn.query(q)

   File "/root/anaconda2/lib/python2.7/site-packages/pymysql/connections.py", 
line 837, in query

 self._affected_rows = self._read_query_result(unbuffered=unbuffered)

   File "/root/anaconda2/lib/python2.7/site-packages/pymysql/connections.py", 
line 1021, in _read_query_result

 result.read()

   File