Skip to main content

Python interface for the Rohde-Schwarz FSL Spectrum Analyzer

Project description

RS FSL ‒ Python interface for the Rohde-Schwarz FSL Spectrum Analyzer

Code style: black

Installation

To install rs_fsl, run

pip install rs_fsl

If you plan to make changes to the code, use

git clone https://github.com/bleykauf/beamwalk.git
cd beamwalk
pip install .

Usage

from rs_fsl import FSL

Connecting to the instrument. If the RS FSL is not connected to the phyics network, the address might be different and can be set manually with the addr keyword.

fsl = FSL(ip='141.20.46.198')

Successfully connected to Rohde&Schwarz,FSL-18,100193/018,2.30

Getting and setting parameters

Most parameters are implemented as properties in python, which means they can be read and written (getting and setting) in a consistent and simple way. If numerical values are provided, base units are used (seconds, hertz, decibel,...).

# Getting the current center frequency
fsl.freq_center

9000000000.0
# Changing it to 10 MHz by providing the numerical value 
fsl.freq_center = 10e6
# Verifying:
fsl.freq_center

10000000.0
# Changing it to 1 GHz by providing a string and verifying the result
fsl.freq_center = '9GHz'
fsl.freq_center

9000000000.0
# Setting the span to maximum
fsl.freq_span = '7GHz'

Reading a trace

We will read the current trace

x, y = fsl.read_trace()

Markers

Markers are implemented as their own class. You can create them like this:

m1 = fsl.create_marker()

Set peak exursion:

m1.peak_excursion = 3

Set marker to a specific position:

m1.x = 10e9

Find the next peak to the left and get the level:

m1.to_next_peak('left')
m1.y

-34.9349060059

Delta markers

Delta markers can be created by setting the appropriate keyword.

d2 = fsl.create_marker(is_delta_marker=True)
d2.name

'DELT2'

A example program

Program for measuring a beatnote

m1 = fsl.create_marker() # create marker 1

# Set standard settings, set to full span
fsl.continuous_sweep = False
fsl.freq_span = '18 GHz'
fsl.rbw = "AUTO"
fsl.vbw = "AUTO"
fsl.sweep_time = "AUTO"

# Perform a sweep on full span, set the marker to the peak and some to that marker
fsl.single_sweep()
m1.to_peak()
m1.zoom('20 MHz')

# take data from the zoomed-in region
fsl.single_sweep()
x, y = fsl.read_trace()

Authors

License

MIT License

Copyright © 2021 Bastian Leykauf

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rs_fsl-0.0.1.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

rs_fsl-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file rs_fsl-0.0.1.tar.gz.

File metadata

  • Download URL: rs_fsl-0.0.1.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for rs_fsl-0.0.1.tar.gz
Algorithm Hash digest
SHA256 31551285e09ffd64532a6303c4a61935f202a22e8d7a899fb3f5b8ba3dc3b02c
MD5 f58be042d4b551aa83149147dcf79f22
BLAKE2b-256 6e64d24900cfadef21ac565a96fc6954c2f84c6860bddd02898a57b5aa31ab7a

See more details on using hashes here.

File details

Details for the file rs_fsl-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rs_fsl-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for rs_fsl-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1940c53fb13b1a13d1a61160650582d0c5d1e5aa0fd3c141a0b1cef3e0dfdf15
MD5 25e27357652952c400b6494c51060588
BLAKE2b-256 363a81637a8f36e2458104bc8266a8f229952a2cc540c4505d2d73c930beda6b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page