@@ -1,108 +1,109 | |||
|
1 | 1 | # Byte-compiled / optimized / DLL files |
|
2 | 2 | __pycache__/ |
|
3 | 3 | *.py[cod] |
|
4 | 4 | *$py.class |
|
5 | 5 | |
|
6 | 6 | # C extensions |
|
7 | 7 | *.so |
|
8 | 8 | |
|
9 | 9 | # Distribution / packaging |
|
10 | 10 | .Python |
|
11 | 11 | env/ |
|
12 | 12 | build/ |
|
13 | 13 | develop-eggs/ |
|
14 | 14 | dist/ |
|
15 | 15 | downloads/ |
|
16 | 16 | eggs/ |
|
17 | 17 | .eggs/ |
|
18 | 18 | lib/ |
|
19 | 19 | lib64/ |
|
20 | 20 | parts/ |
|
21 | 21 | sdist/ |
|
22 | 22 | var/ |
|
23 | 23 | wheels/ |
|
24 | 24 | *.egg-info/ |
|
25 | 25 | .installed.cfg |
|
26 | 26 | *.egg |
|
27 | 27 | |
|
28 | 28 | # PyInstaller |
|
29 | 29 | # Usually these files are written by a python script from a template |
|
30 | 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. |
|
31 | 31 | *.manifest |
|
32 | 32 | *.spec |
|
33 | 33 | |
|
34 | 34 | # Installer logs |
|
35 | 35 | pip-log.txt |
|
36 | 36 | pip-delete-this-directory.txt |
|
37 | 37 | |
|
38 | 38 | # Unit test / coverage reports |
|
39 | 39 | htmlcov/ |
|
40 | 40 | .tox/ |
|
41 | 41 | .coverage |
|
42 | 42 | .coverage.* |
|
43 | 43 | .cache |
|
44 | 44 | nosetests.xml |
|
45 | 45 | coverage.xml |
|
46 | 46 | *,cover |
|
47 | 47 | .hypothesis/ |
|
48 | 48 | |
|
49 | 49 | # Translations |
|
50 | 50 | *.mo |
|
51 | 51 | *.pot |
|
52 | 52 | |
|
53 | 53 | # Django stuff: |
|
54 | 54 | *.log |
|
55 | 55 | local_settings.py |
|
56 | 56 | |
|
57 | 57 | # Flask stuff: |
|
58 | 58 | instance/ |
|
59 | 59 | .webassets-cache |
|
60 | 60 | |
|
61 | 61 | # Scrapy stuff: |
|
62 | 62 | .scrapy |
|
63 | 63 | |
|
64 | 64 | # Sphinx documentation |
|
65 | 65 | docs/_build/ |
|
66 | 66 | |
|
67 | 67 | # PyBuilder |
|
68 | 68 | target/ |
|
69 | 69 | |
|
70 | 70 | # Jupyter Notebook |
|
71 | 71 | .ipynb_checkpoints |
|
72 | 72 | |
|
73 | 73 | # pyenv |
|
74 | 74 | .python-version |
|
75 | 75 | |
|
76 | 76 | # celery beat schedule file |
|
77 | 77 | celerybeat-schedule |
|
78 | 78 | |
|
79 | 79 | # SageMath parsed files |
|
80 | 80 | *.sage.py |
|
81 | 81 | |
|
82 | 82 | # dotenv |
|
83 | 83 | .env |
|
84 | 84 | |
|
85 | 85 | # virtualenv |
|
86 | 86 | .venv |
|
87 | 87 | venv/ |
|
88 | 88 | ENV/ |
|
89 | 89 | |
|
90 | 90 | # Spyder project settings |
|
91 | 91 | .spyderproject |
|
92 | 92 | .spyproject |
|
93 | 93 | |
|
94 | 94 | # Rope project settings |
|
95 | 95 | .ropeproject |
|
96 | 96 | |
|
97 | 97 | # mkdocs documentation |
|
98 | 98 | /site |
|
99 | 99 | |
|
100 | 100 | # eclipse |
|
101 | 101 | .project |
|
102 | 102 | .pydevproject |
|
103 | 103 | |
|
104 | 104 | # vscode |
|
105 | 105 | |
|
106 | 106 | .vscode |
|
107 | 107 | |
|
108 | 108 | schainpy/scripts/ |
|
109 | schaingui/node_modules/ No newline at end of file |
@@ -1,97 +1,85 | |||
|
1 | 1 | |
|
2 | 2 | import os, sys |
|
3 | 3 | |
|
4 | path = os.path.split(os.getcwd())[0] | |
|
5 | path = os.path.split(path)[0] | |
|
6 | ||
|
7 | sys.path.insert(0, path) | |
|
8 | ||
|
9 | 4 | from schainpy.controller import Project |
|
10 | 5 | |
|
11 | 6 | controllerObj = Project() |
|
12 | 7 | controllerObj.setup(id = '002', name='script02', description="JASMET Meteor Detection") |
|
13 | 8 | |
|
14 | 9 | #-------------------------------------- Setup ----------------------------------------- |
|
15 | 10 | #Verificar estas variables |
|
16 | 11 | |
|
17 | 12 | #Path para los archivos |
|
18 | 13 | # path = '/mnt/jars/2016_08/NOCHE' |
|
19 | 14 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/DIA' |
|
20 | 15 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/NOCHE' |
|
21 |
path = '/media/ |
|
|
16 | path = '/media/nanosat/NewVolumen/JASMET/2016_08/DIA' | |
|
22 | 17 | |
|
23 | 18 | #Path para los graficos |
|
24 | 19 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') |
|
25 | 20 | |
|
26 | 21 | #Path para los archivos HDF5 de meteoros |
|
27 | 22 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/meteor') |
|
28 | 23 | |
|
29 | 24 | #Fechas para busqueda de archivos |
|
30 | 25 | startDate = '2016/08/29' |
|
31 | 26 | endDate = '2016/09/11' |
|
32 | 27 | #Horas para busqueda de archivos |
|
33 | 28 | startTime = '00:00:00' |
|
34 | 29 | endTime = '23:59:59' |
|
35 | 30 | |
|
36 | 31 | |
|
37 | 32 | #------------------------------ Voltage Reading Unit ---------------------------------- |
|
38 | 33 | |
|
39 | 34 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', |
|
40 | 35 | path=path, |
|
41 | 36 | startDate=startDate, |
|
42 | 37 | endDate=endDate, |
|
43 | 38 | startTime=startTime, |
|
44 | 39 | endTime=endTime, |
|
45 | 40 | online=0, |
|
46 | 41 | delay=30, |
|
47 | 42 | walk=1, |
|
48 | 43 | getblock=1, |
|
49 | 44 | blocktime=100) |
|
50 | 45 | |
|
51 | 46 | opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') |
|
52 | 47 | |
|
53 | 48 | #-------------------------- Voltage Processing Unit ------------------------------------ |
|
54 | 49 | |
|
55 | 50 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) |
|
56 | 51 | |
|
57 | 52 | opObj00 = procUnitConfObj0.addOperation(name='selectChannels') |
|
58 | 53 | opObj00.addParameter(name='channelList', value='0,1,2,3,4', format='intlist') |
|
59 | 54 | |
|
60 | 55 | opObj01 = procUnitConfObj0.addOperation(name='setRadarFrequency') |
|
61 | 56 | opObj01.addParameter(name='frequency', value='30.e6', format='float') |
|
62 | 57 | |
|
63 | 58 | opObj01 = procUnitConfObj0.addOperation(name='interpolateHeights') |
|
64 | 59 | opObj01.addParameter(name='topLim', value='73', format='int') |
|
65 | 60 | opObj01.addParameter(name='botLim', value='71', format='int') |
|
66 | 61 | |
|
67 | 62 | opObj02 = procUnitConfObj0.addOperation(name='Decoder', optype='other') |
|
68 | 63 | |
|
69 | 64 | opObj03 = procUnitConfObj0.addOperation(name='CohInt', optype='other') |
|
70 | 65 | opObj03.addParameter(name='n', value='2', format='int') |
|
71 | 66 | |
|
72 | 67 | #--------------------------- Parameters Processing Unit ------------------------------------ |
|
73 | 68 | |
|
74 | 69 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=procUnitConfObj0.getId()) |
|
75 | 70 | # |
|
76 | 71 | opObj10 = procUnitConfObj1.addOperation(name='SMDetection', optype='other') |
|
77 | 72 | opObj10.addParameter(name='azimuth', value='45', format='float') |
|
78 | 73 | opObj10.addParameter(name='hmin', value='60', format='float') |
|
79 | 74 | opObj10.addParameter(name='hmax', value='120', format='float') |
|
80 | 75 | |
|
81 | 76 | opObj12 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other') |
|
82 | 77 | opObj12.addParameter(name='path', value=pathfile) |
|
83 | 78 | opObj12.addParameter(name='blocksPerFile', value='1000', format='int') |
|
84 | 79 | opObj12.addParameter(name='metadataList',value='type,heightList,paramInterval,timeZone',format='list') |
|
85 | 80 | opObj12.addParameter(name='dataList',value='data_param,utctime',format='list') |
|
86 | 81 | opObj12.addParameter(name='mode',value='2',format='int') |
|
87 | 82 | |
|
88 | 83 | #-------------------------------------------------------------------------------------------------- |
|
89 | 84 | |
|
90 | print "Escribiendo el archivo XML" | |
|
91 | controllerObj.writeXml("JASMET02.xml") | |
|
92 | print "Leyendo el archivo XML" | |
|
93 | controllerObj.readXml("JASMET02.xml") | |
|
94 | ||
|
95 | controllerObj.createObjects() | |
|
96 | controllerObj.connectObjects() | |
|
97 | controllerObj.run() No newline at end of file | |
|
85 | controllerObj.start() |
@@ -1,77 +1,68 | |||
|
1 | 1 | import os, sys |
|
2 | 2 | |
|
3 | 3 | path = os.path.split(os.getcwd())[0] |
|
4 | 4 | path = os.path.split(path)[0] |
|
5 | 5 | |
|
6 | 6 | sys.path.insert(0, path) |
|
7 | 7 | |
|
8 | 8 | from schainpy.controller import Project |
|
9 | 9 | |
|
10 | 10 | controllerObj = Project() |
|
11 | 11 | controllerObj.setup(id = '004', name='script04', description="JASMET Phase Calibration") |
|
12 | 12 | |
|
13 | 13 | #-------------------------------------- Setup ----------------------------------------- |
|
14 | 14 | #Verificar estas variables |
|
15 | 15 | |
|
16 | 16 | #Path donde estan los archivos HDF5 de meteoros |
|
17 | path = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/meteor') | |
|
17 | path = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/meteor') | |
|
18 | 18 | |
|
19 | 19 | #Path para los graficos |
|
20 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') | |
|
20 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/graphics') | |
|
21 | 21 | |
|
22 | 22 | #Path donde se almacenaran las fases calculadas |
|
23 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/phase') | |
|
23 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/phase') | |
|
24 | 24 | |
|
25 | 25 | #Fechas para busqueda de archivos |
|
26 |
startDate = '2016/08/2 |
|
|
27 |
endDate = '2016/0 |
|
|
26 | startDate = '2016/08/29' | |
|
27 | endDate = '2016/09/11' | |
|
28 | 28 | #Horas para busqueda de archivos |
|
29 | 29 | startTime = '00:00:00' |
|
30 | 30 | endTime = '23:59:59' |
|
31 | 31 | |
|
32 | 32 | #------------------------------------------------------------------------------------------------ |
|
33 | 33 | readUnitConfObj = controllerObj.addReadUnit(datatype='ParamReader', |
|
34 | 34 | path=path, |
|
35 |
startDate= |
|
|
36 |
endDate= |
|
|
35 | startDate=startDate, | |
|
36 | endDate=endDate, | |
|
37 | 37 | startTime=startTime, |
|
38 | 38 | endTime=endTime, |
|
39 | 39 | walk=1) |
|
40 | 40 | |
|
41 | 41 | #-------------------------------------------------------------------------------------------------- |
|
42 | 42 | |
|
43 | 43 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId()) |
|
44 | 44 | # # |
|
45 | 45 | opObj31 = procUnitConfObj1.addOperation(name='SMPhaseCalibration', optype='other') |
|
46 | 46 | opObj31.addParameter(name='nHours', value='1', format='float') |
|
47 | 47 | opObj31.addParameter(name='hmin', value='60', format='float') |
|
48 | 48 | opObj31.addParameter(name='hmax', value='120', format='float') |
|
49 | 49 | # opObj31.addParameter(name='channelPositions', value='(2.5,0),(0,2.5),(0,0),(0,4.5),(-2,0)', format='pairslist') |
|
50 | 50 | |
|
51 | 51 | opObj32 = procUnitConfObj1.addOperation(name='PhasePlot', optype='other') |
|
52 | 52 | opObj32.addParameter(name='id', value='201', format='int') |
|
53 | 53 | opObj32.addParameter(name='wintitle', value='PhaseCalibration', format='str') |
|
54 | 54 | opObj32.addParameter(name='save', value='1', format='bool') |
|
55 | 55 | opObj32.addParameter(name='xmin', value='0', format='float') |
|
56 | 56 | opObj32.addParameter(name='xmax', value='24', format='float') |
|
57 | 57 | opObj32.addParameter(name='ymin', value='-180', format='float') |
|
58 | 58 | opObj32.addParameter(name='ymax', value='180', format='float') |
|
59 | 59 | opObj32.addParameter(name='figpath', value=pathfig, format='str') |
|
60 | 60 | # # |
|
61 | 61 | opObj33 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other') |
|
62 | 62 | opObj33.addParameter(name='path', value=pathfile) |
|
63 | 63 | opObj33.addParameter(name='blocksPerFile', value='1000', format='int') |
|
64 | 64 | opObj33.addParameter(name='metadataList',value='type,outputInterval,timeZone',format='list') |
|
65 | 65 | opObj33.addParameter(name='dataList',value='data_output,utctime',format='list') |
|
66 | 66 | # # opObj25.addParameter(name='mode',value='1,0,0',format='intlist') |
|
67 | 67 | |
|
68 | #-------------------------------------------------------------------------------------------------- | |
|
69 | ||
|
70 | print "Escribiendo el archivo XML" | |
|
71 | controllerObj.writeXml("JASMET04.xml") | |
|
72 | print "Leyendo el archivo XML" | |
|
73 | controllerObj.readXml("JASMET04.xml") | |
|
74 | ||
|
75 | controllerObj.createObjects() | |
|
76 | controllerObj.connectObjects() | |
|
77 | controllerObj.run() No newline at end of file | |
|
68 | controllerObj.start() No newline at end of file |
@@ -1,91 +1,85 | |||
|
1 | 1 | import os, sys |
|
2 | 2 | |
|
3 | 3 | path = os.path.split(os.getcwd())[0] |
|
4 | 4 | path = os.path.split(path)[0] |
|
5 | 5 | |
|
6 | 6 | sys.path.insert(0, path) |
|
7 | 7 | |
|
8 | 8 | from schainpy.controller import Project |
|
9 | 9 | |
|
10 | 10 | controllerObj = Project() |
|
11 | 11 | controllerObj.setup(id = '005', name='script05', description="JASMET Wind Estimation") |
|
12 | 12 | |
|
13 | 13 | #-------------------------------------- Setup ----------------------------------------- |
|
14 | 14 | #Verificar estas variables |
|
15 | 15 | |
|
16 | 16 | #Path donde estan los archivos HDF5 de meteoros |
|
17 | path = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/meteor') | |
|
17 | path = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/meteor') | |
|
18 | 18 | |
|
19 | 19 | #Path para los graficos |
|
20 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') | |
|
20 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/graphics') | |
|
21 | 21 | |
|
22 | 22 | #Path donde se almacenaran las estimaciones de vientos |
|
23 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/phase') | |
|
23 | pathfile = os.path.join(os.environ['HOME'],'Pictures/JASMET30_mp/201608/phase') | |
|
24 | 24 | |
|
25 | 25 | #Fechas para busqueda de archivos |
|
26 |
startDate = '2016/08/2 |
|
|
27 |
endDate = '2016/0 |
|
|
26 | startDate = '2016/08/29' | |
|
27 | endDate = '2016/09/11' | |
|
28 | 28 | #Horas para busqueda de archivos |
|
29 | 29 | startTime = '00:00:00' |
|
30 | 30 | endTime = '23:59:59' |
|
31 | 31 | |
|
32 | 32 | #Offsets optimos obtenidos con OptimumOffset.py |
|
33 | 33 | phaseOffsets = '-2.84, -1.77, 11.94, 9.71' |
|
34 | phaseOffsets = '-5.86, -0.93, -7.29, 23.35' | |
|
34 | 35 | #------------------------------------------------------------------------------------------------ |
|
35 | 36 | readUnitConfObj = controllerObj.addReadUnit(datatype='ParamReader', |
|
36 | 37 | path=path, |
|
37 | 38 | startDate=startDate, |
|
38 | 39 | endDate=endDate, |
|
39 | 40 | startTime=startTime, |
|
40 | 41 | endTime=endTime, |
|
41 | 42 | walk=1) |
|
42 | 43 | #-------------------------------------------------------------------------------------------------- |
|
43 | 44 | |
|
44 | 45 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId()) |
|
45 | 46 | opObj10 = procUnitConfObj1.addOperation(name='CorrectSMPhases',optype='other') |
|
46 | 47 | opObj10.addParameter(name='phaseOffsets', value=phaseOffsets, format='floatlist') |
|
47 | 48 | |
|
48 | 49 | opObj13 = procUnitConfObj1.addOperation(name='SkyMapPlot', optype='other') |
|
49 | 50 | opObj13.addParameter(name='id', value='1', format='int') |
|
50 | 51 | opObj13.addParameter(name='wintitle', value='Sky Map', format='str') |
|
51 | 52 | opObj13.addParameter(name='save', value='1', format='bool') |
|
52 | 53 | opObj13.addParameter(name='figpath', value=pathfig, format='str') |
|
53 | 54 | opObj13.addParameter(name='ftp', value='1', format='int') |
|
54 | 55 | opObj13.addParameter(name='exp_code', value='15', format='int') |
|
55 | 56 | opObj13.addParameter(name='sub_exp_code', value='1', format='int') |
|
56 | 57 | opObj13.addParameter(name='tmin', value='0', format='int') |
|
57 | 58 | opObj13.addParameter(name='tmax', value='24', format='int') |
|
58 | 59 | |
|
59 | 60 | opObj22 = procUnitConfObj1.addOperation(name='WindProfiler', optype='other') |
|
60 | 61 | opObj22.addParameter(name='technique', value='Meteors', format='str') |
|
61 | 62 | opObj22.addParameter(name='nHours', value='1', format='float') |
|
62 | 63 | opObj22.addParameter(name='hmin', value='70', format='float') |
|
63 | 64 | opObj22.addParameter(name='hmax', value='120', format='float') |
|
64 | 65 | |
|
65 | 66 | opObj23 = procUnitConfObj1.addOperation(name='WindProfilerPlot', optype='other') |
|
66 | 67 | opObj23.addParameter(name='id', value='2', format='int') |
|
67 | 68 | opObj23.addParameter(name='wintitle', value='Wind Profiler', format='str') |
|
68 | 69 | opObj23.addParameter(name='save', value='1', format='bool') |
|
69 | 70 | opObj23.addParameter(name='figpath', value = pathfig, format='str') |
|
70 | 71 | opObj23.addParameter(name='zmin', value='-140', format='int') |
|
71 | 72 | opObj23.addParameter(name='zmax', value='140', format='int') |
|
72 | 73 | opObj23.addParameter(name='xmin', value='0', format='float') |
|
73 | 74 | opObj23.addParameter(name='xmax', value='24', format='float') |
|
74 | 75 | opObj23.addParameter(name='ymin', value='70', format='float') |
|
75 | 76 | opObj23.addParameter(name='ymax', value='110', format='float') |
|
76 | 77 | |
|
77 | 78 | opObj33 = procUnitConfObj1.addOperation(name='ParamWriter', optype='other') |
|
78 | 79 | opObj33.addParameter(name='path', value=pathfile) |
|
79 | 80 | opObj33.addParameter(name='blocksPerFile', value='1000', format='int') |
|
80 | 81 | opObj33.addParameter(name='metadataList',value='type,outputInterval,timeZone',format='list') |
|
81 | 82 | opObj33.addParameter(name='dataList',value='data_output,utctime',format='list') |
|
82 | 83 | #-------------------------------------------------------------------------------------------------- |
|
83 | 84 | |
|
84 | print "Escribiendo el archivo XML" | |
|
85 | controllerObj.writeXml("JASMET05.xml") | |
|
86 | print "Leyendo el archivo XML" | |
|
87 | controllerObj.readXml("JASMET05.xml") | |
|
88 | ||
|
89 | controllerObj.createObjects() | |
|
90 | controllerObj.connectObjects() | |
|
91 | controllerObj.run() No newline at end of file | |
|
85 | controllerObj.start() No newline at end of file |
|
1 | NO CONTENT: modified file |
@@ -1,113 +1,113 | |||
|
1 | 1 | import h5py |
|
2 | 2 | import numpy |
|
3 | 3 | import matplotlib.pyplot as plt |
|
4 | 4 | import glob |
|
5 | 5 | import os |
|
6 | 6 | |
|
7 | 7 | #---------------------- Functions --------------------- |
|
8 | 8 | |
|
9 | 9 | def findFiles(path): |
|
10 | 10 | |
|
11 | 11 | dirList = [] |
|
12 | 12 | fileList = [] |
|
13 | 13 | |
|
14 | 14 | for thisPath in os.listdir(path): |
|
15 | 15 | dirList.append(os.path.join(path,thisPath)) |
|
16 | 16 | dirList.sort() |
|
17 | 17 | |
|
18 | 18 | for thisDirectory in dirList: |
|
19 | 19 | files = glob.glob1(thisDirectory, "*.hdf5") |
|
20 | 20 | files.sort() |
|
21 | 21 | for thisFile in files: |
|
22 | 22 | fileList.append(os.path.join(thisDirectory,thisFile)) |
|
23 | 23 | |
|
24 | 24 | return fileList |
|
25 | 25 | |
|
26 | 26 | def readFiles(fileList): |
|
27 | 27 | |
|
28 | 28 | meteors_array = numpy.zeros((1,4)) |
|
29 | 29 | |
|
30 | 30 | for thisFile in fileList: |
|
31 | 31 | |
|
32 | 32 | #Leer |
|
33 | 33 | f1 = h5py.File(thisFile,'r') |
|
34 | 34 | grp1 = f1['Data'] |
|
35 | 35 | grp2 = grp1['data_output'] |
|
36 | 36 | meteors1 = grp2['table0'][:] |
|
37 | 37 | meteors_array = numpy.vstack((meteors_array,meteors1)) |
|
38 | 38 | #cerrar |
|
39 | 39 | f1.close() |
|
40 | 40 | |
|
41 | 41 | meteors_array = numpy.delete(meteors_array, 0, axis=0) |
|
42 | 42 | meteors_list = [meteors_array[:,0],meteors_array[:,1],meteors_array[:,2],meteors_array[:,3]] |
|
43 | 43 | return meteors_list |
|
44 | 44 | |
|
45 | 45 | def estimateMean(offset_list): |
|
46 | 46 | |
|
47 | 47 | mean_off = [] |
|
48 | 48 | axisY_off = [] |
|
49 | 49 | axisX_off = [] |
|
50 | 50 | |
|
51 | 51 | for thisOffset in offset_list: |
|
52 | 52 | mean_aux = numpy.mean(thisOffset, axis = 0) |
|
53 | 53 | mean_off.append(mean_aux) |
|
54 | 54 | axisX_off.append(numpy.array([0,numpy.size(thisOffset)])) |
|
55 | 55 | axisY_off.append(numpy.array([mean_aux,mean_aux])) |
|
56 | 56 | |
|
57 | 57 | return mean_off, axisY_off, axisX_off |
|
58 | 58 | |
|
59 | 59 | def plotPhases(offset0, axisY0, axisX0, title): |
|
60 | 60 | f, axarr = plt.subplots(4, sharey=True) |
|
61 | 61 | color = ['b','g','r','c'] |
|
62 | 62 | # plt.grid() |
|
63 | 63 | for i in range(len(offset0)): |
|
64 | 64 | thisMeteor = offset0[i] |
|
65 | 65 | thisY = axisY0[i] |
|
66 | 66 | thisX = axisX0[i] |
|
67 | 67 | thisColor = color[i] |
|
68 | 68 | |
|
69 | 69 | opt = thisColor + 'o' |
|
70 | 70 | axarr[i].plot(thisMeteor,opt) |
|
71 | 71 | axarr[i].plot(thisX, thisY, thisColor) |
|
72 | 72 | axarr[i].set_ylabel('Offset ' + str(i)) |
|
73 | 73 | |
|
74 | 74 | plt.ylim((-180,180)) |
|
75 | 75 | axarr[0].set_title(title + ' Offsets') |
|
76 | 76 | axarr[3].set_xlabel('Number of estimations') |
|
77 | 77 | |
|
78 | 78 | return |
|
79 | 79 | |
|
80 | 80 | def filterOffsets(offsets0, stdvLimit): |
|
81 | 81 | offsets1 = [] |
|
82 | 82 | |
|
83 | 83 | for thisOffset in offsets0: |
|
84 | 84 | pstd = numpy.std(thisOffset)*stdvLimit |
|
85 | 85 | pmean = numpy.mean(thisOffset) |
|
86 | 86 | outlier1 = thisOffset > pmean - pstd |
|
87 | 87 | outlier2 = thisOffset < pmean + pstd |
|
88 | 88 | not_outlier = numpy.logical_and(outlier1,outlier2) |
|
89 | 89 | thisOffset1 = thisOffset[not_outlier] |
|
90 | 90 | offsets1.append(thisOffset1) |
|
91 | 91 | |
|
92 | 92 | return offsets1 |
|
93 | 93 | |
|
94 | 94 | #---------------------- Setup --------------------------- |
|
95 | 95 | |
|
96 |
path = '/home/ |
|
|
96 | path = '/home/nanosat/Pictures/JASMET30_mp/201608/phase' | |
|
97 | 97 | stdvLimit = 0.5 |
|
98 | 98 | |
|
99 | 99 | #---------------------- Script --------------------------- |
|
100 | 100 | |
|
101 | 101 | fileList = findFiles(path) |
|
102 | 102 | offsets0 = readFiles(fileList) |
|
103 | 103 | mean0, axisY0, axisX0 = estimateMean(offsets0) |
|
104 | 104 | plotPhases(offsets0, axisY0, axisX0, 'Original') |
|
105 | 105 | |
|
106 | 106 | offsets1 = filterOffsets(offsets0, stdvLimit) |
|
107 | 107 | mean1, axisY1, axisX1 = estimateMean(offsets1) |
|
108 | 108 | plotPhases(offsets1, axisY1, axisX1, 'Filtered') |
|
109 | 109 | |
|
110 | 110 | print "Original Offsets: %.2f, %.2f, %.2f, %.2f" % (mean0[0],mean0[1],mean0[2],mean0[3]) |
|
111 | 111 | print "Filtered Offsets: %.2f, %.2f, %.2f, %.2f" % (mean1[0],mean1[1],mean1[2],mean1[3]) |
|
112 | 112 | |
|
113 | 113 | plt.show() |
@@ -1,1 +1,1 | |||
|
1 | <Project description="test" id="191" name="john"><ReadUnit datatype="VoltageReader" id="1911" inputId="0" name="VoltageReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="server" value="tcp://10.10.10.121:5555" /></Operation></ReadUnit><ProcUnit datatype="VoltageProc" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /></ProcUnit></Project> No newline at end of file | |
|
1 | <Project description="JASMET Wind Estimation" id="005" name="script05"><ReadUnit datatype="ParamReader" id="51" inputId="0" name="ParamReader"><Operation id="511" name="run" priority="1" type="self"><Parameter format="str" id="5111" name="datatype" value="ParamReader" /><Parameter format="str" id="5112" name="path" value="/home/nanosat/Pictures/JASMET30_mp/201608/meteor" /><Parameter format="date" id="5113" name="startDate" value="2016/08/29" /><Parameter format="date" id="5114" name="endDate" value="2016/09/11" /><Parameter format="time" id="5115" name="startTime" value="00:00:00" /><Parameter format="time" id="5116" name="endTime" value="23:59:59" /><Parameter format="int" id="5118" name="walk" value="1" /></Operation></ReadUnit><ProcUnit datatype="ParametersProc" id="52" inputId="51" name="ParametersProc"><Operation id="521" name="run" priority="1" type="self" /><Operation id="522" name="CorrectSMPhases" priority="2" type="other"><Parameter format="floatlist" id="5221" name="phaseOffsets" value="-5.86, -0.93, -7.29, 23.35" /></Operation><Operation id="523" name="SkyMapPlot" priority="3" type="other"><Parameter format="int" id="5231" name="id" value="1" /><Parameter format="str" id="5232" name="wintitle" value="Sky Map" /><Parameter format="bool" id="5233" name="save" value="1" /><Parameter format="str" id="5234" name="figpath" value="/home/nanosat/Pictures/JASMET30_mp/201608/graphics" /><Parameter format="int" id="5235" name="ftp" value="1" /><Parameter format="int" id="5236" name="exp_code" value="15" /><Parameter format="int" id="5237" name="sub_exp_code" value="1" /><Parameter format="int" id="5238" name="tmin" value="0" /><Parameter format="int" id="5239" name="tmax" value="24" /></Operation><Operation id="524" name="WindProfiler" priority="4" type="other"><Parameter format="str" id="5241" name="technique" value="Meteors" /><Parameter format="float" id="5242" name="nHours" value="1" /><Parameter format="float" id="5243" name="hmin" value="70" /><Parameter format="float" id="5244" name="hmax" value="120" /></Operation><Operation id="525" name="WindProfilerPlot" priority="5" type="other"><Parameter format="int" id="5251" name="id" value="2" /><Parameter format="str" id="5252" name="wintitle" value="Wind Profiler" /><Parameter format="bool" id="5253" name="save" value="1" /><Parameter format="str" id="5254" name="figpath" value="/home/nanosat/Pictures/JASMET30_mp/201608/graphics" /><Parameter format="int" id="5255" name="zmin" value="-140" /><Parameter format="int" id="5256" name="zmax" value="140" /><Parameter format="float" id="5257" name="xmin" value="0" /><Parameter format="float" id="5258" name="xmax" value="24" /><Parameter format="float" id="5259" name="ymin" value="70" /><Parameter format="float" id="5260" name="ymax" value="110" /></Operation><Operation id="526" name="ParamWriter" priority="6" type="other"><Parameter format="str" id="5261" name="path" value="/home/nanosat/Pictures/JASMET30_mp/201608/phase" /><Parameter format="int" id="5262" name="blocksPerFile" value="1000" /><Parameter format="list" id="5263" name="metadataList" value="type,outputInterval,timeZone" /><Parameter format="list" id="5264" name="dataList" value="data_output,utctime" /></Operation></ProcUnit></Project> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now