-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualisation.py
More file actions
59 lines (40 loc) · 1.27 KB
/
Copy pathVisualisation.py
File metadata and controls
59 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 28 11:22:39 2021
@author: srpv
"""
import torch
import copy
import numpy as np
import pandas as pd
import seaborn as sns
from pylab import rcParams
import matplotlib.pyplot as plt
from matplotlib import rc
from sklearn.model_selection import train_test_split
import matplotlib.patches as mpatches
from matplotlib import cm
from Visualization_Utils import *
COLORS_PALETTE = ["#01BEFE", "#FFDD00", "#FF7D00", "#FF006D", "#ADFF02", "#8F00FF"]
sns.set_palette(sns.color_palette(COLORS_PALETTE))
rcParams['figure.figsize'] = 12, 8
RANDOM_SEED = 42
np.random.seed(RANDOM_SEED)
torch.manual_seed(RANDOM_SEED)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
Force = np.load('Force.npy')
Total_cycle_force =Force.flatten()
plotsignal(Total_cycle_force,filename="whole",color="#000000",add=0)
#%%
Running_in = Force[1000:1010,:]
Running_in=Running_in.flatten()
Stable = Force[9000:9010,:]
Stable=Stable.flatten()
Anomaly = Force[30000:30010,:]
Anomaly=Anomaly.flatten()
plotsignal(Running_in,filename="Running_in",color="#FF1818",add=1000)
plotsignal(Stable,filename="Stable",color="#00CB26",add=9000)
plotsignal(Anomaly,filename="Anomaly",color="#0000EC",add=30000)
#%%
plotsignals(Running_in,Stable,Anomaly)
#%%