Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
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
Model registry
Operate
Environments
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
SCS
ToolBox
Commits
8ee61713
Commit
8ee61713
authored
5 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
Adds function to convert a delay stage motor position into time
parent
8dbf69dd
No related branches found
No related tags found
1 merge request
!44
Pos to delay
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Laser_utils.py
+15
-0
15 additions, 0 deletions
Laser_utils.py
__init__.py
+1
-0
1 addition, 0 deletions
__init__.py
with
16 additions
and
0 deletions
Laser_utils.py
0 → 100644
+
15
−
0
View file @
8ee61713
def
positionToDelay
(
data
,
key
,
origin
=
0
,
invert
=
False
,
reflections
=
1
):
'''
converts a motor position in mm into optical delay in picosecond
Inputs:
data: dataset containing delay stage motor position
key: key of the delay stage
origin: motor position of time zero in mm
invert: bool, inverts the sign of delay if True
reflections: number of bounces in the delay stage
Output:
delay in picosecond
'''
c_
=
299792458
*
1e-9
# speed of light in mm/ps
x
=
-
1
if
invert
else
1
return
2
*
reflections
*
(
data
[
key
]
-
origin
)
*
x
/
c_
\ No newline at end of file
This diff is collapsed.
Click to expand it.
__init__.py
+
1
−
0
View file @
8ee61713
...
...
@@ -2,3 +2,4 @@ from ToolBox.Load import *
from
ToolBox.xgm
import
*
from
ToolBox.XAS
import
*
from
ToolBox.knife_edge
import
*
from
ToolBox.Laser_utils
import
*
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