Skip to content

Commit d36c1f3

Browse files
committed
update doc & fig
1 parent 6f1143c commit d36c1f3

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

JASPE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# ============================================================================ #
33
# #
44
# JASPE script #
5-
# JASPE stands for Just Another Stereoplot Python Environment #
5+
# JASPE stands for Just Another Stereoplot (in a) Python Environment #
66
# #
77
# Copyright (c) 2017-present Marco A. Lopez-Sanchez #
88
# #

README.md

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,43 @@
11
# JASPE
22

3-
**JASPE** stands for **J**ust **A**nother **S**tereoplot<sup>1</sup> **P**ython **E**nvironment. This is a pet project that I develop at my own pace and according to my needs. The script is therefore not primarily intended for general use but my own. You should not expect updates, new features, or bug fixes in reasonable times, nor can I assure you that the project will be abandoned for a large period of time. My main goal with this is to include stereographic/equal-area projections in my Python workflow and learn. If you are looking for a software specifically dedicated to this task there are other options out there, for example [here](http://www.geo.cornell.edu/geology/faculty/RWA/programs/stereonet.html), [here](http://www.frederickvollmer.com/orient/), or [here](http://www.igc.usp.br/index.php?id=openstereo). In any case, if you decide to use it or want to access the source code out of curiosity, do so at your own risk and responsibility downloading the script [here](https://github.com/marcoalopez/JASPE/releases). You can also fork the project on GitHub since it is free and open-source.
3+
**JASPE** stands for **J**ust **A**nother **S**tereoplot*§* **P**ython **E**nvironment. This is a pet project that I develop at my own pace and according to my needs. The script is therefore not primarily intended for general use but my own. You should not expect updates, new features, or bug fixes in reasonable times, nor can I assure you that the project will be abandoned for a large period of time. My main goal with this is to include stereographic/equal-area projections in my Python workflow and learn. If you are looking for a software specifically dedicated to this task there are other options out there, for example [here](http://www.geo.cornell.edu/geology/faculty/RWA/programs/stereonet.html), [here](http://www.frederickvollmer.com/orient/), or [here](http://www.igc.usp.br/index.php?id=openstereo). In any case, if you decide to use it or want to access the source code out of curiosity, do so at your own risk and responsibility downloading the script [here](https://github.com/marcoalopez/JASPE/releases). You can also fork the project on GitHub since it is free and open-source.
44

5-
So far, the script only performs very basic tasks. One function tweaks the default features of matplotlib plots (i.e. the standard Python plotting library) to generate single or multiple stereoplots, another is for importing tabular-like data, and the rest to transform between different reference frames; from spherical to equal-area or stereographic (equal-angle) coordinates or from spherical to cartesian coordinates and vice versa.
5+
So far, the script only performs basic tasks. One function tweaks the default features of matplotlib plots (i.e. the standard Python plotting library) to generate single or multiple stereoplots, another is for importing tabular-like data, and the rest to transform between different reference frames; from spherical to equal-area or stereographic (equal-angle) coordinates or from spherical to cartesian coordinates and vice versa.
66

7-
> <sup>1</sup>*As stated above, the JASPE script is intended to produce both stereographic (Wulff) and equal-area (a.k.a. Schmidt net or Lambert azimuthal) projections. I chose the word **stereoplot** because is very familiar in geosciences and used by geoscientists to refer, somewhat loosely, to both projections. Strictly speaking, the equal-area projection is not a stereographic projection. So if you feel picky, exchange the word **Stereoplot** for **Schmidt net** and the acronym JASPE will remain the same.*
7+
> *§ As stated above, the JASPE script is intended to produce both stereographic (Wulff) and equal-area (a.k.a. Schmidt net or Lambert azimuthal) projections. I chose the word **stereoplot** because is very familiar in geosciences and used by geoscientists to refer, somewhat loosely, to both projections. Strictly speaking, the equal-area projection is not a stereographic projection. So if you feel picky, exchange the word **Stereoplot** for **Schmidt net plot** and the acronym JASPE will remain the same.*
88
9-
## Quick examples
9+
## Requirements
1010

11+
The script requires Python 3.5 or higher and the scientific libraries Numpy (1.11 or higher), Matplotlib (2.0 or higher) and Pandas. For this, we recommend installing the [Continuum Anaconda](https://store.continuum.io/cshop/anaconda/) or the [Enthought Canopy](https://www.enthought.com/products/canopy/) and use the Spyder or Canopy IDEs respectively.
12+
13+
## Quick examples (v0.3 or higher)
14+
15+
### Plot data
1116
```python
1217
# Create a simple stereoplot
1318
fig, ax = stereoplot()
1419

1520
# Plot some data using the function plot_data
16-
plot_data(180, 45, ax) # by default this is an equal-area projection
17-
plot_data(180, 45, ax, form='angle') # plot in equal-angle projection
21+
plot_eq_area(ax, 180, 45) # plot in equal-area projection
22+
plot_eq_angle(ax, 180, 45) # plot in equal-angle projection
1823
```
19-
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/one_plot.png)
24+
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/JASPE_Fig_1.png)
2025

26+
### Plot a small dataset defining the features of the markers
2127
```python
22-
# Create a figure with two stereos (1 row * 2 columns)
23-
fig, (ax1, ax2) = stereoplot(nrows=1, ncols=2)
24-
25-
# plot linear data in the first stereo (ax1)
28+
# Create dataset
2629
azimuths = [0, 45, 90, 135, 180, 225, 270, 315, 360]
2730
dips = [0, 10, 20, 30, 40, 50, 70, 80, 90]
28-
plot_data(azimuths, dips, ax1)
2931

30-
# plot linear data from a txt file in the second stereo (ax2)
31-
## import tabular-like data from text files. The function will ask you for
32-
## the location of the file through a file selection dialog
32+
# plot
33+
fig, ax = stereoplot() # create plot
34+
plot_eq_area(ax, azimuths, dips, marker='h', color='C3', markersize=9)
35+
```
36+
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/JASPE_Fig_2.png)
37+
38+
### Import tabular-like data from a text file and plot them
39+
```python
40+
# Import data. The function will ask you for the location of the file through a file selection dialog
3341
dataset = import_data()
3442

3543
Trend Plunge Type
@@ -46,14 +54,20 @@ Trend Plunge Type
4654
110 352.0 26.0 C
4755
111 355.0 24.0 C
4856

49-
## This time we will use matplotlib syntax instead of using the plot_data funtion
50-
## (this is the way to go if you want to control all the figure aesthetics)
57+
plot_eq_area(ax, dataset['Trend'], dataset['Plunge'], marker='o', markersize=8, label='Kamb (1959) data')
58+
ax.legend() # add legend
59+
```
60+
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/JASPE_Fig_3.png)
61+
62+
### Create plots with multiple stereos
63+
```python
64+
# Create a figure with two stereos (1 row * 2 columns)
65+
fig, (ax1, ax2) = stereoplot(nrows=1, ncols=2)
5166

52-
### Transform from spherical coordinates to equal-area coordinates
53-
azimuths, dips = sph_to_eq_area(dataset['Trend'], dataset['Plunge'])
67+
# plot linear data in the left (ax1) stereo
68+
plot_eq_area(ax1, azimuths, dips)
5469

55-
### Second, plot using matplotlib syntax
56-
ax2.plot(azimuths, dips, 'h', color='C3', markersize=9, label='Kamb (1959) data')
57-
ax2.legend() # add legend
70+
# plot Kamb data in the right (ax2) stereo
71+
plot_eq_area(ax2, dataset['Trend'], dataset['Plunge'], color='C3')
5872
```
59-
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/example.png)
73+
![](https://raw.githubusercontent.com/marcoalopez/JASPE/master/figs/JASPE_Fig_4.png)

figs/JASPE_Fig_4.png

-2.13 KB
Loading

0 commit comments

Comments
 (0)