[docs]defnmr_peaks_df_1d(zip_file:bytes,*,peak_threshold:float=1e4,)->pl.DataFrame:"""Exctact peaks from a zip of multiple Bruker NMR spectra. Examples: * :ref:`Getting an NMR peak data frame <getting-peak-df>` Parameters: zip_file: The content zip file containing Bruker data. peak_threshold: Minimum peak height for positive peaks. Returns: The peaks as a polars data frame. """withtempfile.TemporaryDirectory()astmp_:tmp=Path(tmp_)zipfile.ZipFile(BytesIO(zip_file)).extractall(tmp)ppms=[]volumes=[]spectra=[]forbinary_fileintmp.glob("**/1r"):spectrum_dir=binary_file.parentspectrum_label=str(spectrum_dir.relative_to(tmp))forpeakin_pick_peaks(spectrum_dir,peak_threshold):ppms.append(peak.ppm)volumes.append(peak.integral)spectra.append(spectrum_label)returnpl.DataFrame({"spectrum":spectra,"ppm":ppms,"integral":volumes,})