Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Ion Trap Image Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Albert Mitjans I Coma
Ion Trap Image Analysis
Commits
e183381e
Commit
e183381e
authored
3 years ago
by
Albert Mitjans I Coma
Browse files
Options
Downloads
Patches
Plain Diff
save values in shared memory
parent
0a695b2a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
calibrate.py
+2
-2
2 additions, 2 deletions
calibrate.py
main.py
+3
-2
3 additions, 2 deletions
main.py
tools.py
+3
-2
3 additions, 2 deletions
tools.py
with
8 additions
and
6 deletions
calibrate.py
+
2
−
2
View file @
e183381e
...
@@ -21,8 +21,8 @@ def main():
...
@@ -21,8 +21,8 @@ def main():
pos
,
_
=
ion_positions
(
image
)
pos
,
_
=
ion_positions
(
image
)
user_2
=
input
(
"
Use (detected) dark ions for calibration? (y, [n])
"
)
user_2
=
input
(
"
Use (detected) dark ions for calibration? (y, [n])
"
)
if
user_2
in
(
"
y
"
,
"
yes
"
):
if
user_2
in
(
"
y
"
,
"
yes
"
):
read_factor
(
conn
)
dist_factor
=
read_factor
(
conn
)
pos
=
dark_ions
(
image
,
pos
)
pos
=
dark_ions
(
image
,
pos
,
dist_factor
)
pos
=
pos
[:,
1
]
pos
=
pos
[:,
1
]
if
len
(
pos
)
>
1
:
if
len
(
pos
)
>
1
:
...
...
This diff is collapsed.
Click to expand it.
main.py
+
3
−
2
View file @
e183381e
...
@@ -132,7 +132,7 @@ class Main:
...
@@ -132,7 +132,7 @@ class Main:
self
.
roundness
=
-
1
self
.
roundness
=
-
1
if
not
ion_cloud
:
if
not
ion_cloud
:
self
.
_processing
(
self
.
image
,
dist_factor
)
self
.
_processing
(
self
.
image
.
copy
()
,
dist_factor
)
# Update running time
# Update running time
self
.
running_time
=
time
.
time
()
-
self
.
init_time
self
.
running_time
=
time
.
time
()
-
self
.
init_time
...
@@ -140,9 +140,10 @@ class Main:
...
@@ -140,9 +140,10 @@ class Main:
self
.
init_time
=
time
.
time
()
self
.
init_time
=
time
.
time
()
# Save variables in self.memory
# Save variables in self.memory
self
.
_save_in_memory
()
self
.
num
+=
1
self
.
num
+=
1
self
.
sem
.
release
()
self
.
sem
.
release
()
time
.
sleep
(
0.1
)
def
_processing
(
self
,
image
,
dist_factor
):
def
_processing
(
self
,
image
,
dist_factor
):
self
.
coord
,
self
.
max_spot_size
=
ion_positions
(
image
)
self
.
coord
,
self
.
max_spot_size
=
ion_positions
(
image
)
...
...
This diff is collapsed.
Click to expand it.
tools.py
+
3
−
2
View file @
e183381e
...
@@ -403,8 +403,9 @@ def dark_ions(image, coord, dist_factor):
...
@@ -403,8 +403,9 @@ def dark_ions(image, coord, dist_factor):
coord
=
coord
[
coord
[:,
1
]
<
image
.
shape
[
1
]]
# remove points outside the image
coord
=
coord
[
coord
[:,
1
]
<
image
.
shape
[
1
]]
# remove points outside the image
if
loss
.
min
()
>
20
:
if
loss
.
min
()
>
20
:
warnings
.
warn
(
"
Loss is too high...
"
# warnings.warn("Loss is too high... "
"
Try calculating a new factor value using calibrate() function.
"
)
# "Try calculating a new factor value using calibrate() function.")
pass
return
coord
return
coord
...
...
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