Last active
May 18, 2019 22:45
-
-
Save DavidLutton/9ec88be12dad07da660d217b75644aea to your computer and use it in GitHub Desktop.
Download s-param network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import lru_cache | |
import io | |
import requests | |
import skrf as rf | |
from matplotlib import pyplot as plt | |
rf.stylely() | |
def MiniCircuitsGetter(model): | |
r = requests.get(f'https://www.minicircuits.com/pages/s-params/{model}.zip') | |
return rf.NetworkSet.from_zip(io.BytesIO(r.content)) | |
# Use [0] to select 0 index Network, ... | |
MiniCircuitsNetwork = lru_cache(maxsize=32)(MiniCircuitsGetter) # lru_cache guidance from https://orbifold.xyz/local-lru.html | |
net = MiniCircuitsNetwork('ZVBP-4000-S+_S2P') | |
# print(MiniCircuitsNetwork.cache_info()) | |
net['3950-4050MHz'].plot_s_db() | |
def AnalogGetter(model): | |
r = requests.get(f'https://www.analog.com/media/en/simulation-models/s-parameters/{model}.zip') | |
return rf.NetworkSet.from_zip(io.BytesIO(r.content)) | |
# Use [0] to select 0 index Network, ... | |
AnalogNetwork = lru_cache(maxsize=32)(AnalogGetter) # lru_cache guidance from https://orbifold.xyz/local-lru.html | |
net = AnalogNetwork('HMC656') | |
# print(AnalogNetwork.cache_info()) | |
net.plot_s_db() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment