Giter Club home page Giter Club logo

straintool's People

Contributors

demanasta avatar xanthospap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

straintool's Issues

gmtstrainplot python verion error

Describe the bug
Bug at program gmtstrainplot.sh
The bug is caused when bash calls python to compute/print computation results. Some of the calls
cause errors in Python3.x (e.g sclat=$(echo print ${south} + ${tmp_scrate} | python)). These lines
are ok for previous versions of Python.

To Reproduce
Steps to reproduce the behavior:

  1. run command './gmtstrainplot.sh -jpg -vhor station_info.dat -psta -l -o output_vel'
    using Python 3.6
  2. check for errors
"<stdin>", line 1
print 34 + 0.4

or

File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'builtin_function_or_method' and 'float'

Expected behavior
All of the lines just compute a bash variable (to be used later on)

Screenshots

Desktop (please complete the following information):

  • OS: [Windows]
  • Python: [3.6]
  • GMT: [e.g. 5.2.1] -- irrelevant
  • StrainTool: [v1.0-rc2.0]

Additional context
Bug reported by Varvara

calc of second invariant

Wrong calculation of 2nd invariant.... sqrt(exx^2 + eyy^2 + exy^2)
solution: use function: sqrt(exx^2 + eyy^2 + 2exy^2)
strainpy line 587
Shen paper

from ellipsoidal to utm and back

Transforming ellipsoidal to UTM coordinates and back is erroneous; see the test case in pystrain/geodesy/utm.py. Seems that there is a problem (at least) with negative longtitudes.

[gmtplots...] bc not woring for windows

Describe the bug
if conditions for float numbers in bash using bc, not working for windows
./gmtstrainplot.sh: line 131: bc: command not found
./gmtstatsplot.sh: line 415: bc: command not found

To Reproduce
change [bc] with maybe awk condition

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Python: [3.6]
  • GMT: [5.2.1]
  • StrainTool: [v1.0-beta4.0]

Additional context
Add any other context about the problem here.

generate delaunay tr: more triangles than real

Describe the bug
delaunauy def generate fake triangles or unnecessary triangles if stations are very close together. -> wrong results

  • check the shape of the triangles? angles?

To Reproduce

  1. ./bin/StrainTensor.py -i ../test_data/data/ntua_repro17.vel --region=18/30/32/44 --method veis
  2. ./plot/gmtstrainplot.sh -jpg -str strain_info.dat -psta -l -o output_str -deltr -strsc 0.00011

Desktop (please complete the following information):

  • OS: [Ubuntu 18.04]
  • Python: [2.7/3.6]
  • GMT: [5.2.1]
  • StrainTool: [v1.0]

Additional context
Add any other context about the problem here.

One tensor (barycenter) not working?

Describe the bug
When one tensor (-b) set in arguments, no results in the output

To Reproduce
Steps to reproduce the behavior:

  1. use option -b or --barycenter

Expected behavior
no results in strain_info.dat

Desktop (please complete the following information):

  • OS: [LInux]
  • Python: [2.7]
  • GMT: [5.2.1]
  • StrainTool: [v1.0-rc4.0]

Additional context
Add any other context about the problem here.

multicore proc error for Windows 10

Describe the bug
multi-threading mode not working on Windows 10

To Reproduce
Steps to reproduce the behavior:

  1. run command .\StrainTensor.py -i <data_file> --x-grid-step 1 --y-grid-step 1 -g --multicore
  2. check for error
Traceback (most recent call last):
  File "D:\gh_project\StrainTool\bin\StrainTensor.py", line 487, in <module>
    [ p.start() for p in [p1, p2, p3, p4]]
  File "D:\gh_project\StrainTool\bin\StrainTensor.py", line 487, in <listcomp>
    [ p.start() for p in [p1, p2, p3, p4]]
  File "C:\Program Files\Python39\lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
  File "C:\Program Files\Python39\lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Program Files\Python39\lib\multiprocessing\context.py", line 327, in _Popen
    return Popen(process_obj)
  File "C:\Program Files\Python39\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Program Files\Python39\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_io.TextIOWrapper' object
PS D:\gh_project\StrainTool\bin> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python39\lib\multiprocessing\spawn.py", line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Program Files\Python39\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
PermissionError: [WinError 5] Δεν επιτρέπεται η πρόσβαση

Desktop (please complete the following information):

  • OS: Windows 10
  • Python: 3.9.7
  • GMT: 6.x
  • StrainTool: v1.0-r1

Problem when the grid cover the longitude 0

the -r or --region option leads to error when set over longitude 0.

Example : -r -9/15/34/58

The code returns :
usage: StrainTensor.py [-h] -i INPUT_FILE [--x-grid-step X_GRID_STEP] [--y-grid-step Y_GRID_STEP] [-m METHOD] [-r REGION]
[-c] [-b] [--max-beta-angle MAX_BETA_ANGLE] [-t WEIGHTING_FUNCTION] [--Wt Wt] [--dmin D_MIN]
[--dmax D_MAX] [--dstep D_STEP] [--d-param D_PARAMETER] [-g] [--verbose] [--multicore] [-v]
StrainTensor.py: error: argument -r/--region: expected one argument

straintool

In DSOlab-StrainTool-e1d4f4f tool version 1.0
the gmt script for extracting dextral sinistral shear strain is given as below:
"# plot strain rates
awk 'NR > 2 {print $2,$1,$19,0,$21-45+90}' $pth2strinfo
| gmt psvelo -Jm $range -Sx${STRSC} -L -A.1p+e -Gred -W1.5p,red
-O -K -V${VRBLEVM} >> $outfile

according to the above command, it is used to extract data of dextral component in this version of tool but in recent version '1.0-r1' this command is looks like this:
"# plot strain rates

dextral

awk 'NR > 2 {print $2,$1,0,$19,$21-45+90}' $pth2strinfo
| gmt psvelo -Jm $range -Sx${STRSC} -L -A.1p+e -Gred -W1.5p,red
-O -K -V${VRBLEVM} >> $outfile
both AWK command are different. please clarify the changes made in this command so we can use corrected command,

magnitude of sd

check calculation of VcV matrix
magnitude of sd is very big!

check pystrain/strain.py line:930-933

Multithreading is different between Linux and Windows

Description
multicore option on Windows returns error. Windows not use fork() system, global variables not working.

To Reproduce
1.Run StrainTensor.py with --multicore option on Windows System
2. error:
File "C:\Users\diman\gh_projects\StrainTool\bin\StrainTensor.py", line 109, in compute__ N, E, ZN, _ = ell2utm(clat, clon, Ellipsoid("wgs84"), utm_zone) NameError: global name 'utm_zone' is not defined

Desktop:

  • OS: Windows 10
  • Python: 2.7
  • GMT: 5.2.1
  • StrainTool: v1.0-rc5.1 (dev-danast branch)

Bug with Multiple UMT zones and the veis method

Describe the bug
The "veis" method doesn't work for multiple UMT zones

To Reproduce
Steps to reproduce the behavior:

  1. Run straintool with the data file with the --method=veis

Mid_EARS_vel.txt
2)get error of UMT zoning

Expected behavior
I expect calculation of delaunay triangles and strain rate tensor for the veis method

Screenshots
Screen Shot 2021-11-19 at 10 52 04 AM (2)

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Python: [e.g. 2.7]
  • GMT: [e.g. 5.2.1]
  • StrainTool: [e.g. v1.0-beta4.0]

Additional context
The code was changed a few months ago to allow for multiple umt zones with the shen method but I don't know if it was changed for the veis method. Thank you!

grid.py step conflict

Use of the next options,
-r=-20/50/28/75 --x-grid-step 2 --y-grid-step 2

If lat or lon is not multiple of step then return the next error:

Traceback (most recent call last):
  File "./../bin/StrainTensor.py", line 241, in <module>
    grd = pystrain.grid.Grid(lonmin, lonmax, args.x_grid_step, latmin, latmax, args.y_grid_step)
  File "build/bdist.linux-x86_64/egg/pystrain/grid.py", line 70, in __init__
AssertionError

generate-statistics flag

Describe the bug
whenever i used the --generate-statistics or -g option, the code doesn't run. I get this message: StrainTensor.py: error: unrecognized arguments: --generate-statistics.

To Reproduce
Steps to reproduce the behavior:

  1. run command '...'
    $> ./StrainTensor.py -i ../data/CNRS_midas.vel -r 18.75/30.25/32.75/42.25 --x-grid-step=0.5 --y-grid-step=0.5 --dmin=1 --dmax=500 --dstep=1 --Wt=24 -c -g
  2. check for error '...'
    StrainTensor.py: error: unrecognized arguments: -g
    Expected behavior
    A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Python: [e.g. 2.7]
  • GMT: [e.g. 5.2.1]
  • StrainTool: [e.g. v1.0-beta4.0]

Additional context
Add any other context about the problem here.

sVn sVe must not be zero!

Describe the bug
If sVn sVe set to zero in the input file then tensor include this station will not estimated. script cannot create covariance matrix (1/sV...)

Desktop (please complete the following information):

  • OS: [Linux]
  • Python: [2.7]
  • GMT: [5.4.3]
  • StrainTool: [v1.0]

Propose

  • Add to README a warning
  • Add check on when script parse input file?

No Example input file

I am getting a divide by zero error when using negative latitude.

./StrainTensor.py -i ../data/Nubia_velzone36S.txt -r 30.0/36.0/-0.1/-30.0 --x-grid-step=0.5 --y-grid-step=0.5 -m='veis' -c
[DEBUG] Reading station coordinates and velocities from ../data/Nubia_velzone36S.txt
[DEBUG] Number of stations parsed: 57
[DEBUG] Left with only 0 stations! Cannot do anything
[ERROR] Failed to parse region argument "30.0/36.0/-0.1/-30.0"
Traceback (most recent call last):
File "./StrainTensor.py", line 407, in
mean_lon = degrees(sum([ x.lon for x in sta_list_ell ]) / len(sta_list_ell))
ZeroDivisionError: integer division or modulo by zero

Invalid UTM Zone

Hi, I´m trying to run the software with my data, I successfully run the example data, but when I run my data I got the next error:

python3.6 StrainTensor.py -i ../data/IGP_VEL.vel -r=-79.0/-75.5/-12.5/-8.5 --x-grid-step=0.5 --y-grid-step=0.5 --dmin=1 --dmax=500 --dstep=1 --Wt=24 -c -g

[DEBUG] Reading station coordinates and velocities from ../data/IGP_VEL.vel
[DEBUG] Number of stations parsed: 20
Traceback (most recent call last):
File "StrainTensor.py", line 416, in
assert Zone == utm_zone, "[ERROR] Invalid UTM Zone."
AssertionError: [ERROR] Invalid UTM Zone.

I appreciate your help.
Thanks

gmtplots: scale of gridded data not plotted correctly

Describe the bug
If values of grid data (shear strain, dilatation, sigma) are very small scale was not plotted correctly

To Reproduce
run example for alps dataset

Expected behavior
will not print scale at shear strain and sigma maps

Screenshots

Desktop (please complete the following information):

  • OS: [Linux]
  • Python: [2.7]
  • GMT: [5.2.1]
  • StrainTool: [v1.0-rc3.0]

Additional context
Add any other context about the problem here.

unable to reproduce the test

Describe the bug
Get much lower uncertainties than expected running the example (/5) for each component of strain rate or velocity.

To Reproduce
I have installed correctly the soft with python 3.6 (not working with 3.11 config) and tried the example (CNRS_midas.vel is not in the git directory directly, I got it from the DSOlab-StrainTool-9fa7ae7 repository and remove redundant stations).
Run the suggested test ./StrainTensor.py -i ../data/CNRS_midas.vel -r 18.75/30.25/32.75/42.25 --x-grid-step=0.5 --y-grid-step=0.5 --dmin=1 --dmax=500 --dstep=1 --Wt=24 -c -g

Expected behavior
should get something like :
Latitude Longtitude vx+dvx vy+dvy w+dw exx+dexx exy+dexy eyy+deyy emax+demax emin+demin shr+dshr azi+dazi dilat+ddilat sec. invariant
36.00000 23.50000 +7.2 +5.4 -11.8 +4.6 +5.3 +26.9 +14.5 +48.1 +12.7 +26.9 +32.3 +33.3 +38.8 +42.0 +7.9 +38.1 +15.5 +27.4 +27.5 +0.9 +46.8 +58.5 +37.6
36.00000 24.00000 +7.9 +5.4 -11.5 +4.6 +6.4 +23.6 +8.9 +43.3 +9.8 +23.6 +32.0 +28.5 +35.6 +32.6 +5.3 +38.8 +15.2 +24.7 +20.2 +0.8 +40.9 +51.9 +34.6

and got :
Latitude Longtitude vx+dvx vy+dvy w+dw exx+dexx exy+dexy eyy+deyy emax+demax emin+demin shr+dshr azi+dazi dilat+ddilat sec. invariant+dsec inv.
36.00000 23.50000 +7.2 0.9 -11.8 0.7 +0.3 0.2 +15.0 7.8 +12.9 4.4 +32.1 5.3 +39.0 6.8 +8.1 6.2 +15.5 4.4 +28.2 0.1 +47.1 9.5 +39.8 6.9
36.00000 24.00000 +7.9 0.9 -11.5 0.7 +0.3 0.2 +9.3 7.1 +10.1 3.8 +31.9 4.6 +35.7 5.3 +5.4 6.3 +15.1 4.0 +20.9 0.1 +41.2 8.4 +36.2 5.3

Screenshots

Desktop (please complete the following information):

  • OS: Ubuntu 22
  • Python: 3.6.3
  • GMT: whatever.
  • StrainTool: master

Additional context
Add any other context about the problem here.

rotational units

Change output units for rotation form ppm to marcsec/y
output files..
plot files and scales

Map size changes with different Wt

Expected Behavior
I expect the map to remain the same size (or relatively so) when changing the weigh (wt), but I expect the transitions between different strain rates to be smoother as the algorithm should take in more stations as the cell size gets bigger.

Actual Behavior
From my knowledge of the Shen et al, 2015 method changing the weight (wt) parameter shouldn't affect the size of the map. However I am finding that when I increase the wt the map becomes smaller and smaller. The map does get smoother (as expected)

Possible solution
I am wondering if there is a cap on the amount of elements that can be in the strain rate tensor and I am running out of space as the algorithm works north to south. There are plenty of GPS velocities in the areas that are coming up empty with increasing the wt.

Steps to Reproduce the Problem

Files

wt=24
Mid_EARS-output_2inv-wt24

wt=48
Mid_EARZ-output_2inv-Wt48

wt=60
Mid_EARS-output_2inv-wt60

Mid_EARS_vel.txt

Please let me know if more files are needed.

Add the main article to the project

Hello,

I would like to congratulate on their project. However, I would rather have access to the next article, because I think It is very important to understand better the methodology.

Anastasiou D., Ganas A., Legrand J., Bruyninx C., Papanikolaou X., Tsironi V. and Kapetanidis V. (2019). Tectonic strain distribution over Europe from EPN data. EGU General Assembly 2019, Geophysical Research Abstracts, Vol. 21, EGU2019-17744-1

If this is not possible, I would like to share me this article to my email.

Thank you.

-r / --region switch fails if not set

Describe the bug
StrainTool fails if -r / --region switch fails if not set in command line

To Reproduce
Steps to reproduce the behavior:

  1. run command 'StrainTool ' without setting "-r"
  2. check for error 'NameError: name 'region' is not defined'

Expected behavior
No error

Screenshots

Desktop (please complete the following information):

  • OS: [Linux]
  • Python: [2.7]
  • GMT: [e.g. 5.2.1]
  • StrainTool: [v1.0-rc3]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.