Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Calibration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Calibration
Commits
11b608c2
Commit
11b608c2
authored
Sep 06, 2019
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added "desired_freq_2_sfp_ch""function according to SFF8690 (see Table 4-3)
parent
9af53fe5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
itu_conversions.py
sw/lib/itu_conversions.py
+21
-0
No files found.
sw/lib/itu_conversions.py
View file @
11b608c2
...
...
@@ -51,3 +51,24 @@ def wavelength_2_itu(wavelength):
itu_channel
=
round
(
itu_channel
,
1
)
# round to 1 decimal
return
(
itu_channel
)
############################################################################
def
desired_freq_2_sfp_ch
(
desired_freq
,
first_freq
,
grid
):
"""
converts desired frequency into SFP channel number
input:
desired_freq <int> The desired freqency in Hz
first_freq <int> Lasers First Frequency in Hz
Following SFF8690 Table 4-3 the Lasers First Frequency
can be read from I2C 0xA2 page 2 Addr 132-135.
grid <int> Laser's minimum supported grid spacing in Hz
Following SFF8690 Table 4-3 the Lasers First Frequency
can be read from I2C 0xA2 page 2 Addr 140-141.
return:
sfp_ch <int> The number to set in the tunable SFP to obtain the
desired frequency, according the the equation given
in SFF8690
"""
return
(
int
(
1
+
(
desired_freq
-
first_freq
)
/
grid
))
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