Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating with hypo_2000 / NLLoc #53

Open
shicks-seismo opened this issue Mar 29, 2017 · 6 comments
Open

Integrating with hypo_2000 / NLLoc #53

shicks-seismo opened this issue Mar 29, 2017 · 6 comments

Comments

@shicks-seismo
Copy link
Contributor

Dear Tobias,

I'm having problems running hypo_2000 from Obspyck.

In the temporary working directory, I have the following files: bay2000.inp; gey.crh; hyp2000; hyp2000.pha; hypo.arc; hypo.sum; stations.dat (hopefully these are named correctly)

If I run hypo_2000 in standalone mode using these files, the location works correctly; however, with Obspyck, I get the following error:

Traceback (most recent call last):
File "/Users/sph1r17/anaconda/envs/obspy_2.7/lib/python2.7/site-packages/obspyck-0.4.1.post0-py2.7.egg/obspyck/obspyck.py", line 446, in on_qToolButton_doHyp2000_clicked
self.doHyp2000()
File "/Users/sph1r17/anaconda/envs/obspy_2.7/lib/python2.7/site-packages/obspyck-0.4.1.post0-py2.7.egg/obspyck/obspyck.py", line 2114, in doHyp2000
call = prog_dict['Call']
File "/Users/sph1r17/anaconda/envs/obspy_2.7/lib/python2.7/site-packages/obspyck-0.4.1.post0-py2.7.egg/obspyck/util.py", line 858, in tmp
stdin=subprocess.PIPE,
File "/Users/sph1r17/anaconda/envs/obspy_2.7/lib/python2.7/subprocess.py", line 711, in init
errread, errwrite)
File "/Users/sph1r17/anaconda/envs/obspy_2.7/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

I am confused how Obspyck tells the shell to run hyp2000 and then provides the correct name of the command file within hyp2000.

Maybe it is working properly but the Mac problems described in this thread are occurring: [https://github.com//issues/11#issuecomment-59489271].

Nevertheless, it would be good to have your input.

@shicks-seismo
Copy link
Contributor Author

Okay, as you can see from my Pull Requests, this issue is now sorted after staring at the code for a long time!

The problem was solved for my Mac by removing the 'shell=SHELL' argument to the subprocess command for HYPO2000 and NLLoc (Lines 855 and 897 of util.py).

I haven't formally requested a pull for this issue because I didn't know how such a change might affect Obspyck on Linux.

@shicks-seismo shicks-seismo changed the title Integrating with hypo_2000 Integrating with hypo_2000 / NLLoc Mar 30, 2017
@shicks-seismo
Copy link
Contributor Author

So my final (hopefully!) question regards the coordinate conversion from NLLoc output back to lat, long. I see in the code that you use the gk2lonlat to convert Gauss-Krueger coordinates to lat, long.

Could you please explain some more about this methodology.
Do I need to define my NLLoc velocity grid in a special way?
Do I need to define the pyproj init value to the zone / central merdian that I am interested in?

Many thanks again.

@megies
Copy link
Owner

megies commented Mar 30, 2017

hey @shicks-seismo sorry for not being able to help much with above issue, the subprocess/wait/shell stuff has made some issues before, but since i'm not using MAC I can only rely on what people report back..

coordinate conversion from NLLoc

this is all about what coordinates you use in nonlinloc. I assume you dont use global mode but some local coordinates, so you need to replace gk2lonlat with whatever coordinate conversion you need from your nonlinloc reference system to WGS. What coordinates do you use in nonlinloc?

@echavess
Copy link

echavess commented Dec 22, 2017

Hi @shicks-seismo and @megies
I just installed Obspyck and some of the recommended dependencies: focmec, hypo2000 but I am running into problems when trying to install NLLoc. There's an apparent problem with the architecture. I followed the instructions for installing the code in MacOS: http://alomax.free.fr/nlloc/soft5.00/NLL_MacOSX.txt

Error:

make: Circular NLLoc <- NLLoc dependency dropped. gcc NLLoc_main.o NLLoc1.o NLLocLib.o GridLib.o util.o geo.o octtree.o nrutil.o nrmatrix.o ran1.o map_project.o calc_crust_corr.o velmod.o GridMemLib.o phaselist.o loclist.o -O3 -Wall -o ./NLLoc -lm Undefined symbols for architecture x86_64: "_GetEpiDist", referenced from: _setStationDistributionWeights in NLLocLib.o _SaveBestLocation in NLLocLib.o _getTravelTimes in NLLocLib.o _getOctTreeStationDensityWeight in NLLocLib.o "_ReadAbsInterpGrid2d", referenced from: _CalcSimpleElevCorr in NLLocLib.o _SaveBestLocation in NLLocLib.o _getTravelTimes in NLLocLib.o "_ReadAbsInterpGrid3d", referenced from: _CalcSimpleElevCorr in NLLocLib.o _SaveBestLocation in NLLocLib.o _getTravelTimes in NLLocLib.o "_calcAveInterStationDistance", referenced from: _setStationDistributionWeights in NLLocLib.o _Locate in NLLocLib.o "_get_rand_double", referenced from: _GenEventScatterGrid in NLLocLib.o _LocMetropolis in NLLocLib.o _getScatterSampleResultTree in NLLocLib.o _GaussDev in GridLib.o _TestGaussDev in GridLib.o "_get_rand_int", referenced from: _addResult in octtree.o "_get_surface_z", referenced from: _ApplyTimeDelays in NLLocLib.o _ApplySurfaceTimeDelay in NLLocLib.o _LocGridSearch in NLLocLib.o _LocMetropolis in NLLocLib.o _isAboveTopo in NLLocLib.o _LocOctree in NLLocLib.o "_rect2latlon", referenced from: _SaveBestLocation in NLLocLib.o _LocGridSearch in NLLocLib.o _LocMetropolis in NLLocLib.o _isAboveTopo in NLLocLib.o _LocOctree in NLLocLib.o _Locate in NLLocLib.o "_rect2latlonAngle", referenced from: _WriteHypoInverseArchive.constprop.10 in NLLocLib.o _WriteHypoEll in NLLocLib.o _WriteHypo71 in NLLocLib.o _WriteHypoInverseArchive in NLLocLib.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status make: *** [NLLoc] Error 1

Thanks for your help!

@echavess
Copy link

Ok. Nevermind. I solved it installing the new version of NLLOC which brings support for mac osx.

@megies
Copy link
Owner

megies commented Jan 3, 2018

Ok. Nevermind. I solved it installing the new version of NLLOC which brings support for mac osx.

Old versions used to work on Mac, too. But I never compiled it myself. Anyway, glad it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants