@@ -1,9 +1,7 | |||||
1 | import numpy |
|
1 | import numpy | |
|
2 | from Model.Spectra import Spectra | |||
2 |
|
3 | |||
3 | from Model.JROHeader import * |
|
4 | def hildebrand_sekhon(Data, navg=1): | |
4 | from Model.Voltage import Voltage |
|
|||
5 |
|
||||
6 | def hildebrand_sekhon(Data, navg=1 ): |
|
|||
7 | """ |
|
5 | """ | |
8 | This method is for the objective determination of de noise level in Doppler spectra. This |
|
6 | This method is for the objective determination of de noise level in Doppler spectra. This | |
9 | implementation technique is based on the fact that the standard deviation of the spectral |
|
7 | implementation technique is based on the fact that the standard deviation of the spectral | |
@@ -73,7 +71,7 class Noise(): | |||||
73 | m_DataObj = None |
|
71 | m_DataObj = None | |
74 |
|
72 | |||
75 |
|
73 | |||
76 |
def __init__(self, m_ |
|
74 | def __init__(self, m_Spectra=None): | |
77 | """ |
|
75 | """ | |
78 | Inicializador de la clase Noise para la la determinacion del nivel de ruido en un Spectro Doppler. |
|
76 | Inicializador de la clase Noise para la la determinacion del nivel de ruido en un Spectro Doppler. | |
79 |
|
77 | |||
@@ -83,13 +81,13 class Noise(): | |||||
83 | Return: |
|
81 | Return: | |
84 | None |
|
82 | None | |
85 | """ |
|
83 | """ | |
86 |
|
|
84 | if m_Spectra == None: | |
87 |
|
|
85 | m_Spectra = Spectra() | |
88 |
|
|
86 | ||
89 |
|
|
87 | if not(isinstance(m_Spectra, Spectra)): | |
90 |
|
|
88 | raise ValueError, "in Noise class, m_Spectra must be an Spectra class object" | |
91 |
|
89 | |||
92 |
self.m_DataObj = m_ |
|
90 | self.m_DataObj = m_Spectra | |
93 |
|
91 | |||
94 |
|
92 | |||
95 | def getNoiseLevelByHildebrandSekhon(self): |
|
93 | def getNoiseLevelByHildebrandSekhon(self): | |
@@ -99,10 +97,16 class Noise(): | |||||
99 | Return: |
|
97 | Return: | |
100 | noise level |
|
98 | noise level | |
101 | """ |
|
99 | """ | |
102 |
data = self.m_DataObj.data |
|
100 | data = self.m_DataObj.data_spc | |
103 | #heights = numpy.transpose( Data, (2,0,1) ) # channel x profile x height |
|
101 | daux = None | |
104 | #data = Data[0,0,:] |
|
|||
105 |
|
102 | |||
106 | noiselevel = hildebrand_sekhon(data) |
|
103 | for channel in range(self.m_DataObj.nChannels): | |
|
104 | daux = data[channel,:,:] | |||
|
105 | noiselevel = hildebrand_sekhon(daux) | |||
|
106 | print noiselevel | |||
107 |
|
107 | |||
108 | print noiselevel |
|
108 | ||
|
109 | for pair in range(self.m_DataObj.nPairs): | |||
|
110 | daux = data[pair,:,:] | |||
|
111 | noiselevel = hildebrand_sekhon(daux) | |||
|
112 | print noiselevel |
General Comments 0
You need to be logged in to leave comments.
Login now