From af3e717bb142b404148eeae1df17addb4a3c37e8 Mon Sep 17 00:00:00 2001 From: marques Date: Tue, 28 Apr 2026 10:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=87=E5=89=B2=E6=97=B6=E7=9A=84=E6=89=93=E5=8D=B0=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E8=B0=83=E6=95=B4=E4=BF=A1=E5=8F=B7=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- func/Module_SA_label_v2.py | 4 +++- func/Module_approximately_align.py | 4 ++-- func/Module_cut_pair_file.py | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index bb689d9..57823e2 100644 --- a/.gitignore +++ b/.gitignore @@ -253,5 +253,5 @@ config/* func/detect_Jpeak_model/* .idea/* !./logs -!./config -!./func/detect_Jpeak_model \ No newline at end of file +!./config/.gitkeep +!./func/detect_Jpeak_model diff --git a/func/Module_SA_label_v2.py b/func/Module_SA_label_v2.py index 499f0c0..b7afb5e 100644 --- a/func/Module_SA_label_v2.py +++ b/func/Module_SA_label_v2.py @@ -354,7 +354,9 @@ class Data: "Get_Artifact_Format_Exception"] + "\n" + format_exc()) self.config.update({ - "SignalSecond": int(len(self.OrgBCG) // self.config["Config"]["InputConfig"]["OrgBCGFreq"]) + "SignalSecond": min(int(len(self.OrgBCG) // self.config["Config"]["InputConfig"]["OrgBCGFreq"]), + int(len(self.Tho) // self.config["Config"]["InputConfig"]["ThoFreq"]), + ) }) # 批量将睡眠分期按照映射转换为数字 diff --git a/func/Module_approximately_align.py b/func/Module_approximately_align.py index 8328c1c..9af0529 100644 --- a/func/Module_approximately_align.py +++ b/func/Module_approximately_align.py @@ -1353,7 +1353,7 @@ class Data: # 计算互相关1/2 try: # 计算因子 - MULTIPLE_FACTOER = Params.APPROXIMATELY_ALIGN_CONFIG_NEW_CONTENT["Multiple_Factor"] + # MULTIPLE_FACTOER = Params.APPROXIMATELY_ALIGN_CONFIG_NEW_CONTENT["Multiple_Factor"] a = self.processed_downsample_Tho[ Config["PSGConfig"]["PreCut"]:len(self.processed_downsample_Tho) - Config["PSGConfig"][ "PostCut"]].copy() @@ -1365,7 +1365,7 @@ class Data: # a = a.astype(int64) # v = v.astype(int64) tho_relate = correlate(a, v, mode='full') - tho_relate = tho_relate / (MULTIPLE_FACTOER ** 2) + # tho_relate = tho_relate / (MULTIPLE_FACTOER ** 2) tho_relate2 = - tho_relate result = {"tho_relate": tho_relate, "tho_relate2": tho_relate2} diff --git a/func/Module_cut_pair_file.py b/func/Module_cut_pair_file.py index adfb2b4..134fd94 100644 --- a/func/Module_cut_pair_file.py +++ b/func/Module_cut_pair_file.py @@ -547,6 +547,7 @@ class Data: try: for key, raw in self.raw.items(): + print(f"Cutting data for channel: {key}, original length: {len(raw)}") if Config["ChannelInput"][key].startswith("PSG:"): # 转换切割点 ECG_freq = Config["ECGFreq"]