Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A python package for communicating with Bruker OPUS spectroscopy software and reading its binary file format.
brukeropus
is a Python package for interacting with Bruker's OPUS spectroscopy software. Currently, the package can
read OPUS data files and communicate/control OPUS through the DDE interface (e.g. for scripting measurement sequences).
brukeropus
can read the binary data files saved by OPUS. The parsing algorithm in this package is more complete than
previous efforts, with a goal to achieve 100% extraction accuracy.
OPUSFile
class (limited by disk I/O)OPUSFile
does not suit your needs)from brukeropus import read_opus
from matplotlib import pyplot as plt
opus_file = read_opus('file.0') # Returns an OPUSFile class
opus_file.print_parameters() # Pretty prints all metadata in the file to the console
if 'a' in opus_file.data_keys: # If absorbance spectra was extracted from file
plt.plot(opus_file.a.x, opus_file.a.y) # Plot absorbance spectra
plt.title(opus_file.sfm + ' - ' + opus_file.snm) # Sets plot title to Sample Form - Sample Name
plt.show() # Display plot
While all metadata can be be extracted as key: val pairs, the keys are stored as three characters (e.g. BMS, SRT, SRC) and are not particularly descriptive. This package has human readable labels for over 100 of these metadata keys, but it is not complete.
I have only tested this on ~5000 files generated in my lab (all very similiar) as well as a handful of files I've found online (most of which had some error when being read by other tools). This package is capable of reading all of those files, but thorough testing on a wide variety of files is incomplete.
brukeropus
, please open an issue with a description about the file and
what seems to be failing. Also provide a link for me to download the file. Make sure the file can be read by OPUS
first (i.e. if the file is corrupted and unreadable by OPUS then brukeropus
will not be able to read it either).brukeropus
can send commands and perform queries to an OPUS software instance through the DDE communication protocol.
OPUS must be open and logged in on the same PC where brukeropus
is called from to operate.
from brukeropus import opus, read_opus
from matplotlib import pyplot as plt
opus = Opus() # Connects to actively running OPUS software
apt_options = opus.get_param_options('apt') # Get all valid aperture settings
for apt in apt_options[2:-2]: # Loop over all but the two smallest and two largest aperature settings
filepath = opus.measure_sample(apt=apt, nss=10, unload=True) # Perform measurement and unload file from OPUS
data = read_opus(filepath) # Read OPUS file from measurement
plt.plot(data.sm.x, data.sm.y, label=apt) # Plot single-channel sample spectra
plt.legend()
plt.show()
Requirements
Optional
pip install brukeropus
FAQs
A python package for communicating with Bruker OPUS spectroscopy software and reading its binary file format.
We found that brukeropus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.