-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHEADER_LRS.py
152 lines (110 loc) · 2.99 KB
/
HEADER_LRS.py
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
from pandas import Series, DataFrame #Local Namespace import
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
path="HEADER_05N_038559E.txt"
#Reading data
data=np.loadtxt(path)
#DataFrame
index=np.linspace(0,(data.shape[1]-1),data.shape[1])
columns= ['SC_Lat','SC_Long','SC_Alt','Range0','Start_Range','H_nadir']
data2=pd.DataFrame(data,columns,index)
#data2=data.apply(pd.to_numeric)
#Data information
data2.info()
#data.head(10)
print(data2.shape)
#data2.loc[['SC_Long']]=data2.loc[['SC_Long']]-360
#data2.loc[['H_nadir']]=data2.loc[['H_nadir']]-93
#data2.loc[['H_nadir']]=data2.loc[['H_nadir']]-data2.loc[['SC_Alt']]
print(data2.loc[['SC_Long']])
#Particular column
Along_track=1000
print("Along_track =",Along_track*0.075,"km")
print(data2.loc[:,[Along_track]])
#GRAPH
#SC_Lat
plt.subplot(2,2,3)
plt.plot(data2.loc['SC_Lat'],color='black',label='SC_Lat')
xt=np.arange(0,2200,200)
plt.xticks(xt,(i*0.075 for i in xt),fontsize=10)
plt.grid()
plt.minorticks_on()
plt.tick_params(which="both",width=2)
plt.tick_params(which="major",length=7)
plt.tick_params(which="minor",length=4,color='r')
plt.legend()
plt.title("SC_Lat")
#SC_Alt
plt.subplot(2,2,2)
plt.plot(data2.loc['SC_Alt'],color='red',label='SC_Alt')
xt=np.arange(0,2200,200)
plt.xticks(xt,(i*0.075 for i in xt),fontsize=10)
plt.grid()
plt.minorticks_on()
plt.tick_params(which="both",width=2)
plt.tick_params(which="major",length=7)
plt.tick_params(which="minor",length=4,color='r')
plt.legend()
plt.title("SC_Alt")
#Start_Range
plt.subplot(2,2,4)
plt.plot(data2.loc['Start_Range'],color='orange',label='Start_Range')
xt=np.arange(0,2200,200)
plt.xticks(xt,(i*0.075 for i in xt),fontsize=10)
plt.grid()
plt.minorticks_on()
plt.tick_params(which="both",width=2)
plt.tick_params(which="major",length=7)
plt.tick_params(which="minor",length=4,color='r')
plt.legend()
plt.title("Start_Range")
#H_nadir
plt.subplot(2,2,1)
plt.plot(data2.loc['H_nadir'],color='b',label="H_nadir")
xt=np.arange(0,2200,200)
plt.xticks(xt,(i*0.075 for i in xt),fontsize=10)
plt.grid()
plt.minorticks_on()
plt.tick_params(which="both",width=2)
plt.tick_params(which="major",length=7)
plt.tick_params(which="minor",length=4,color='r')
plt.legend()
plt.title("H_nadir")
plt.show()
#print(data['SC_Lat'])
#print(len(data))
#data3=data2.HEADER.split(', ')
#print(data2)
#bins= range(len(data)/6)
#print(bins)
#print(data['HEADER'])
#print(data)
#print(data['SC_Alt'])
#print(data.loc[:,['SC_Alt']])
#print(data.columns)
#print(data.shape)
#data_ROWS = data.loc[:,['b']]
#print(ROWS)
#print("ROWS")
#print(ROWS)
#print("")
#print("ROWS.dtypes")
#print(ROWS.dtypes)
#print("ROWS.dtype = ",ROWS.dtypes)
#print("")
#print("***************")
#print("")
#data['b'].astype(str).astype(int)
#pd.to_numeric(ROWS)
#data = data.apply(pd.to_numeric,errors='coerce')
#print(data)
#ROWS = data.loc[[18],['b']]
#ROWS = ROWS.astype(int)
#print("ROWS")
#data['b']=data['b'].atypes(str).atypes(int)
#print(data['b'])
#print("")
#print("ROWS.dtypes ")
#print(data['b'].dtypes)
#print("****