Package: python-spectrometer
python-spectrometerThis package implements data acquisition, processing, and visualization for estimating power spectral densities usingWelch's method. It provides theSpectrometerclass that serves as a central interface which acquires and manges the data. Several processing steps can be applied to the raw timeseries data, for instance to convert from a voltage signal to an acceleration given a known calibration from a signal conditioning unit.To demonstrate the basic features, here is some example code using the Keysight DMMqcodesdriver for data acquisition:frompython_spectrometerimportSpectrometer,daqfromqcodes.instrument_drivers.Keysight.Keysight_34465A_submodulesimportKeysight_34465Admm=Keysight_34465A('dmm','some_tcpip_address')# Pre-defined functions that set up and execute a measurement using a DMMspect=Spectrometer(daq.qcodes.Keysight344xxA(dmm),procfn=lambdaV:V*1000,processed_unit='mV')settings={'f_min':0.1,'f_max':1000,'phase_of_the':'moon'}# any other settings or metadataspect.take('a comment',n_avg=5,**settings)spect.hide(0)spect.show('a comment')# same as spect.show(0)# Save and recall functionalityspect.serialize_to_disk('./foo')spect_loaded=Spectrometer.recall_from_disk('./foo')# read-only because no DAQ givenspect_loaded.show_keys()# (0, 'a comment')You can also play around with simulated noise (requiresqopt):frompython_spectrometerimportSpectrometer,daqspect=Spectrometer(daq.simulator.QoptColoredNoise(lambdaf,A,**_:A/f))spect.take('foobar',n_avg=10,n_seg=5,A=42)If you just want to use it you can install the latest "released" version viapython-mpipinstallpython-spectrometer[complete]However, this package profits from everybody's work and the releases are infrequent. Please make a development install
and contribute your changes. You can do this viapython-mpipinstall-egit+https://git.rwth-aachen.de/qutech/python-spectrometer.git#egg=python-spectrometer[complete]This will download the source code (i.e. clone the git repository) into a subdirectory of the./srcargument and link the files into your environment instead of copying them. If you are on Windows you can useSourceTreewhich is a nice GUI for git.
You can specify the source code directory with the--srcargument (which needs to be BEFORE-e):python-mpipinstall--srcsome_directory/my_python_source-egit+https://git.rwth-aachen.de/qutech/python-spectrometer.git#egg=python-spectrometer[complete]If you have already downloaded/cloned the package yourself you can usepython -m pip install -e .[complete].Please file an issue if any of these instructions does not work.TestsThere are some basic tests intests/as well as a couple ofdoctests.You can run the tests either viapython-mpytest--doctest-modulesor to check if everything works for a clean install (requires hatch to be installed)python-mhatchruntests:runDocumentationThe auto-generated documentation can be found atthe Gitlab Pages.To build the documentation locally, navigate todoc/and runmakehtmlorsphinx-build -b html source buildMake sure the dependencies are installed viapython-mpipinstall-e.[doc]in the top-level directory.To check if everything works for a clean install (requires hatch to be installed), runpython-mhatchrundoc:build