Skip to content

Commit ab19553

Browse files
author
DemAnasta
authored
Merge pull request #51 from DSOlab/dev-danast
Dev danast
2 parents 342dc8c + 3911217 commit ab19553

File tree

14 files changed

+827
-693
lines changed

14 files changed

+827
-693
lines changed

.github/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
## [v1.0-rc4.0](https://github.com/DSOlab/StrainTool/tree/v1.0-rc4.0)(2018-12-14)
4+
5+
[Full Changelog](https://github.com/DSOlab/StrainTool/compare/v1.0-rc3.0...v1.0-rc4.0)
6+
7+
**Implemented enhancements:**
8+
9+
- rotational units [\#33](https://github.com/DSOlab/StrainTool/issues/33)
10+
- Issue33 [\#45](https://github.com/DSOlab/StrainTool/pull/45) ([demanasta](https://github.com/demanasta))
11+
12+
**Fixed bugs:**
13+
14+
- gmtplots: scale of gridded data not plotted correctly [\#47](https://github.com/DSOlab/StrainTool/issues/47)
15+
- -r / --region switch fails if not set [\#44](https://github.com/DSOlab/StrainTool/issues/44)
16+
- Issue47 [\#50](https://github.com/DSOlab/StrainTool/pull/50) ([demanasta](https://github.com/demanasta))
17+
- Issue33 [\#48](https://github.com/DSOlab/StrainTool/pull/48) ([demanasta](https://github.com/demanasta))
18+
- Dev [\#46](https://github.com/DSOlab/StrainTool/pull/46) ([demanasta](https://github.com/demanasta))
19+
20+
**Merged pull requests:**
21+
22+
- sync issue33 wth dev-danast [\#43](https://github.com/DSOlab/StrainTool/pull/43) ([demanasta](https://github.com/demanasta))
23+
- sync dev-danast with master [\#41](https://github.com/DSOlab/StrainTool/pull/41) ([demanasta](https://github.com/demanasta))
24+
25+
## [v1.0-rc3.0](https://github.com/DSOlab/StrainTool/tree/v1.0-rc3.0) (2018-11-30)
26+
[Full Changelog](https://github.com/DSOlab/StrainTool/compare/v1.0-rc2.0...v1.0-rc3.0)
27+
28+
**Implemented enhancements:**
29+
30+
- Issue38 [\#39](https://github.com/DSOlab/StrainTool/pull/39) ([demanasta](https://github.com/demanasta))
31+
32+
**Fixed bugs:**
33+
34+
- gmtstrainplot python verion error [\#38](https://github.com/DSOlab/StrainTool/issues/38)
35+
- gmtplots: gtotalaxes [\#37](https://github.com/DSOlab/StrainTool/issues/37)
36+
- Issue38 [\#39](https://github.com/DSOlab/StrainTool/pull/39) ([demanasta](https://github.com/demanasta))
37+
338
## [v1.0-rc2.0](https://github.com/DSOlab/StrainTool/tree/v1.0-rc2.0) (2018-11-27)
439
[Full Changelog](https://github.com/DSOlab/StrainTool/compare/v1.0-rc1.0...v1.0-rc2.0)
540

README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ This program does not need installation; it is just a pyrhon script. The user ma
3939

4040
## Plot Tools
4141

42-
By 'Plot Tools', we mean an array of shell ([Bash](https://www.gnu.org/software/bash/)) scripts that can be used to plot `StrainTensor.py` results. These scripts actualy use [GMT](http://gmt.soest.hawaii.edu/) to perform the plotting. The scripts are an efficient, ready-to-use
42+
By 'Plot Tools', we mean an array of shell ([Bash](https://www.gnu.org/software/bash/)) scripts that can be used to plot `StrainTensor.py` results. These scripts actualy use [GMT](http://gmt.soest.hawaii.edu/) to perform the plotting. The scripts are efficient, ready-to-use.
4343

44-
It is by no means mandatory to use these scripts to plot the results; users can use their own tools and/or scripts to do so. Actualy, this is a totaly independent part of the Project and can be skipped alltogether.
44+
It is by no means mandatory to use these scripts to plot the results; users can use their own tools and/or scripts to do so. Actually, this is a totaly independent part of the Project and can be skipped alltogether.
4545

4646
These scripts, are found under `StrainTool/plot`
4747

@@ -53,11 +53,11 @@ To install the Project, you will need:
5353

5454
* [python](https://www.python.org/downloads/); the installation has been tested under Versions 2.7 and 3.6 and both work fine.
5555
* [NumPy](http://www.numpy.org/); NumPy is the fundamental package for scientific computing with Python.
56-
* [SciPy](https://www.scipy.org/); SciPy is a Python-based ecosystem of open-source software for mathematics, science, and engineering. Actualy, we are only using the [SciPy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html) and [SciPy.spatial](https://docs.scipy.org/doc/scipy/reference/spatial.html) modules.
56+
* [SciPy](https://www.scipy.org/); SciPy is a Python-based ecosystem of open-source software for mathematics, science, and engineering. Actually, we are only using the [SciPy.linalg](https://docs.scipy.org/doc/scipy/reference/linalg.html) and [SciPy.spatial](https://docs.scipy.org/doc/scipy/reference/spatial.html) modules.
5757

5858
Both `NumPy` and `SciPy` have extended installation guides for most, if not all, operating systems.
5959

60-
To use the [Plot Tools](#plot_tools_pck) bundle, you must have [GMT](http://gmt.soest.hawaii.edu/) (> 5.0.0) installed, allong with a variety of UNIX-based tools. If you are on a UNIX/Linux operating system, most or all of them are pre-installed.
60+
To use the [Plot Tools](#plot_tools_pck) bundle, you must have [GMT](http://gmt.soest.hawaii.edu/) (> 5.0.0) installed, along with a variety of UNIX-based tools. If you are on a UNIX/Linux operating system, most or all of them are pre-installed.
6161

6262
## Installation Procedure
6363

@@ -74,14 +74,14 @@ That's it! The package modules should now be in place and you should be able to
7474

7575
### Installation tests
7676

77-
The following scenarios have been tested to validatethe installation procedure
77+
The following scenarios have been tested to validate the installation procedure
7878

7979
| OS |Python 2.7 | Python 3.6 | GMT 5.2 | GMT 5.4
8080
|:----------:|:------------------:|:------------------:|:------------------:|:------------------:|
8181
| Fedora | :white_check_mark: | | :white_check_mark: | |
8282
| Manjaro | | :white_check_mark: | :white_check_mark: | |
8383
| Ubuntu | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
84-
| Windows 10 | :white_check_mark: | | | |
84+
| Windows 10 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
8585

8686

8787
## Example
@@ -104,7 +104,7 @@ Under `data/` you will find the "reference" output files for checking, named `st
104104

105105
$> ./StrainTensor.py [...] --help
106106

107-
will show the help message on screen). Users can controll `StrainTensor.py`'s behaviour via a variety of available switches.
107+
will show the help message on screen). Users can control `StrainTensor.py`'s behaviour via a variety of available switches.
108108

109109
## Basic Usage
110110

@@ -148,13 +148,13 @@ The whole list of available options, is:
148148

149149
For example, the command we used on the [Example](#straintensor_prg_example) section:
150150

151-
$> ./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
151+
$> ./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
152152

153153
meant that we are estimating strain tensor parameters for the region within min/max longtitude: 18.75/30.25 degrees and min/max latitude: 32.75/42.25 degrees. We are seperating the region into cells of size 0.5 degrees and estimating one strain tensor in each cell centre (aka the first cell centre is $lon = lon_{min} + lon_{step}/2 = 18.75 + 0.5/2=19.0deg.$ and $lat = lat_{min} + lat_{step}/2 = 32.75 + 0.5/2 = 33.0deg.$, then next one will be at lon=19.5, lat=33.5, etc...). To estimate each strain tensor, the program will search for a "optimal" D coefficient within the range [1, 500) km with a step of 1km. This "optimal" D will be found when the condition $W = \sum_{n=1}^{\#sta*2} Z(i)*L(i) \geq W_t$ is met. The stations that will be used for the calculations are only those that fall within the specified longtitude/latitude range. For more information, see [Background and Algorithms](#bck_and_algorithms) section.
154154

155155
## Input Files
156156

157-
To perform the computations, `StrainTensor.py` needs an input file, that holds input data. Usually, this implies a list of GPS/GNSS stations with their ellipsoidal coordinates (aka longtitude and latitude) and their respective tectonic velocities (usually estimated using position time-series) allong with the corresponding standard deviation values. The format of these files, should follow the convention:
157+
To perform the computations, `StrainTensor.py` needs an input file, that holds input data. Usually, this implies a list of GPS/GNSS stations with their ellipsoidal coordinates (aka longtitude and latitude) and their respective tectonic velocities (usually estimated using position time-series) along with the corresponding standard deviation values. The format of these files, should follow the convention:
158158

159159
<pre id="block-samp" <samp=""> station-name longtitude latitude Ve Vn SigmaVe SigmaVn Sne time-span
160160
string deg. deg. mm/yr mm/yr mm/yr mm/yr / dec. years</pre>
@@ -171,7 +171,7 @@ Results of `StrainTensor.py` are recorded in the following three files:
171171
The columns of the file are structured as below:
172172

173173
<pre id="block-samp" <samp="">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
174-
deg deg mm/yr mm/yr marcsec/yr nstrain/yr nstrain/yr nstrain/yr nstrain/yr nstrain/yr nstrain/yr deg. nstrain/yr nstrain/yr
174+
deg deg mm/yr mm/yr deg/Myr nstrain/yr nstrain/yr nstrain/yr nstrain/yr nstrain/yr nstrain/yr deg. nstrain/yr nstrain/yr
175175
</pre>
176176

177177
* **station_info.dat :** Stations' data used for the calculation of strain tensor are written at htis file. Format is:
@@ -181,7 +181,7 @@ Code Longtitude Latitude Ve Vn dVe dVn
181181
string deg deg mm/yr
182182
</pre>
183183

184-
* **StrainTensor.out :** Parameters used to modigy grid, calculate Strain tensors etc.
184+
* **StrainTensor.out :** Parameters used to modify grid, calculate Strain tensors etc.
185185

186186
# How to use Plot Tools
187187

@@ -196,8 +196,17 @@ All of the scripts need the file named `default-param` to be in the same folder.
196196
<pre id="block-samp" <samp="">
197197
pth2inptf=../data/ # set default folder for input files (strain_info.dat, strain_stats.dat, station_info.dat)
198198
west, east, south, north, projscale, frame, sclength: set region parameters
199+
200+
PAPER_SIZE="30cx30c" : set custom paper size (width x height)
201+
202+
vscmagn=20 : magnitude of horizontal arrow scale
203+
VSC=0.05 : Horizontal velocity scale
204+
205+
strscmagn=100 : set magnitude of principal axes scale
199206
STRSC=0.01 : set principal axis plot scale
207+
200208
ROTSC=.7 : set rotational rates plot scale
209+
ROT_wedge_mag=1 : set magnitude of rotational 1-wedge.
201210
</pre>
202211

203212
**gmtstrainplot.sh options:**
@@ -229,7 +238,7 @@ Other options:
229238
-h | --help : help menu
230239
</pre>
231240

232-
For exanple, to plot the principal axis fo strain rates for the example case above you can use the following command:
241+
For example, to plot the principal axis fo strain rates for the example case above you can use the following command:
233242

234243
$> ./gmtstrainplot.sh -jpg -str strain_info.dat -psta -l
235244

@@ -259,7 +268,7 @@ Other options:
259268
-h | --help : help menu
260269
</pre>
261270

262-
For exanple, to plot the principal axis fo strain rates for the example case above you can use the following command:
271+
For example, to plot the principal axis fo strain rates for the example case above you can use the following command:
263272

264273
$> ./gmtstatsplot.sh -jpg -stats strain_stats.dat --stats-stations -leg -o output_stats-stations
265274

StrainWebTool/config.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

StrainWebTool/run.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

StrainWebTool/tmp/input.txt.tmp

Lines changed: 0 additions & 3 deletions
This file was deleted.

StrainWebTool/tmp/invalid-input.txt.tmp

Lines changed: 0 additions & 4 deletions
This file was deleted.

bin/StrainTensor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
############################################## ploting
2121
from scipy.spatial import Delaunay
2222

23-
Version = 'StrainTensor.py Version: 1.0-rc3.0'
23+
Version = 'StrainTensor.py Version: 1.0-rc4.0'
2424

2525
def cut_rectangle(xmin, xmax, ymin, ymax, sta_lst, sta_list_to_degrees=False):
2626
new_sta_lst = []
@@ -229,7 +229,7 @@ class myFormatter(
229229
##+ If cutting out-of-limits stations option is set, or method is veis, then
230230
##+ only keep the stations that fall within it.
231231
## The region coordinates (min/max pairs) should be given in decimal degrees.
232-
if args.region:
232+
if 'region' in args:
233233
try:
234234
lonmin, lonmax, latmin, latmax = [ float(i) for i in args.region.split('/') ]
235235
if args.cut_outoflim_sta or args.method == 'veis':
@@ -245,7 +245,7 @@ class myFormatter(
245245
print('[ERROR] Failed to parse region argument \"{:}\"'.format(args.region), file=sys.stderr)
246246

247247
## Filter out stations that are never going to be used. This is an opt!
248-
if args.region and not args.method == 'veis' and not args.cut_outoflim_sta:
248+
if 'region' in args and not args.method == 'veis' and not args.cut_outoflim_sta:
249249
vprint('[DEBUG] Filtering stations based on their distance from region barycentre.')
250250
Napr = len(sta_list_ell)
251251
mean_lon, mean_lat = radians(lonmin+(lonmax-lonmin)/2e0), radians(latmin+(latmax-latmin)/2e0)
@@ -288,7 +288,7 @@ class myFormatter(
288288
fout = open('strain_info.dat', 'w')
289289
vprint('[DEBUG] Strain info written in file: {}'.format('strain_info.dat'))
290290
print('{:^9s} {:^9s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s}'.format('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'), file=fout)
291-
print('{:^9s} {:^9s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s}'.format('deg', 'deg', 'mm/yr', 'mm/yr', 'marcsec/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'deg.', 'nstrain/yr', 'nstrain/yr'), file=fout)
291+
print('{:^9s} {:^9s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s} {:^15s}'.format('deg', 'deg', 'mm/yr', 'mm/yr', 'deg/Myr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'nstrain/yr', 'deg.', 'nstrain/yr', 'nstrain/yr'), file=fout)
292292

293293
## Compute only one Strain Tensor, at the region's barycenter; then exit.
294294
if args.one_tensor:
@@ -305,7 +305,7 @@ class myFormatter(
305305
##+ is not passed in, the grid.generate_grid will transform lon/lat pairs
306306
##+ to degrees and produce a grid from extracting min/max crds from the
307307
##+ station list.
308-
if args.region:
308+
if 'region' in args:
309309
grd = pystrain.grid.Grid(lonmin, lonmax, args.x_grid_step, latmin, latmax, args.y_grid_step)
310310
else:
311311
grd = pystrain.grid.generate_grid(sta_list_ell, args.x_grid_step, args.y_grid_step, True)

plot/default-param

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ outfile=output.ps
1212
# #colormaps
1313
# landcpt=land_man.cpt
1414
# bathcpt=bath_man.cpt
15-
15+
PAPER_SIZE="30cx30c" # width x height
1616

1717
# //////////////////////////////////////////////////////////////////////////////
1818
# Set default REGION
@@ -28,16 +28,17 @@ sclength=100
2828

2929
logo_pos="BL/.1c/.1c"
3030

31-
# scale position parameters for velocities
32-
vsclon=22.34
33-
vsclat=37.68
31+
# scale parameters for velocities
32+
# vsclon=22.34 #delete
33+
# vsclat=37.68 #delete
3434
vscmagn=20
3535
VSC=0.05
3636

3737
strscmagn=100
3838
STRSC=.0080
39-
ROTSC=.7
40-
strsclon=20.4
41-
strsclat=36.3
39+
ROTSC=.65
40+
ROT_wedge_mag=1 #(deg/My)
41+
# strsclon=20.4 #delete
42+
# strsclat=36.3 #delete
4243

4344
legendc="-Jx1i -R0/8/0/8 -Dx20.5c/12.6c+w5c/4.6c+jBL"

0 commit comments

Comments
 (0)