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
Merge requests
!44
Pos to delay
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Pos to delay
pos_to_delay
into
master
Overview
0
Commits
3
Pipelines
0
Changes
2
Merged
Laurent Mercadier
requested to merge
pos_to_delay
into
master
5 years ago
Overview
0
Commits
3
Pipelines
0
Changes
2
Expand
utility functions for laser data processing
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
ac69b994
3 commits,
5 years ago
2 files
+
27
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Laser_utils.py
0 → 100644
+
26
−
0
Options
def
positionToDelay
(
pos
,
origin
=
0
,
invert
=
False
,
reflections
=
1
):
'''
converts a motor position in mm into optical delay in picosecond
Inputs:
pos: array-like delay stage motor position
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
*
(
pos
-
origin
)
*
x
/
c_
def
degToRelPower
(
x
,
theta0
=
0
):
'''
converts a half-wave plate position in degrees into relative power
between 0 and 1.
Inputs:
x: array-like positions of half-wave plate, in degrees
theta0: position for which relative power is zero
Output:
array-like relative power
'''
return
np
.
sin
(
2
*
(
x
-
theta0
)
*
np
.
pi
/
180
)
**
2
Loading