fixes
This commit is contained in:
parent
3319e26d82
commit
b8b9035b34
2 changed files with 0 additions and 33 deletions
6
check.py
6
check.py
|
@ -1,12 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Created on Tue Apr 15 13:34:02 2025
|
|
||||||
|
|
||||||
@author: ziapkoff
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,30 +33,6 @@ def plot_spectrum(lambdas, intensities, title=''):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def plot_xy(file_path, plot=True):
|
|
||||||
try:
|
|
||||||
# Lecture du fichier .xy en utilisant pandas
|
|
||||||
data = pd.read_csv(file_path, delimiter=',', header=None, names=["x", "y"])
|
|
||||||
|
|
||||||
# Extraction des colonnes
|
|
||||||
x = data["x"]
|
|
||||||
y = data["y"]
|
|
||||||
|
|
||||||
# Tracer la deuxième colonne en fonction de la première
|
|
||||||
plt.figure(figsize=(10, 6),dpi = 600)
|
|
||||||
plt.plot(x, y, 'o-', markersize=2, label="Raw data")
|
|
||||||
|
|
||||||
# Ajout des labels et du titre
|
|
||||||
plt.xlabel(r'$\lambda$ (nm)')
|
|
||||||
plt.ylabel(r'$I^*$')
|
|
||||||
plt.legend()
|
|
||||||
|
|
||||||
except FileNotFoundError:
|
|
||||||
print(f"Erreur : le fichier '{file_path}' est introuvable.")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Une erreur est survenue : {e}")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def finds_peak(lambdas, intensities, min_peak_prominence, min_peak_distance=10, plot=None):
|
def finds_peak(lambdas, intensities, min_peak_prominence, min_peak_distance=10, plot=None):
|
||||||
"""
|
"""
|
||||||
|
@ -88,9 +64,6 @@ def finds_peak(lambdas, intensities, min_peak_prominence, min_peak_distance=10,
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return peaks_min, peaks_max
|
return peaks_min, peaks_max
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue