Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
onlineXPCS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dataAnalysis
onlineXPCS
Commits
18144b0f
Commit
18144b0f
authored
11 months ago
by
Jakobsen, Mads Bregenholt
Browse files
Options
Downloads
Patches
Plain Diff
added auto generated cython c file output to gitignore
parent
4a0ea0ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
testing/test.py
+17
-6
17 additions, 6 deletions
testing/test.py
with
18 additions
and
7 deletions
.gitignore
+
1
−
1
View file @
18144b0f
...
@@ -8,4 +8,4 @@ testing/abc.png
...
@@ -8,4 +8,4 @@ testing/abc.png
*.egg-info
*.egg-info
fastXPCS/fastXPCS/cython/welford.c
fastXPCS/fastXPCS/cython/welford.c
fastXPCS/fastXPCS/cython/fxpcs_sparse.c
fastXPCS/fastXPCS/cython/fxpcs_sparse.c
fastXPCS/fastXPCS/cython/dense.c
fastXPCS/fastXPCS/cython/dense.c
\ No newline at end of file
This diff is collapsed.
Click to expand it.
testing/test.py
+
17
−
6
View file @
18144b0f
...
@@ -10,6 +10,8 @@ from fastXPCS.algos import TTCdata, do_sparse_train
...
@@ -10,6 +10,8 @@ from fastXPCS.algos import TTCdata, do_sparse_train
from
fastXPCS.fxpcs_sparse
import
sparsify
,
sparsify2
from
fastXPCS.fxpcs_sparse
import
sparsify
,
sparsify2
from
PIL
import
Image
from
PIL
import
Image
from
function_call
import
doXPCS
;
dataShape
=
(
352
,
512
,
128
)
dataShape
=
(
352
,
512
,
128
)
photonEnergy
=
13.3
# in ADU
photonEnergy
=
13.3
# in ADU
# this is a function that generates a dummy panel dataset given a shape
# this is a function that generates a dummy panel dataset given a shape
...
@@ -47,7 +49,6 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
...
@@ -47,7 +49,6 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
p
=
[
q
**
0
,
q
**
1
,
q
**
2
,
q
**
3
,
q
**
4
,
q
**
5
,
q
**
6
]
/
np
.
sum
([
q
**
0
,
q
**
1
,
q
**
2
,
q
**
3
,
q
**
4
,
q
**
5
,
q
**
6
])),(
shape
[
1
],
shape
[
2
]))
p
=
[
q
**
0
,
q
**
1
,
q
**
2
,
q
**
3
,
q
**
4
,
q
**
5
,
q
**
6
]
/
np
.
sum
([
q
**
0
,
q
**
1
,
q
**
2
,
q
**
3
,
q
**
4
,
q
**
5
,
q
**
6
])),(
shape
[
1
],
shape
[
2
]))
def
evolveImageFrom
(
image
,
c
=
correlationPerBunch
):
def
evolveImageFrom
(
image
,
c
=
correlationPerBunch
):
print
(
c
)
randMask
=
np
.
reshape
(
np
.
random
.
choice
(
randMask
=
np
.
reshape
(
np
.
random
.
choice
(
[
0
,
1
],
[
0
,
1
],
size
=
numPixelPrImage
,
size
=
numPixelPrImage
,
...
@@ -58,7 +59,7 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
...
@@ -58,7 +59,7 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
data
[
0
,:,:]
=
np
.
reshape
(
getRandomImage
(),
(
shape
[
1
],
shape
[
2
]))
data
[
0
,:,:]
=
np
.
reshape
(
getRandomImage
(),
(
shape
[
1
],
shape
[
2
]))
for
pulseNr
in
range
(
1
,
dataShape
[
0
]):
for
pulseNr
in
range
(
1
,
dataShape
[
0
]):
correlationPerBunch
+=
(
1
-
correlationPerBunch
)
*
0.
0
01
correlationPerBunch
+=
(
1
-
correlationPerBunch
)
*
0.01
data
[
pulseNr
,
:,
:]
=
evolveImageFrom
(
data
[
pulseNr
-
1
,:,:],
correlationPerBunch
)
data
[
pulseNr
,
:,
:]
=
evolveImageFrom
(
data
[
pulseNr
-
1
,:,:],
correlationPerBunch
)
# if we do not returned photnoized data, then add a gaussian random variable
# if we do not returned photnoized data, then add a gaussian random variable
...
@@ -66,7 +67,7 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
...
@@ -66,7 +67,7 @@ def getDummyData(shape, chanceOfPhotonPerPixel = 0.01, correlationPerBunch=0.5,
data
+=
sigma
*
np
.
random
.
standard_normal
(
size
=
shape
)
data
+=
sigma
*
np
.
random
.
standard_normal
(
size
=
shape
)
data
*=
energy
data
*=
energy
return
data
return
data
.
astype
(
np
.
float32
)
data
=
getDummyData
(
data
=
getDummyData
(
...
@@ -142,9 +143,19 @@ t = time.time()
...
@@ -142,9 +143,19 @@ t = time.time()
out
=
xpcs
(
data
,
photonEnergy
)
out
=
xpcs
(
data
,
photonEnergy
)
elapsed
=
time
.
time
()
-
t
elapsed
=
time
.
time
()
-
t
print
(
f
"
elapsed
{
elapsed
}
"
)
print
(
f
"
elapsed
{
elapsed
}
"
)
print
(
out
.
shape
)
print
(
np
.
min
(
out
))
print
(
np
.
max
(
out
))
print
(
"
my xpcs
"
)
output
=
np
.
zeros
(
shape
=
(
2
,
2
),
dtype
=
np
.
float32
)
errorCode
=
doXPCS
(
data
,
output
)
print
(
data
)
print
(
output
)
print
(
output
[
0
][
0
])
print
(
output
[
0
][
1
])
print
(
output
[
1
][
0
])
print
(
output
[
1
][
1
])
print
(
output
.
ravel
())
def
plot
(
data
):
def
plot
(
data
):
data
=
data
.
astype
(
np
.
float32
)
data
=
data
.
astype
(
np
.
float32
)
cmap
=
pl
.
get_cmap
(
'
viridis
'
)
cmap
=
pl
.
get_cmap
(
'
viridis
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment