Comments (16)
Hi, thanks for your question,
it seems that after parsing the input file (where 57 station records have been parsed), the software tries to find any stations falling within the rectangle defined by the coordinates 30.0/36.0/-0.1/-30.0 (in longitude and latitude). The software fails to actually find any station which falls within this region. Is that incorrect? Do you actually have stations within this region in the input file? If so, could you please provide us with the input file so that we can further investigate what is going on?
Xanthos
from straintool.
I had to separate my data to be calculated for each UMT zone, this will effect the strain rate solution but I couldn't find a way to do calculations in different zones. I also can't get -m='shen' to work only the 'veis.'
from straintool.
thanks for the file,
you are correct, computations between zones are still to be addressed. We will look into it and come up with a solution; what is the actual regions limits you are interested in (30.0/36.0/-0.1/-30.0 is only a portion i suppose)?
from straintool.
I am looking at the East African Rift System so mainly zones 35-38 north and south. There are a few stations in zone 34 but those are less important. There are about 200 stations in total.
from straintool.
Hi there,
here is a quick fix for the problem discussed:
go to the file pystrain/pystrain/geodesy/utm.py
and comment out the line nr 137 (aka the line Zone *= -1e0
).
Re-install the pystrain package (aka go to the folder StrainTool/pystrain
and execute the command sudo python setup.py install
).
Now you should be able to estimate the strain tensors for the whole region (also using the 'shen' method). E.g., with the changes mentioned, i can successfully run: ./StrainTensor.py -i ../data/Nubia_velzone36S.txt --x-grid-step=0.5 --y-grid-step=0.5 -c --multicore
The software now 'forces' all stations to be translated to UTM coordinates relative to a single UTM zone. That could introduce small distortions in case the stations are too far away (but that does not seem to be the case). Please let me know if that looks ok.
Xanthos
from straintool.
please pull the branch origin/bug68, re-install the pystrain package and let me know if this bugfix fixes the problem. The issue is discussed #69 , where a little more detailed is provided regarding the pull/install.
let me know if that fixes the problem.
Xanthos
from straintool.
Sorry for the delay in response.
I have pulled/installed the new files and am still getting an issue, after I run the StrainTensor.py the strain_info.dat file is empty. I am trying to run my entire area (UMT zone 35-38). I may have misunderstood and the script may still only work for singular UMT zones and not across 4. I am attaching my input file, the output files and the error I am receiving. I am going to try and run these for a smaller area and see if there is still an issue.
Error:[DEBUG] Using multithreaded version; available CPU's: 12
[DEBUG] Reading station coordinates and velocities from ../data/Nubia_vel.txt
[DEBUG] Number of stations parsed: 193
[DEBUG] Grid Information:
[DEBUG] Longtitude : from 25.53924 to 49.03924 with step 0.5 (deg)
[DEBUG] Latitude : from -28.83769 to 21.66231 with step 0.5 (deg)
[DEBUG] Number of Strain Tensors to be estimated: 4747
[DEBUG] Estimating strain tensors in multi-threading mode
Process Process-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
Process Process-2:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
Process Process-3:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self.args, **self.kwargs)
File "./StrainTensor.py", line 127, in compute
self._target(*self.args, **self.kwargs)
File "./StrainTensor.py", line 127, in compute
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
Process Process-4:
self._target(*self.args, **self.kwargs)
File "./StrainTensor.py", line 127, in compute
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
TypeError: init() takes at most 4 arguments (22 given)
TypeError: init() takes at most 4 arguments (22 given)
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
TypeError: init() takes at most 4 arguments (22 given)
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self.args, **self.kwargs)
File "./StrainTensor.py", line 127, in compute
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
TypeError: init() takes at most 4 arguments (22 given)
[DEBUG] Total running time: 0.05 sec.
Nubia_vel.txt
from straintool.
i made a few changes at the source code and hopefully it should be ok. I was able to run the example dataset you attached, using the command ./StrainTensor.py -i ../data/Nubia_vel.txt --x-grid-step=0.5 --y-grid-step=0.5 -c
and produce parameters for 1552 strain tensors. Please pull the changes, re-install the pystrain package and give it a try.
I am not sure it will work though; i can see from the error messages you attach, that you use python2.x. I am currently out of office and i can only try the program in my own personal pc where i only have python 3.x available. I will have access to a 2.x version the following week.
Give it a try and let me know how it goes. I attach the resulting strain_info.dat file; i can see that various tensors have been estimated but unfortunately i cannot tell if they make any sense.
Xanthos
from straintool.
I pulled the new code from the bug68, switched which python to 3.7, installed and am still getting the same error with both -m='shen' and -m='veis'
File "./StrainTensor.py", line 128, in compute__
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
TypeError: init() takes at most 4 arguments (22 given)
from straintool.
that is kind of weird .... i tried cloning the repository and installing bug68 and everything seems to work. What is the version of python you use (aka the result from the command python --version
)? Did you re-install the pystrain package with the correct python version (aka something like sudo python 3.x setup.py install
)? Could you maybe clone the repository from the start using the latest python version you have available (you can leave this one as is, and clone the repository in a different folder, install pystrain and try running). Sorry for this, but i cannot understand what else is causing the problem. Just make sure that sudo python 3.x setup.py install
is executed without errors.
I can only imagine that the error is caused by some kind of mismatch between python versions/installed packages. Unfortunately, i cannot try the changes out, in a different python version, until Monday.
Xanthos
from straintool.
I am now using python 3.9.1 but everything is screwy now with my python paths and the script wont even output the stations.dat file.
I am going to hopefully get my paths, packages and modules solved in the next day or so. I will let you know if the code indeed runs after that.
from straintool.
Would you be able to give me the station_info.Nubia.txt and the station_stats.Nubia.txt so that I can plot up the maps to see the output? I am getting no return files and the same error running python in a new environment.
This is what I get when I run python setup.py install
/usr/local/lib/python3.9/site-packages/setuptools/dist.py:461: UserWarning: Normalizing '1.0-r1' to '1.0.post1'
warnings.warn(tmpl.format(**locals()))
running install
running bdist_egg
running egg_info
error: [Errno 13] Permission denied
(base) clapp-210-188:pystrain chloe$ sudo python setup.py install
Password:
Sorry, try again.
Password:
/Users/chloe/opt/anaconda3/lib/python3.8/site-packages/setuptools/dist.py:461: UserWarning: Normalizing '1.0-r1' to '1.0.post1'
warnings.warn(tmpl.format(**locals()))
running install
running bdist_egg
running egg_info
writing pystrain.egg-info/PKG-INFO
writing dependency_links to pystrain.egg-info/dependency_links.txt
writing requirements to pystrain.egg-info/requires.txt
writing top-level names to pystrain.egg-info/top_level.txt
reading manifest file 'pystrain.egg-info/SOURCES.txt'
writing manifest file 'pystrain.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.9-x86_64
creating build/bdist.macosx-10.9-x86_64/egg
creating build/bdist.macosx-10.9-x86_64/egg/pystrain
copying build/lib/pystrain/grid.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain
creating build/bdist.macosx-10.9-x86_64/egg/pystrain/iotools
copying build/lib/pystrain/iotools/init.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/iotools
copying build/lib/pystrain/iotools/iparser.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/iotools
copying build/lib/pystrain/init.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain
copying build/lib/pystrain/station.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain
creating build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy
copying build/lib/pystrain/geodesy/crdtrans.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy
copying build/lib/pystrain/geodesy/ellipsoid.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy
copying build/lib/pystrain/geodesy/init.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy
copying build/lib/pystrain/geodesy/utm.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy
copying build/lib/pystrain/strain.py -> build/bdist.macosx-10.9-x86_64/egg/pystrain
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/grid.py to grid.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/iotools/init.py to init.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/iotools/iparser.py to iparser.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/init.py to init.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/station.py to station.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy/crdtrans.py to crdtrans.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy/ellipsoid.py to ellipsoid.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy/init.py to init.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/geodesy/utm.py to utm.cpython-38.pyc
byte-compiling build/bdist.macosx-10.9-x86_64/egg/pystrain/strain.py to strain.cpython-38.pyc
creating build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying pystrain.egg-info/PKG-INFO -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying pystrain.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying pystrain.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying pystrain.egg-info/requires.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
copying pystrain.egg-info/top_level.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/pystrain-1.0.post1-py3.8.egg' and adding 'build/bdist.macosx-10.9-x86_64/egg' to it
removing 'build/bdist.macosx-10.9-x86_64/egg' (and everything under it)
Processing pystrain-1.0.post1-py3.8.egg
Copying pystrain-1.0.post1-py3.8.egg to /Users/chloe/opt/anaconda3/lib/python3.8/site-packages
Adding pystrain 1.0.post1 to easy-install.pth file
Installed /Users/chloe/opt/anaconda3/lib/python3.8/site-packages/pystrain-1.0.post1-py3.8.egg
Processing dependencies for pystrain==1.0.post1
Searching for scipy==1.6.2
Best match: scipy 1.6.2
Adding scipy 1.6.2 to easy-install.pth file
Using /Users/chloe/opt/anaconda3/lib/python3.8/site-packages
This all looks good to me, but I am still getting this error in the output
Using /Users/chloe/opt/anaconda3/lib/python3.8/site-packages
Finished processing dependencies for pystrain==1.0.post1
(base) clapp-210-188:pystrain chloe$ cd ..
(base) clapp-210-188:StrainTool-bug68 chloe$ cd bin
(base) clapp-210-188:bin chloe$ ./StrainTensor.py -i ../data/Nubia_vel.txt --x-grid-step=0.5 --y-grid-step=0.5 -c
[DEBUG] Reading station coordinates and velocities from ../data/Nubia_vel.txt
[DEBUG] Number of stations parsed: 193
[DEBUG] Grid Information:
[DEBUG] Longtitude : from 25.53924 to 49.03924 with step 0.5 (deg)
[DEBUG] Latitude : from -28.83769 to 21.66231 with step 0.5 (deg)
[DEBUG] Number of Strain Tensors to be estimated: 4747
Traceback (most recent call last):
File "./StrainTensor.py", line 511, in
compute__(grd, sta_list_utm, lcm, fout, fstats, vprint, **dargs)
File "./StrainTensor.py", line 128, in compute__
sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs)
TypeError: init() takes at most 4 arguments (22 given)
from straintool.
hi @csboucher ,
strain_stats.txt
strain_info.txt
station_info.txt
sorry for my late reply; i just got back to office and can now test various things on the software. I attach the output files from running the command ./StrainTensor.py -i ../data/Nubia_vel.txt --x-grid-step=0.5 --y-grid-step=0.5 -c -g
. Let me know it the results seems ok.
I will also try to figure out what is going on with the python versioning and get back to you as soon as possible.
Xanthos
from straintool.
I am running python 3.9.1 and fixed my pyqt on python 2.7 but I am getting the same error where it says:
init() takes at most 4 arguments (22 given)
from straintool.
hi @csboucher
We checked the operation of the software in python2.7, 3.8 and 3.9 but we were not able to recreate the error presented to you. Check if there is any conflict with the different versions you have installed. The pystrain setup should be installed with the version that the system uses as default. Maybe you have installed python 3.9.1 but the system default version is python 2.7.
Dimitris
ps. I attach our last results produced with your data
nubia-station_info.dat.txt
nubia-strain_stats.dat.txt
nubia-strain_info.dat.txt
from straintool.
This must be user error on my part if it is working for all of you professional coders as DOS.
Thank you so much for your quick responses and altering the code to accommodate multiple UMT zones. I have closed this ticket and will continue to work on my python versions.
from straintool.
Related Issues (20)
- One tensor (barycenter) not working?
- [gmtplots...] bc not woring for windows
- strain.py: calculate sd of second invariant HOT 1
- magnitude of sd
- Multithreading is different between Linux and Windows HOT 1
- generate delaunay tr: more triangles than real
- generate-statistics flag
- sVn sVe must not be zero! HOT 2
- input file duplicate lines stop processing HOT 2
- Invalid UTM Zone HOT 10
- multicore proc error for Windows 10 HOT 2
- Map size changes with different Wt HOT 1
- Bug with Multiple UMT zones and the veis method HOT 2
- Add the main article to the project HOT 1
- straintool HOT 1
- unable to reproduce the test HOT 4
- Problem when the grid cover the longitude 0 HOT 2
- Create a couple of validation tests HOT 1
- Multicore bug for the output grid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from straintool.