@@ -1,9 +1,7 | |||
|
1 | 1 | import numpy |
|
2 | from Model.Spectra import Spectra | |
|
2 | 3 | |
|
3 | from Model.JROHeader import * | |
|
4 | from Model.Voltage import Voltage | |
|
5 | ||
|
6 | def hildebrand_sekhon(Data, navg=1 ): | |
|
4 | def hildebrand_sekhon(Data, navg=1): | |
|
7 | 5 | """ |
|
8 | 6 | This method is for the objective determination of de noise level in Doppler spectra. This |
|
9 | 7 | implementation technique is based on the fact that the standard deviation of the spectral |
@@ -73,7 +71,7 class Noise(): | |||
|
73 | 71 | m_DataObj = None |
|
74 | 72 | |
|
75 | 73 | |
|
76 |
def __init__(self, m_ |
|
|
74 | def __init__(self, m_Spectra=None): | |
|
77 | 75 | """ |
|
78 | 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 | 81 | Return: |
|
84 | 82 | None |
|
85 | 83 | """ |
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
84 | if m_Spectra == None: | |
|
85 | m_Spectra = Spectra() | |
|
86 | ||
|
87 | if not(isinstance(m_Spectra, Spectra)): | |
|
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 | 93 | def getNoiseLevelByHildebrandSekhon(self): |
@@ -99,10 +97,16 class Noise(): | |||
|
99 | 97 | Return: |
|
100 | 98 | noise level |
|
101 | 99 | """ |
|
102 |
data = self.m_DataObj.data |
|
|
103 | #heights = numpy.transpose( Data, (2,0,1) ) # channel x profile x height | |
|
104 | #data = Data[0,0,:] | |
|
100 | data = self.m_DataObj.data_spc | |
|
101 | daux = None | |
|
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