megies / obspyck

ObsPyck is a GUI application that is intended to cover the tasks in a standard analysis workflow for seismic events in seismological observatory practice.
https://github.com/megies/obspyck/wiki
GNU General Public License v2.0
61 stars 32 forks source link

NLLoc running #85

Open rcabdia opened 5 years ago

rcabdia commented 5 years ago

From I've read till now is that previously to run FocMec to calculate the Focal Mechanism, I need to locate the epicenter with NLLoc.

Because I've read that might be there will be problems with Mac I've moved to a Linux machine. In this email, I write a complete description of the architecture folders that I followed to run Nlloc but unfortunately something wrong happened. I've tried to be the most clear with my issue as possible for not making you waste any time.

Right now I have this installation scheme

/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck

in this folder I've created the subfolder plugins in which I've created

/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/focmec /home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/hyp_2000 /home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/nlloc

Inside the ./nlloc there are the typical executable files NLLoc, Grid2Time and so on....

Now, to run my example, I've created in my desktop a folder named obspyck with this architecture home/Escritorio/obspyck/nlloc

inside the obspyck/nlloc folder there are the waveforms, the file.cfg and I've also created a symbolic link NLLoc ---> NLLocLinux64bit

following the issue #11

For the output home/Escritorio/obspyck/nlloc/loc1

For the travel times home/Escritorio/obspyck/nlloc/time **[layer.P.sta.buf,layer.P.sta.hdr,layer.S.sta.buf,layer.S.sta.buf]

And the run/control file named locate_BY.nlloc in the previous folder

home/Escritorio/obspyck/locate_BY.nlloc which is attached in this email and the LOCFILES line is

LOCFILES ./nlloc.obs NLLOC_OBS ./time/layer ./loc1 From the #issue11 I guess that nlloc.obs is created after pick the waveforms and saved in the folder from Ive run obspyck//in my case home/Escritorio/obspyck/nlloc. I ve also guessed that obspyck always look for the nlloc control file inside locate_BY.nlloc.

After this configuration, I0ve run successfully obspyck and I picked some waveforms but when I run do_nlloc, obspyck cannot find nlloc. I attached the log error file.

I forget mention you that moreover NLLoc is also in the path of my computer, I thought that everything is right but I missed in some point and I am stack,

Please could anyone log2.txt

example_cfg.txt locate_BY.nlloc.txt

guide me to find a way-out.

megies commented 5 years ago

Please try to make use of github markdown, it's so hard to read an unformatted issue report, see https://help.github.com/categories/writing-on-github/.

Please run obspyck and post a directory listing of the used temporary directory (directory path should be printed on console).

rcabdia commented 5 years ago

Hello T.Megies, sorry for markdown, I didn't know it.

do you mean..... When I run ObsPyck

(obspyck_test) sysop@sysop-HP-ProDesk-600-G1-SFF:~/Escritorio/obspyck/nlloc$ obspyck -c example.cfg -t 2016-01-03T06:05:00 -d 240 HHZ

Running ObsPyck version 0.5.1 (location: /home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/obspyck.pyc) using config file: example.cfg

megies commented 5 years ago

obspyck show something like this during startup:

Using temporary directory: /tmp/obspyck-bPVgDF

Contents of your plugin directory get copied there, so this has to contain everything needed for NLLOC. Please list the contents of a temp directory in your case.

rcabdia commented 5 years ago

Hello Tobias,

I've been working with obspyck the last days. Finally I was able to run NLLoc without problems. Thank you very much for your tips, I didn't realized that everything is copied to a temp folder in the root directory. Some issues,

1) When I write the location file.xml, the coordinates of the location are different from the location of >the file .hyp. (very strange) I can imagine that the problem comes from the config file (it is attached). it >also is shown when I plot the map, the wrong location. it could be because of the transformation >"TRANS SIMPLE" of the control file? may be because it can be read properly the lat long and depth >from the file.hyp.

2) Something I've noticed is that when obspyck write the observation file "nlloc.obs", it does not >include the polarities U, D (is attached also)

3) I've checked that apart from the travel times time.buf, it is also saved angle.buf for the P and S wave

4) Every station has attach the dateless.

5) After this step I run FocMec. **I follow the structure and the control files from the issue #12

it create properly the polarities (I do not understand How because in the nlloc.obs does not appear.) But the program is stack in an error that I am not able to correct.

Hope you can help with this information. Please do not hesitate if you need something else to solve ALL of files with the process I followed are attached, Sorry I had to write everything with the extension .txt to be able to attach the files of the process.

directory.txt example.cfg.txt focmec.dat.txt focmec.P_SH_SV.stdin.txt focmec.P_SH.stdin.txt focmec.P_SV.stdin.txt focmec.P.stdin.txt log.txt nlloc.hyp.txt nlloc.obs.txt

rfocmecLinux64bit.txt script.sh.txt

rcabdia commented 5 years ago

Phases for focmec: 8

EVO 33.40 62.60D OB_2 219.00 63.00U OB_1 215.70 62.80U OB_0 225.70 62.70U OB_4 245.80 62.80U OB_3 237.50 63.10U PCVE 53.10 62.80U PVAQ 65.60 62.80U

Traceback (most recent call last): File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/obspyck.py", line 495, in on_qToolButton_doFocMec_clicked self.doFocmec() File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/obspyck.py", line 1927, in doFocmec (msg, err, returncode) = call(prog_dict) File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/util.py", line 910, in tmp stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/subprocess.py", line 1025, in _execute_child raise child_exception OSError: [Errno 8] Exec format error

megies commented 5 years ago

Something I've noticed is that when obspyck write the observation file "nlloc.obs", it does not >include the polarities U, D (is attached also)

Can't say for sure, but I think I never used polarities with NLLoc. Does Nlloc even use polarities?

When I write the location file.xml, the coordinates of the location are different from the location of >the file .hyp. (very strange) I can imagine that the problem comes from the config file (it is attached). it >also is shown when I plot the map, the wrong location. it could be because of the transformation >"TRANS SIMPLE" of the control file? may be because it can be read properly the lat long and depth >from the file.hyp.

There is some coordinate conversion mechanics in util.py, see

This is also mentioned in one of the other NLLoc issues here, you might have to patch this in your obspyck installation, sorry, never got round to make this changeable via config file, I think.


Not sure what the problem with focmec is, but you should try to run the focmec binary from command line, it should ask for all the input info then, just to see if your binary works..

rcabdia commented 5 years ago

I've go around the rfocmec script step by step and finally I solved partially the problem

grep -v "nan" focmec.out.all | grep "$i.0" > focmec.out && echo "found solution with $i Errors." && exit 0 instead of

grep -v "nan" focmec.out.all | grep " $i.0 " > focmec.out && echo "found solution with $i Errors." && exit 0

Now, it record something in the focmec.out file

But another error arise, now related with obspyck.py

--> focmec finished 1724 suitable solutions found: Traceback (most recent call last): File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/obspyck.py", line 495, in on_qToolButton_doFocMec_clicked self.doFocmec() File "/home/sysop/miniconda2/envs/obspyck_test/lib/python2.7/site-packages/obspyck/obspyck.py", line 1946, in doFocmec np1.dip = float(line[0]) ValueError: could not convert string to float: Polarities/Errors: