Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Keitel
gridcorner
Commits
13a069bc
Commit
13a069bc
authored
Dec 14, 2017
by
Gregory Ashton
Browse files
Rename to gridcorner
parent
401a0268
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
13a069bc
...
@@ -12,7 +12,7 @@ Generating some fake data and plotting:
...
@@ -12,7 +12,7 @@ Generating some fake data and plotting:
```
python
```
python
import
numpy
as
np
import
numpy
as
np
import
projection_matrix.projection_matrix
as
pmp
import
gridcorner
# Generate example data
# Generate example data
x
=
np
.
linspace
(
0
,
1
,
50
)
x
=
np
.
linspace
(
0
,
1
,
50
)
...
@@ -27,8 +27,8 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
...
@@ -27,8 +27,8 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
+
np
.
exp
(
-
(
Y
-
y0
)
**
2
/
sigmay
**
2
)
+
np
.
exp
(
-
(
Y
-
y0
)
**
2
/
sigmay
**
2
)
+
np
.
exp
(
-
(
Z
-
z0
)
**
2
/
sigmaz
**
2
))
+
np
.
exp
(
-
(
Z
-
z0
)
**
2
/
sigmaz
**
2
))
fig
,
axes
=
pmp
(
fig
,
axes
=
gridcorner
.
gridcorner
(
D
,
xyz
=
[
x
,
y
,
z
],
labels
=
[
'x'
,
'y'
,
'z'
,
'D'
],
projection
=
np
.
max
)
D
,
xyz
=
[
x
,
y
,
z
],
labels
=
[
'x'
,
'y'
,
'z'
,
'D'
],
projection
=
'log_mean'
)
fig
.
savefig
(
'example'
)
fig
.
savefig
(
'example'
)
```
```


...
...
example.png
View replaced file @
401a0268
View file @
13a069bc
70.7 KB
|
W:
|
H:
66.8 KB
|
W:
|
H:
2-up
Swipe
Onion skin
example.py
View file @
13a069bc
import
numpy
as
np
import
numpy
as
np
import
projection_matrix
as
pmp
import
gridcorner
# Generate example data
# Generate example data
x
=
np
.
linspace
(
0
,
1
,
50
)
x
=
np
.
linspace
(
0
,
1
,
50
)
...
@@ -15,10 +15,7 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
...
@@ -15,10 +15,7 @@ D = (np.exp(-(X-x0)**2/sigmax**2)
+
np
.
exp
(
-
(
Y
-
y0
)
**
2
/
sigmay
**
2
)
+
np
.
exp
(
-
(
Y
-
y0
)
**
2
/
sigmay
**
2
)
+
np
.
exp
(
-
(
Z
-
z0
)
**
2
/
sigmaz
**
2
))
+
np
.
exp
(
-
(
Z
-
z0
)
**
2
/
sigmaz
**
2
))
fig
,
axes
=
pmp
.
projection_matrix
(
fig
,
axes
=
gridcorner
.
gridcorner
(
D
,
xyz
=
[
x
,
y
,
z
],
labels
=
[
'x'
,
'y'
,
'z'
,
'D'
],
D
,
xyz
=
[
x
,
y
,
z
],
labels
=
[
'x'
,
'y'
,
'z'
,
'D'
],
projection
=
'log_mean'
)
projection
=
pmp
.
slice_max
,
#projection=np.max
)
fig
.
savefig
(
'example'
)
fig
.
savefig
(
'example'
)
projection_matrix/projection_matrix
.py
→
gridcorner
.py
View file @
13a069bc
...
@@ -47,9 +47,9 @@ def idx_array_slice(D, axis, slice_idx):
...
@@ -47,9 +47,9 @@ def idx_array_slice(D, axis, slice_idx):
return
res
return
res
def
projection_matrix
(
D
,
xyz
,
labels
=
None
,
projection
=
'max_slice'
,
def
gridcorner
(
D
,
xyz
,
labels
=
None
,
projection
=
'max_slice'
,
max_n_ticks
=
4
,
max_n_ticks
=
4
,
factor
=
3
,
whspace
=
0.05
,
**
kwargs
):
factor
=
3
,
whspace
=
0.05
,
**
kwargs
):
""" Generate a
projection matrix
plot
""" Generate a
grid corner
plot
Parameters
Parameters
----------
----------
...
@@ -66,7 +66,7 @@ def projection_matrix(D, xyz, labels=None, projection='max_slice',
...
@@ -66,7 +66,7 @@ def projection_matrix(D, xyz, labels=None, projection='max_slice',
If a string, one of `{"log_mean", "max_slice"} to use inbuilt functions
If a string, one of `{"log_mean", "max_slice"} to use inbuilt functions
to calculate either the logged mean or maximum slice projection. Else
to calculate either the logged mean or maximum slice projection. Else
a function to use for projection, must take an `axis` argument. Default
a function to use for projection, must take an `axis` argument. Default
is `
projection_matrix
.max_slice()`, to project out a slice along the
is `
gridcorner
.max_slice()`, to project out a slice along the
maximum.
maximum.
max_n_ticks: int
max_n_ticks: int
Number of ticks for x and y axis of the `pcolormesh` plots
Number of ticks for x and y axis of the `pcolormesh` plots
...
...
projection_matrix/__init__.py
deleted
100644 → 0
View file @
401a0268
from
.projection_matrix
import
projection_matrix
setup.py
View file @
13a069bc
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
from
distutils.core
import
setup
from
distutils.core
import
setup
setup
(
name
=
'
projection_matrix
'
,
setup
(
name
=
'
gridcorner
'
,
version
=
'0.1'
,
version
=
'0.1'
,
author
=
'Gregory Ashton'
,
author
=
'Gregory Ashton'
,
author_email
=
'gregory.ashton@ligo.org'
,
author_email
=
'gregory.ashton@ligo.org'
,
p
ackages
=
[
'projection_matrix
'
],
p
y_modules
=
[
'gridcorner
'
],
)
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment