@@ -9,7 +9,6 import numpy | |||||
9 | import datetime |
|
9 | import datetime | |
10 |
|
10 | |||
11 | from .jroheaderIO import SystemHeader, RadarControllerHeader |
|
11 | from .jroheaderIO import SystemHeader, RadarControllerHeader | |
12 | # from schainpy import cSchain |
|
|||
13 |
|
12 | |||
14 |
|
13 | |||
15 | def getNumpyDtype(dataTypeCode): |
|
14 | def getNumpyDtype(dataTypeCode): | |
@@ -63,46 +62,24 def hildebrand_sekhon(data, navg): | |||||
63 | navg : numbers of averages |
|
62 | navg : numbers of averages | |
64 |
|
63 | |||
65 | Return: |
|
64 | Return: | |
66 |
|
|
65 | mean : noise's level | |
67 | anoise : noise's level |
|
|||
68 | """ |
|
66 | """ | |
69 |
|
67 | |||
70 |
sort |
|
68 | sorted_spectrum = numpy.sort(data, axis=None) | |
71 | lenOfData = len(sortdata) |
|
69 | nnoise = len(sorted_spectrum) # default to all points in the spectrum as noise | |
72 | nums_min = lenOfData*0.2 |
|
70 | for npts in range(1, len(sorted_spectrum)+1): | |
73 |
|
71 | partial = sorted_spectrum[:npts] | ||
74 | if nums_min <= 5: |
|
72 | mean = partial.mean() | |
75 | nums_min = 5 |
|
73 | var = partial.var() | |
76 |
|
74 | if var * navg < mean**2.: | ||
77 | sump = 0. |
|
75 | nnoise = npts | |
78 |
|
76 | else: | ||
79 | sumq = 0. |
|
77 | # partial spectrum no longer has characteristics of white noise | |
80 |
|
78 | break | ||
81 | j = 0 |
|
|||
82 |
|
||||
83 | cont = 1 |
|
|||
84 |
|
||||
85 | while((cont==1)and(j<lenOfData)): |
|
|||
86 |
|
||||
87 | sump += sortdata[j] |
|
|||
88 |
|
||||
89 | sumq += sortdata[j]**2 |
|
|||
90 |
|
||||
91 | if j > nums_min: |
|
|||
92 | rtest = float(j)/(j-1) + 1.0/navg |
|
|||
93 | if ((sumq*j) > (rtest*sump**2)): |
|
|||
94 | j = j - 1 |
|
|||
95 | sump = sump - sortdata[j] |
|
|||
96 | sumq = sumq - sortdata[j]**2 |
|
|||
97 | cont = 0 |
|
|||
98 |
|
||||
99 | j += 1 |
|
|||
100 |
|
||||
101 | lnoise = sump /j |
|
|||
102 |
|
||||
103 | return lnoise |
|
|||
104 |
|
79 | |||
105 | # return cSchain.hildebrand_sekhon(sortdata, navg) |
|
80 | noise_spectrum = sorted_spectrum[:nnoise] | |
|
81 | mean = noise_spectrum.mean() | |||
|
82 | return mean | |||
106 |
|
83 | |||
107 |
|
84 | |||
108 | class Beam: |
|
85 | class Beam: | |
@@ -231,6 +208,12 class JROData(GenericData): | |||||
231 |
|
208 | |||
232 | profileIndex = None |
|
209 | profileIndex = None | |
233 |
|
210 | |||
|
211 | error = (0, '') | |||
|
212 | ||||
|
213 | def __str__(self): | |||
|
214 | ||||
|
215 | return '{} - {}'.format(self.type, self.getDatatime()) | |||
|
216 | ||||
234 | def getNoise(self): |
|
217 | def getNoise(self): | |
235 |
|
218 | |||
236 | raise NotImplementedError |
|
219 | raise NotImplementedError |
@@ -1,8 +1,6 | |||||
1 | import sys |
|
1 | import sys | |
2 | import numpy |
|
2 | import numpy | |
3 | from scipy import interpolate |
|
3 | from scipy import interpolate | |
4 | #TODO |
|
|||
5 | #from schainpy import cSchain |
|
|||
6 | from schainpy.model.proc.jroproc_base import ProcessingUnit, MPDecorator, Operation |
|
4 | from schainpy.model.proc.jroproc_base import ProcessingUnit, MPDecorator, Operation | |
7 | from schainpy.model.data.jrodata import Voltage |
|
5 | from schainpy.model.data.jrodata import Voltage | |
8 | from schainpy.utils import log |
|
6 | from schainpy.utils import log |
@@ -45,9 +45,6 setup(name = "schainpy", | |||||
45 | }, |
|
45 | }, | |
46 | include_package_data = False, |
|
46 | include_package_data = False, | |
47 | scripts = ['schainpy/gui/schainGUI'], |
|
47 | scripts = ['schainpy/gui/schainGUI'], | |
48 | ext_modules = [ |
|
|||
49 | Extension("cSchain", ["schainpy/model/proc/extensions.c"]) |
|
|||
50 | ], |
|
|||
51 | entry_points = { |
|
48 | entry_points = { | |
52 | 'console_scripts': [ |
|
49 | 'console_scripts': [ | |
53 | 'schain = schainpy.cli.cli:main', |
|
50 | 'schain = schainpy.cli.cli:main', | |
@@ -59,9 +56,6 setup(name = "schainpy", | |||||
59 | "scipy >= 0.14.0", |
|
56 | "scipy >= 0.14.0", | |
60 | "h5py >= 2.2.1", |
|
57 | "h5py >= 2.2.1", | |
61 | "matplotlib >= 2.0.0", |
|
58 | "matplotlib >= 2.0.0", | |
62 | "pyfits >= 3.4", |
|
|||
63 | "paramiko >= 2.1.2", |
|
|||
64 | "paho-mqtt >= 1.2", |
|
|||
65 | "zmq", |
|
59 | "zmq", | |
66 | "fuzzywuzzy", |
|
60 | "fuzzywuzzy", | |
67 | "click", |
|
61 | "click", |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now