Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
grp-svergun
galumph
Commits
db67ed54
Commit
db67ed54
authored
Feb 21, 2017
by
Chris Kerr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.embl.de:ckerr/galumph
parents
af542895
e2656907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
README.md
README.md
+27
-1
No files found.
README.md
View file @
db67ed54
# GALUMPH #
Calculate ALM (scattering amplitude decomposed into spherical harmonics) using GPU acceleration.
Calculate ALM (scattering amplitude decomposed into spherical harmonics)
at Hyperspeed
using GPU acceleration.
This is a preliminary implementation using PyOpenCL.
Example code:
```
python
import
numpy
as
np
import
Bio.PDB
import
periodictable
import
galumph
NS
=
4096
# Number of S values at which to calculate the scattering
smax
=
1.0
# Maximum S value
LMAX
=
63
# Maximum harmonic order to use for the calculations
## Initialise the S array and allocate the ALM storage on the GPU
s
=
np
.
linspace
(
0
,
smax
,
NS
)
atomalm
=
galumph
.
AtomAlm
(
LMAX
,
s
)
## Use Bio.PDB to read the structure and periodictable to calculate the atomic form factors
pdb
=
Bio
.
PDB
.
PDBParser
().
get_structure
(
"6lyz"
,
"6lyz.pdb"
)
xyz
=
np
.
array
([
aa
.
get_vector
().
get_array
()
for
aa
in
pdb
.
get_atoms
()])
ff
=
np
.
array
([
periodictable
.
elements
.
symbol
(
aa
.
element
).
xray
.
f0
(
s
)
for
aa
in
pdb
.
get_atoms
()])
## Run the GPU calculation
atomalm
.
add_many_atoms
(
xyz
,
ff
)
Icalc
=
atomalm
.
sum_intensity
()
```
\ No newline at end of file
Write
Preview
Markdown
is supported
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