Commit 7f92e6bd authored by Sean's avatar Sean
Browse files

Allow SI prefixes in plotted op-amp frequency bounds

parent 9ebba6c8
......@@ -301,8 +301,8 @@ def library_show(paged):
help="Save image of current noise figure to file. Can be specified multiple times.")
@click.option("--save-gain-figure", type=click.File("wb", lazy=False), multiple=True,
help="Save image of open loop gain figure to file. Can be specified multiple times.")
@click.option("--fstart", type=float, default=1e0, show_default=True, help="Plot start frequency.")
@click.option("--fstop", type=float, default=1e9, show_default=True, help="Plot stop frequency.")
@click.option("--fstart", type=str, default="1", show_default=True, help="Plot start frequency.")
@click.option("--fstop", type=str, default="1G", show_default=True, help="Plot stop frequency.")
@click.option("--npoints", type=int, default=1000, show_default=True, help="Plot number of points.")
def library_search(query, sort_a0, sort_gbw, sort_delay, sort_vnoise, sort_vcorner, sort_inoise,
sort_icorner, sort_vmax, sort_imax, sort_sr, show_table, paged, save_data,
......
......@@ -14,6 +14,7 @@ from tabulate import tabulate
from .config import ZeroConfig
from .components import Resistor, Capacitor, Inductor, OpAmp, Input, Component, Node
from .format import Quantity
from .data import Series, Response, NoiseDensity, MultiNoiseDensity
LOGGER = logging.getLogger(__name__)
......@@ -834,7 +835,8 @@ class OpAmpGainPlotter(BodePlotter):
if any([param is None for param in (fstart, fstop, npoints)]):
raise ValueError("either frequencies, or all of fstart, fstop and npoints must be "
"specified")
frequencies = np.logspace(np.log10(fstart), np.log10(fstop), npoints)
frequencies = np.logspace(np.log10(Quantity(fstart)), np.log10(Quantity(fstop)),
npoints)
self.frequencies = np.array(frequencies)
def response(self, opamp):
......@@ -858,7 +860,8 @@ class OpAmpNoisePlotter(SpectralDensityPlotter, metaclass=abc.ABCMeta):
if any([param is None for param in (fstart, fstop, npoints)]):
raise ValueError("either frequencies, or all of fstart, fstop and npoints must be "
"specified")
frequencies = np.logspace(np.log10(fstart), np.log10(fstop), npoints)
frequencies = np.logspace(np.log10(Quantity(fstart)), np.log10(Quantity(fstop)),
npoints)
self.frequencies = np.array(frequencies)
@abc.abstractmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment