diff --git a/README.md b/README.md index 0a3e018..d80d411 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ file = files.shuffle()[0] dados = parse_bin(file) ``` - Wall time: 15.2 s + Wall time: 15.1 s ``` @@ -100,31 +100,31 @@ print(dados)
{ - 'filename': 'rfeye002113_210626_T120001.bin', + 'filename': 'rfeye002263_210618_T210255.bin', 'file_version': 23, 'string': 'CRFS DATA FILE V023', - 'hostname': 'rfeye002113', - 'method': 'ScriptRFeye2021_v2.cfg', + 'hostname': 'rfeye002263', + 'method': 'ScriptRFeye2021_v.1', 'unit_info': 'Stationary', 'file_number': 0, 'identifier': 'INFO', - 'gps': GPS Data - Median of Coordinates: -14.81416:-39.03184 Altitude: 14.50 #Satellites: -12.0, + 'gps': GPS Data - Median of Coordinates: -23.32905:-51.13701 Altitude: 591.30 +#Satellites: 11.0, 'spectrum': [SpecData(type=67, thread_id=300, description='PMEC 2021 (Faixa 1 de 10).', start_mega=105.0, stop_mega=140.0, dtype='dBm', ndata=3584, bw=18457, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=310, description='PMEC 2021 (Faixa 2 de 10).', start_mega=155.0, stop_mega=165.0, dtype='dBm', ndata=1024, bw=18457, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=100, description='PRD 2021 (Faixa principal 1 de 4).', start_mega=50.0, stop_mega=90.0, -dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-90.5, -minimum=-90.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de +dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-45.5, +minimum=-45.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de 4).', start_mega=70.0, stop_mega=110.0, dtype='dBμV/m', ndata=1024, bw=73828, -processing='peak', antuid=0, thresh=-67.5, minimum=-67.5), SpecData(type=67, thread_id=120, +processing='peak', antuid=0, thresh=-29.5, minimum=-29.5), SpecData(type=67, thread_id=120, description='PRD 2021 (Faixa principal 3 de 4).', start_mega=170.0, stop_mega=220.0, -dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-37.5, -minimum=-37.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de +dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-51.5, +minimum=-51.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de 4).', start_mega=470.0, stop_mega=700.0, dtype='dBμV/m', ndata=5888, bw=73828, -processing='peak', antuid=0, thresh=-41.5, minimum=-41.5), SpecData(type=67, thread_id=200, +processing='peak', antuid=0, thresh=-39.5, minimum=-39.5), SpecData(type=67, thread_id=200, description='PMEF 2021 (Faixa 1 de 6).', start_mega=700.0, stop_mega=960.0, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=210, description='PMEF 2021 (Faixa 2 de 6).', start_mega=1710.0, @@ -136,29 +136,28 @@ print(dados) dtype='dBm', ndata=2560, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=240, description='PMEF 2021 (Faixa 5 de 6).', start_mega=2500.0, stop_mega=2690.0, dtype='dBm', ndata=4864, bw=73828, processing='peak', -antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250, description='PMEF -2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', ndata=10496, -bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=320, description='PMEC 2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, -dtype='dBm', ndata=512, bw=73828, processing='peak', antuid=0, thresh=-147.5, -minimum=-147.5), SpecData(type=67, thread_id=330, description='PMEC 2021 (Faixa 4 de 10).', -start_mega=400.0, stop_mega=410.0, dtype='dBm', ndata=256, bw=73828, processing='peak', -antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=340, description='PMEC -2021 (Faixa 5 de 10).', start_mega=960.0, stop_mega=1001218.999, dtype='dBm', ndata=6656, +antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=320, description='PMEC +2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, dtype='dBm', ndata=512, bw=73828, +processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=330, +description='PMEC 2021 (Faixa 4 de 10).', start_mega=400.0, stop_mega=410.0, dtype='dBm', +ndata=256, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), +SpecData(type=67, thread_id=340, description='PMEC 2021 (Faixa 5 de 10).', start_mega=960.0, +stop_mega=1001218.999, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0, +thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=350, description='PMEC 2021 +(Faixa 6 de 10).', start_mega=1001388.999, stop_mega=1001428.999, dtype='dBm', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=350, description='PMEC 2021 (Faixa 6 de 10).', start_mega=1001388.999, -stop_mega=1001428.999, dtype='dBm', ndata=1280, bw=73828, processing='peak', antuid=0, -thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=360, description='PMEC 2021 -(Faixa 7 de 10).', start_mega=1530.0, stop_mega=1001648.999, dtype='dBm', ndata=3072, +thread_id=360, description='PMEC 2021 (Faixa 7 de 10).', start_mega=1530.0, +stop_mega=1001648.999, dtype='dBm', ndata=3072, bw=73828, processing='peak', antuid=0, +thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=370, description='PMEC 2021 +(Faixa 8 de 10).', start_mega=2690.0, stop_mega=1002898.999, dtype='dBm', ndata=5376, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=370, description='PMEC 2021 (Faixa 8 de 10).', start_mega=2690.0, -stop_mega=1002898.999, dtype='dBm', ndata=5376, bw=73828, processing='peak', antuid=0, -thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=380, description='PMEC 2021 -(Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0, dtype='dBm', ndata=4096, bw=73828, -processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=390, -description='PMEC 2021 (Faixa 10 de 10).', start_mega=1005338.999, stop_mega=1005458.999, -dtype='dBm', ndata=3328, bw=73828, processing='peak', antuid=0, thresh=-147.5, -minimum=-147.5)] +thread_id=380, description='PMEC 2021 (Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0, +dtype='dBm', ndata=4096, bw=73828, processing='peak', antuid=0, thresh=-147.5, +minimum=-147.5), SpecData(type=67, thread_id=390, description='PMEC 2021 (Faixa 10 de 10).', +start_mega=1005338.999, stop_mega=1005458.999, dtype='dBm', ndata=3328, bw=73828, +processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250, +description='PMEF 2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', +ndata=10496, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5)] }@@ -176,7 +175,7 @@ print(dados['gps']) ``` -
GPS Data - Median of Coordinates: -14.81416:-39.03184 Altitude: 14.50 #Satellites: 12.0 +GPS Data - Median of Coordinates: -23.32905:-51.13701 Altitude: 591.30 #Satellites: 11.0@@ -196,7 +195,7 @@ print(getattrs(dados['gps'])) ``` -{'altitude': 14.5, 'latitude': -14.814161, 'longitude': -39.031841, 'num_satellites': 12.0} +{'altitude': 807.8, 'latitude': -23.44242, 'longitude': -46.472522, 'num_satellites': 11.0}@@ -213,7 +212,7 @@ dados['gps']._latitude - (#9060) [-14.814147,-14.814149,-14.814145,-14.814156,-14.814157,-14.814146,-14.814143,-14.814154,-14.814155,-14.814156...] + (#9058) [-23.329051,-23.329054,-23.329058,-23.329051,-23.329052,-23.329054,-23.32904,-23.329055,-23.329057,-23.32906...] @@ -224,7 +223,7 @@ dados['gps']._longitude - (#9060) [-39.031852,-39.031857,-39.031859,-39.031857,-39.031851,-39.031846,-39.031839,-39.031822,-39.031811,-39.031814...] + (#9058) [-51.137013,-51.137008,-51.137002,-51.137009,-51.137008,-51.137005,-51.137015,-51.137019,-51.137025,-51.13702...] @@ -235,7 +234,7 @@ dados['gps']._altitude - (#9060) [25.5,23.8,25.1,22.5,24.6,26.8,26.6,23.3,25.4,23.7...] + (#9058) [590.8,589.9,589.9,590.6,590.7,589.8,590.3,589.7,589.0,589.5...] @@ -246,7 +245,7 @@ dados['gps']._num_satellites - (#9060) [12,12,12,12,12,12,12,12,12,12...] + (#9058) [11,11,11,11,11,11,11,11,11,11...] @@ -328,13 +327,13 @@ print(fluxo.levels) ``` -[[-112.5 -117. -111. ... -106. -105. -99.5] - [-111.5 -115.5 -116.5 ... -103. -101.5 -101. ] - [-116.5 -113. -113.5 ... -105.5 -103.5 -105. ] +[[ -95. -87.5 -86. ... -91.5 -90.5 -91.5] + [ -85.5 -86. -87. ... -90.5 -92. -96. ] + [ -86. -90. -95.5 ... -100. -91. -91.5] ... - [-113. -111.5 -111.5 ... -99.5 -101.5 -98.5] - [-126. -124. -116. ... -97. -97.5 -98.5] - [-108.5 -110.5 -111.5 ... -98. -97.5 -103.5]] + [ -89.5 -90. -85.5 ... -96.5 -91. -91. ] + [ -91. -94. -92.5 ... -91. -96.5 -98.5] + [ -83. -83.5 -91. ... -99. -99.5 -95.5]]@@ -344,7 +343,7 @@ print(f'Formato da matriz com os níveis: {fluxo.levels.shape}') ``` -Formato da matriz com os níveis: (8715, 3584) +Formato da matriz com os níveis: (2576, 1024)@@ -356,7 +355,7 @@ print(len(fluxo)) ``` -8715 +9058
@@ -410,44 +409,44 @@ fluxo.matrix().iloc[:5, :5]- 2021-06-26 12:01:00.731405 --112.5 --117.0 --111.0 --111.5 --117.0 +2021-06-18 21:03:00.762503 +-95.0 +-87.5 +-86.0 +-90.0 +-92.5 - 2021-06-26 12:02:00.731287 --111.5 --115.5 --116.5 --112.5 --107.0 +2021-06-18 21:04:01.432664 +-85.5 +-86.0 +-87.0 +-84.0 +-77.5 - 2021-06-26 12:03:00.731107 --116.5 --113.0 --113.5 --109.5 --107.5 +2021-06-18 21:05:01.182570 +-86.0 +-90.0 +-95.5 +-85.0 +-84.5 - 2021-06-26 12:04:00.731401 --111.5 --112.0 --110.0 --110.5 --109.0 +2021-06-18 21:06:00.812513 +-86.0 +-87.5 +-91.5 +-96.5 +-93.5 - diff --git a/docs/constants.html b/docs/constants.html index 53ee81d..2087876 100644 --- a/docs/constants.html +++ b/docs/constants.html @@ -240,6 +240,7 @@2021-06-26 12:05:00.731532 --113.0 --115.0 --117.5 --110.0 --111.0 +2021-06-18 21:07:01.402635 +-90.0 +-83.0 +-84.5 +-88.5 +-85.5 Variables Used in
parser.py
7: ( "type", "thread_id", + "thresh", "start_mega", "stop_mega", "namal", @@ -279,6 +280,7 @@Variables Used in
parser.py
61: ( "type", "thread_id", + "thresh", "start_mega", "stop_mega", "ndata", @@ -310,6 +312,7 @@Variables Used in
parser.py
64: ( "type", "thread_id", + "thresh", "description", "start_mega", "stop_mega", @@ -344,6 +347,7 @@Variables Used in
parser.py
68: ( "type", "thread_id", + "thresh", "description", "start_mega", "stop_mega", diff --git a/docs/index.html b/docs/index.html index 11387bf..15ee626 100644 --- a/docs/index.html +++ b/docs/index.html @@ -147,7 +147,7 @@Como utilizar -
parse_bin
[source]+
parse_bin
(bin_file
:Union
[str
,Path
])
parse_bin
[source]
parse_bin
(bin_file
:Union
[str
,Path
])Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes A block is a piece of the .bin file with a known start and end and that contains different types of information. @@ -220,7 +220,7 @@
Extração de Dados
@@ -253,31 +253,31 @@Extração de Dados
{ - 'filename': 'rfeye002113_210626_T120001.bin', + 'filename': 'rfeye002263_210618_T210255.bin', 'file_version': 23, 'string': 'CRFS DATA FILE V023', - 'hostname': 'rfeye002113', - 'method': 'ScriptRFeye2021_v2.cfg', + 'hostname': 'rfeye002263', + 'method': 'ScriptRFeye2021_v.1', 'unit_info': 'Stationary', 'file_number': 0, 'identifier': 'INFO', - 'gps': GPS Data - Median of Coordinates: -14.81416:-39.03184 Altitude: 14.50 #Satellites: -12.0, + 'gps': GPS Data - Median of Coordinates: -23.32905:-51.13701 Altitude: 591.30 +#Satellites: 11.0, 'spectrum': [SpecData(type=67, thread_id=300, description='PMEC 2021 (Faixa 1 de 10).', start_mega=105.0, stop_mega=140.0, dtype='dBm', ndata=3584, bw=18457, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=310, description='PMEC 2021 (Faixa 2 de 10).', start_mega=155.0, stop_mega=165.0, dtype='dBm', ndata=1024, bw=18457, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=100, description='PRD 2021 (Faixa principal 1 de 4).', start_mega=50.0, stop_mega=90.0, -dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-90.5, -minimum=-90.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de +dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-45.5, +minimum=-45.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de 4).', start_mega=70.0, stop_mega=110.0, dtype='dBμV/m', ndata=1024, bw=73828, -processing='peak', antuid=0, thresh=-67.5, minimum=-67.5), SpecData(type=67, thread_id=120, +processing='peak', antuid=0, thresh=-29.5, minimum=-29.5), SpecData(type=67, thread_id=120, description='PRD 2021 (Faixa principal 3 de 4).', start_mega=170.0, stop_mega=220.0, -dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-37.5, -minimum=-37.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de +dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-51.5, +minimum=-51.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de 4).', start_mega=470.0, stop_mega=700.0, dtype='dBμV/m', ndata=5888, bw=73828, -processing='peak', antuid=0, thresh=-41.5, minimum=-41.5), SpecData(type=67, thread_id=200, +processing='peak', antuid=0, thresh=-39.5, minimum=-39.5), SpecData(type=67, thread_id=200, description='PMEF 2021 (Faixa 1 de 6).', start_mega=700.0, stop_mega=960.0, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=210, description='PMEF 2021 (Faixa 2 de 6).', start_mega=1710.0, @@ -289,29 +289,28 @@@@ -367,7 +366,7 @@Extração de Dadosdtype='dBm', ndata=2560, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=240, description='PMEF 2021 (Faixa 5 de 6).', start_mega=2500.0, stop_mega=2690.0, dtype='dBm', ndata=4864, bw=73828, processing='peak', -antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250, description='PMEF -2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', ndata=10496, -bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=320, description='PMEC 2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, -dtype='dBm', ndata=512, bw=73828, processing='peak', antuid=0, thresh=-147.5, -minimum=-147.5), SpecData(type=67, thread_id=330, description='PMEC 2021 (Faixa 4 de 10).', -start_mega=400.0, stop_mega=410.0, dtype='dBm', ndata=256, bw=73828, processing='peak', -antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=340, description='PMEC -2021 (Faixa 5 de 10).', start_mega=960.0, stop_mega=1001218.999, dtype='dBm', ndata=6656, +antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=320, description='PMEC +2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, dtype='dBm', ndata=512, bw=73828, +processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=330, +description='PMEC 2021 (Faixa 4 de 10).', start_mega=400.0, stop_mega=410.0, dtype='dBm', +ndata=256, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), +SpecData(type=67, thread_id=340, description='PMEC 2021 (Faixa 5 de 10).', start_mega=960.0, +stop_mega=1001218.999, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0, +thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=350, description='PMEC 2021 +(Faixa 6 de 10).', start_mega=1001388.999, stop_mega=1001428.999, dtype='dBm', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=350, description='PMEC 2021 (Faixa 6 de 10).', start_mega=1001388.999, -stop_mega=1001428.999, dtype='dBm', ndata=1280, bw=73828, processing='peak', antuid=0, -thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=360, description='PMEC 2021 -(Faixa 7 de 10).', start_mega=1530.0, stop_mega=1001648.999, dtype='dBm', ndata=3072, +thread_id=360, description='PMEC 2021 (Faixa 7 de 10).', start_mega=1530.0, +stop_mega=1001648.999, dtype='dBm', ndata=3072, bw=73828, processing='peak', antuid=0, +thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=370, description='PMEC 2021 +(Faixa 8 de 10).', start_mega=2690.0, stop_mega=1002898.999, dtype='dBm', ndata=5376, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, -thread_id=370, description='PMEC 2021 (Faixa 8 de 10).', start_mega=2690.0, -stop_mega=1002898.999, dtype='dBm', ndata=5376, bw=73828, processing='peak', antuid=0, -thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=380, description='PMEC 2021 -(Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0, dtype='dBm', ndata=4096, bw=73828, -processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=390, -description='PMEC 2021 (Faixa 10 de 10).', start_mega=1005338.999, stop_mega=1005458.999, -dtype='dBm', ndata=3328, bw=73828, processing='peak', antuid=0, thresh=-147.5, -minimum=-147.5)] +thread_id=380, description='PMEC 2021 (Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0, +dtype='dBm', ndata=4096, bw=73828, processing='peak', antuid=0, thresh=-147.5, +minimum=-147.5), SpecData(type=67, thread_id=390, description='PMEC 2021 (Faixa 10 de 10).', +start_mega=1005338.999, stop_mega=1005458.999, dtype='dBm', ndata=3328, bw=73828, +processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250, +description='PMEF 2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', +ndata=10496, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5)] }
GPS
No entanto as du
@@ -434,7 +433,7 @@
getattrs
-{'altitude': 14.5, 'latitude': -14.814161, 'longitude': -39.031841, 'num_satellites': 12.0} +{'altitude': 807.8, 'latitude': -23.44242, 'longitude': -46.472522, 'num_satellites': 11.0}@@ -484,7 +483,7 @@Dados Brutos de GPS -
(#9060) [-14.814147,-14.814149,-14.814145,-14.814156,-14.814157,-14.814146,-14.814143,-14.814154,-14.814155,-14.814156...]+(#9058) [-23.329051,-23.329054,-23.329058,-23.329051,-23.329052,-23.329054,-23.32904,-23.329055,-23.329057,-23.32906...]@@ -517,7 +516,7 @@Dados Brutos de GPS -
(#9060) [-39.031852,-39.031857,-39.031859,-39.031857,-39.031851,-39.031846,-39.031839,-39.031822,-39.031811,-39.031814...]+(#9058) [-51.137013,-51.137008,-51.137002,-51.137009,-51.137008,-51.137005,-51.137015,-51.137019,-51.137025,-51.13702...]@@ -550,7 +549,7 @@Dados Brutos de GPS -
(#9060) [25.5,23.8,25.1,22.5,24.6,26.8,26.6,23.3,25.4,23.7...]+(#9058) [590.8,589.9,589.9,590.6,590.7,589.8,590.3,589.7,589.0,589.5...]@@ -583,7 +582,7 @@Dados Brutos de GPS -
(#9060) [12,12,12,12,12,12,12,12,12,12...]+(#9058) [11,11,11,11,11,11,11,11,11,11...]@@ -834,13 +833,13 @@Dados de Nível Espectral -
[[-112.5 -117. -111. ... -106. -105. -99.5] - [-111.5 -115.5 -116.5 ... -103. -101.5 -101. ] - [-116.5 -113. -113.5 ... -105.5 -103.5 -105. ] +[[ -95. -87.5 -86. ... -91.5 -90.5 -91.5] + [ -85.5 -86. -87. ... -90.5 -92. -96. ] + [ -86. -90. -95.5 ... -100. -91. -91.5] ... - [-113. -111.5 -111.5 ... -99.5 -101.5 -98.5] - [-126. -124. -116. ... -97. -97.5 -98.5] - [-108.5 -110.5 -111.5 ... -98. -97.5 -103.5]] + [ -89.5 -90. -85.5 ... -96.5 -91. -91. ] + [ -91. -94. -92.5 ... -91. -96.5 -98.5] + [ -83. -83.5 -91. ... -99. -99.5 -95.5]]@@ -874,7 +873,7 @@Dados de Nível Espectral -
Formato da matriz com os níveis: (8715, 3584) +Formato da matriz com os níveis: (2576, 1024)@@ -915,7 +914,7 @@Dados de Nível Espectral -
8715 +9058
@@ -993,44 +992,44 @@Medidas de nível como
- 2021-06-26 12:01:00.731405 --112.5 --117.0 --111.0 --111.5 --117.0 +2021-06-18 21:03:00.762503 +-95.0 +-87.5 +-86.0 +-90.0 +-92.5 - 2021-06-26 12:02:00.731287 --111.5 --115.5 --116.5 --112.5 --107.0 +2021-06-18 21:04:01.432664 +-85.5 +-86.0 +-87.0 +-84.0 +-77.5 - 2021-06-26 12:03:00.731107 --116.5 --113.0 --113.5 --109.5 --107.5 +2021-06-18 21:05:01.182570 +-86.0 +-90.0 +-95.5 +-85.0 +-84.5 - 2021-06-26 12:04:00.731401 --111.5 --112.0 --110.0 --110.5 --109.0 +2021-06-18 21:06:00.812513 +-86.0 +-87.5 +-91.5 +-96.5 +-93.5 - diff --git a/docs/parser.html b/docs/parser.html index 9ccfaa6..2b6387f 100644 --- a/docs/parser.html +++ b/docs/parser.html @@ -31,15 +31,7 @@2021-06-26 12:05:00.731532 --113.0 --115.0 --117.5 --110.0 --111.0 +2021-06-18 21:07:01.402635 +-90.0 +-83.0 +-84.5 +-88.5 +-85.5 @@ -54,16 +46,9 @@-Processamento do Arquivo
.bin
e criação dos diferentes tipos de blocosA função seguinte
-parse_bin
recebe um arquivo.bin
e mapeia os blocos contidos nele retornando um dicionário:-
-- -
file_version
: Versão do arquivo.bin
- -
-
blocks
: Dicionário com os blocos do arquivo.bin
. Cada tipo de bloco tem sua Classe PrópriaO dicionário
-blocks
retornado tem como chave uma tupla (tipo de bloco,thread_id
) e os valores como uma lista com os blocos ( classes ) extraídos sequencialmente.O tipo de bloco é a natureza do dado contido, por exemplo: 40 - GPS, 67 - Dado Espectral. O
- +thread_id
discrimina em geral diferentes "faixas" do mesmo tipo de dado. Para dados espectrais, por exemplo, diferentes thread_id representam varreduras de faixas de frequência distintasProcessamento do Arquivo
.bin
e criação dos diferentes tipos de blocos-
parse_bin
[source]+
parse_bin
(bin_file
:Union
[str
,Path
])
evaluate_checksum
[source]-
evaluate_checksum
(byte_block
:bytes
)Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes -A block is a piece of the .bin file with a known start and end and that contains different types of information. -It has several fields: file_type, header, data and footer. -Each field has lengths and information defined in the documentation. -Args: - bin_file (Union[str, Path]): path to the bin file
-Returns: - Dictionary with the file metadata, file_version, string info, gps and spectrum blocks.
+Receives a byte_block and verify if the calculated checksum is equal to the one registed in the specific byte
@@ -82,13 +67,6 @@
parse_bin
-- {% raw %}--A função a seguir recebe os bytes lidos do arquivo
- -.bin
e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco@@ -100,9 +78,10 @@@@ -121,6 +100,13 @@
parse_bin
-
evaluate_checksum
[source]+
evaluate_checksum
(byte_block
:bytes
)
byte2base_block
[source]-
byte2base_block
(byte_block
:bytes
)Receives a byte_block and verify if the calculated checksum is equal to the one registed in the specific byte
+Receives a byte block from the bin file and returns a dataclass with the attributes +'thread_id', 'size', 'type', 'data', 'checksum' or None in case any error is identified.
evaluate_checksum
{% endraw %} +{% raw %}++++A função a seguir recebe os bytes lidos do arquivo
+ +.bin
e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco@@ -132,10 +118,11 @@@@ -154,6 +141,13 @@
evaluate_checksum
-
byte2base_block
[source]+
byte2base_block
(byte_block
:bytes
)
create_block
[source]-
create_block
(byte_block
:bytes
)Receives a byte block from the bin file and returns a dataclass with the attributes -'thread_id', 'size', 'type', 'data', 'checksum' or None in case any error is identified.
+Receives a byte_block, and converts it into one of the main classes +Args: byte_block: A byte block directly returned from the file +Returns: The Instance of the Block Type or None in case of error
byte2base_block
{% endraw %} +{% raw %}++++A função a seguir recebe os bytes lidos do arquivo
+ +.bin
e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco@@ -165,11 +159,16 @@@@ -199,7 +198,7 @@
byte2base_block
-
create_block
[source]+
create_block
(byte_block
:bytes
)
parse_bin
[source]-
parse_bin
(bin_file
:Union
[str
,Path
])Receives a byte_block, and converts it into one of the main classes -Args: byte_block: A byte block directly returned from the file -Returns: The Instance of the Block Type or None in case of error
+Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes +A block is a piece of the .bin file with a known start and end and that contains different types of information. +It has several fields: file_type, header, data and footer. +Each field has lengths and information defined in the documentation. +Args: + bin_file (Union[str, Path]): path to the bin file
+Returns: + Dictionary with the file metadata, file_version, string info, gps and spectrum blocks.
create_block
-
class
CrfsGPS
[source]+
CrfsGPS
()
class
CrfsGPS
[source]
CrfsGPS
()Class with the GPS Attributes from the CRFS Bin File
@@ -224,7 +223,7 @@
class
CrfsGPS
-
class
CrfsSpectrum
[source]+
CrfsSpectrum
(metadata
:namedtuple
) ::GetAttr
class
CrfsSpectrum
[source]
CrfsSpectrum
(metadata
:namedtuple
) ::GetAttr
Class with the metadata and levels of a spectrum block from a CRFS Bin File
@@ -310,12 +309,15 @@
class
CrfsSpectrum self._data = None gc.collect() return levels + + @cached + def frequencies(self)->np.ndarray: + return np.linspace(self.start_mega, self.stop_mega, num=self.ndata) def matrix(self): """Returns the matrix formed from the spectrum levels and timestamp""" - frequencies = np.linspace(self.start_mega, self.stop_mega, num=self.ndata) index = self._timestamp if len(self._timestamp) == len(self) else None - data = pd.DataFrame(self.levels, index=index, columns=frequencies) + data = pd.DataFrame(self.levels, index=index, columns=self.frequencies) data.columns.name = "Frequencies" data.index.name = "Time" return data @@ -339,7 +341,7 @@
class
CrfsSpectrum
@@ -395,7 +397,7 @@
append_spec_data
-
classify_blocks
[source]+
classify_blocks
(byte_blocks
:Iterable
[T_co
])
classify_blocks
[source]
classify_blocks
(byte_blocks
:Iterable
[T_co
])Receives an iterable with binary blocks and returns a dict with the metadata from file, the gps class and a list with the different spectrum classes
diff --git a/nbs/01_parser.ipynb b/nbs/01_parser.ipynb index 8a07989..be5c05f 100644 --- a/nbs/01_parser.ipynb +++ b/nbs/01_parser.ipynb @@ -113,54 +113,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Processamento do Arquivo `.bin` e criação dos diferentes tipos de blocos\n", - "A função seguinte `parse_bin` recebe um arquivo `.bin` e mapeia os blocos contidos nele retornando um dicionário:\n", - " * `file_version`: Versão do arquivo `.bin`\n", - " * `blocks`: Dicionário com os blocos do arquivo `.bin`. Cada tipo de bloco tem sua Classe Própria\n", - " \n", - " O dicionário `blocks` retornado tem como chave uma tupla (tipo de bloco, `thread_id`) e os valores como uma lista com os blocos ( classes ) extraídos sequencialmente.\n", - "\n", - "O tipo de bloco é a natureza do dado contido, por exemplo: 40 - GPS, 67 - Dado Espectral. O `thread_id` discrimina em geral diferentes \"faixas\" do mesmo tipo de dado. Para dados espectrais, por exemplo, diferentes thread_id representam varreduras de faixas de frequência distintas" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#export\n", - "def parse_bin(bin_file: Union[str, Path]) -> dict:\n", - " \"\"\"Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes\n", - " A block is a piece of the .bin file with a known start and end and that contains different types of information.\n", - " It has several fields: file_type, header, data and footer.\n", - " Each field has lengths and information defined in the documentation.\n", - " Args:\n", - " bin_file (Union[str, Path]): path to the bin file\n", - "\n", - " Returns:\n", - " Dictionary with the file metadata, file_version, string info, gps and spectrum blocks.\n", - " \"\"\"\n", - " bin_file = Path(bin_file)\n", - " with open(bin_file, mode=\"rb\") as bfile:\n", - " # The first block of the file is the header and is 36 bytes long.\n", - " header = bfile.read(BYTES_HEADER)\n", - " body = bfile.read()\n", - " meta = classify_blocks(body.split(ENDMARKER))\n", - " parsed = {\n", - " \"filename\": bin_file.name,\n", - " \"file_version\": bin2int(header[:4]),\n", - " \"string\": bin2str(header[4:]),\n", - " }\n", - " parsed.update(meta)\n", - " return parsed" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A função a seguir recebe os bytes lidos do arquivo `.bin` e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco" + "## Processamento do Arquivo `.bin` e criação dos diferentes tipos de blocos" ] }, { @@ -209,6 +162,13 @@ " )" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A função a seguir recebe os bytes lidos do arquivo `.bin` e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco" + ] + }, { "cell_type": "code", "execution_count": null, @@ -223,19 +183,60 @@ " \"\"\"\n", " base_block = byte2base_block(byte_block)\n", " if not base_block:\n", - " return None\n", + " return None, None\n", " block_type = base_block.type\n", " constructor = MAIN_BLOCKS.get(block_type)\n", " if not constructor:\n", " _ = logger.log(\n", " \"INFO\", f\"This block type constructor is not implemented: {block_type}\"\n", " )\n", - " return None\n", + " return None, None\n", " block = constructor(base_block)\n", " if getattr(block, \"gerror\", -1) != -1 or getattr(block, \"gps_status\", -1) == 0:\n", " _ = logger.log(\"INFO\", f\"Block with error: {block_type}\")\n", - " return None # spectral or gps blocks with error\n", - " return block" + " return None, None # spectral or gps blocks with error\n", + " return getattrs(block, KEY_ATTRS.get(block.type)), block" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A função a seguir recebe os bytes lidos do arquivo `.bin` e mapeia esses bytes em diferentes classes de acordo com o tipo de bloco" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#export\n", + "def parse_bin(bin_file: Union[str, Path]) -> dict:\n", + " \"\"\"Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes\n", + " A block is a piece of the .bin file with a known start and end and that contains different types of information.\n", + " It has several fields: file_type, header, data and footer.\n", + " Each field has lengths and information defined in the documentation.\n", + " Args:\n", + " bin_file (Union[str, Path]): path to the bin file\n", + "\n", + " Returns:\n", + " Dictionary with the file metadata, file_version, string info, gps and spectrum blocks.\n", + " \"\"\"\n", + " bin_file = Path(bin_file)\n", + " with open(bin_file, mode=\"rb\") as bfile:\n", + " # The first block of the file is the header and is 36 bytes long.\n", + " header = bfile.read(BYTES_HEADER)\n", + " body = bfile.read()\n", + " blocks = parallel(create_block, body.split(ENDMARKER), threadpool=True)\n", + " meta = classify_blocks(blocks)\n", + " parsed = {\n", + " \"filename\": bin_file.name,\n", + " \"file_version\": bin2int(header[:4]),\n", + " \"string\": bin2str(header[4:]),\n", + " }\n", + " parsed.update(meta)\n", + " return parsed" ] }, { @@ -310,12 +311,15 @@ " self._data = None\n", " gc.collect()\n", " return levels\n", + " \n", + " @cached\n", + " def frequencies(self)->np.ndarray:\n", + " return np.linspace(self.start_mega, self.stop_mega, num=self.ndata)\n", "\n", " def matrix(self):\n", " \"\"\"Returns the matrix formed from the spectrum levels and timestamp\"\"\"\n", - " frequencies = np.linspace(self.start_mega, self.stop_mega, num=self.ndata)\n", " index = self._timestamp if len(self._timestamp) == len(self) else None\n", - " data = pd.DataFrame(self.levels, index=index, columns=frequencies)\n", + " data = pd.DataFrame(self.levels, index=index, columns=self.frequencies)\n", " data.columns.name = \"Frequencies\"\n", " data.index.name = \"Time\"\n", " return data" @@ -328,22 +332,22 @@ "outputs": [], "source": [ "#export\n", - "def check_block_exists(attrs, fluxos, block):\n", + "def check_block_exists(attrs, fluxos):\n", " \"\"\"Receives a dict of attributes and check if its values exist as keys in fluxos, otherwise create one and set to CrfsSpectrum Class\"\"\"\n", " values = tuple(attrs.values())\n", " if values not in fluxos:\n", - " attributes = list(attrs.keys())\n", - " metavalues = list(values)\n", - " if hasattr(block, 'thresh'):\n", - " if 'thresh' not in attributes:\n", - " attributes.append('thresh')\n", - " metavalues.append(block.thresh)\n", - " if hasattr(block, 'minimum'):\n", - " if 'minimum' not in attributes:\n", - " attributes.append('minimum')\n", - " metavalues.append(block.minimum)\n", - " metadata = namedtuple(\"SpecData\", attributes)\n", - " fluxos[values] = CrfsSpectrum(metadata(*metavalues))\n", + " # attributes = list(attrs.keys())\n", + " # metavalues = list(values)\n", + " # if hasattr(block, 'thresh'):\n", + " # if 'thresh' not in attributes:\n", + " # attributes.append('thresh')\n", + " # metavalues.append(block.thresh)\n", + " # if hasattr(block, 'minimum'):\n", + " # if 'minimum' not in attributes:\n", + " # attributes.append('minimum')\n", + " # metavalues.append(block.minimum)\n", + " metadata = namedtuple(\"SpecData\", attrs.keys())\n", + " fluxos[values] = CrfsSpectrum(metadata(*attrs.values()))\n", " return values, fluxos" ] }, @@ -355,7 +359,7 @@ "source": [ "#export\n", "def append_spec_data(attrs, fluxos, block)->None:\n", - " values, fluxos = check_block_exists(attrs, fluxos, block)\n", + " values, fluxos = check_block_exists(attrs, fluxos)\n", " time = getattr(block, \"wallclock_datetime\", None)\n", " data = getattr(block, 'levels', None)\n", " if time is not None:\n", @@ -368,16 +372,15 @@ " meta = {}\n", " fluxos = {}\n", " gps = CrfsGPS()\n", - " for byte_block in byte_blocks:\n", - " block = create_block(byte_block)\n", + " for attrs, block in byte_blocks:\n", " if not block:\n", " continue\n", - " if block.type == 40:\n", + " dtype = block.type\n", + " if dtype == 40:\n", " for k in BLOCK_ATTRS.get(40, []):\n", " getattr(gps, f\"_{k}\").append(getattr(block, k))\n", " continue\n", - " attrs = getattrs(block, attrs=KEY_ATTRS.get(block.type))\n", - " if block.type in VECTOR_BLOCKS:\n", + " if dtype in VECTOR_BLOCKS:\n", " append_spec_data(attrs, fluxos, block)\n", " else:\n", " meta.update(attrs)\n", diff --git a/nbs/04_constants.ipynb b/nbs/04_constants.ipynb index db33e63..e59c8a8 100644 --- a/nbs/04_constants.ipynb +++ b/nbs/04_constants.ipynb @@ -236,6 +236,7 @@ " 7: (\n", " \"type\",\n", " \"thread_id\",\n", + " \"thresh\",\n", " \"start_mega\",\n", " \"stop_mega\",\n", " \"namal\",\n", @@ -275,6 +276,7 @@ " 61: (\n", " \"type\",\n", " \"thread_id\",\n", + " \"thresh\", \n", " \"start_mega\",\n", " \"stop_mega\",\n", " \"ndata\",\n", @@ -306,6 +308,7 @@ " 64: (\n", " \"type\",\n", " \"thread_id\",\n", + " \"thresh\",\n", " \"description\",\n", " \"start_mega\",\n", " \"stop_mega\",\n", @@ -340,6 +343,7 @@ " 68: (\n", " \"type\",\n", " \"thread_id\",\n", + " \"thresh\",\n", " \"description\",\n", " \"start_mega\",\n", " \"stop_mega\",\n", @@ -443,7 +447,8 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.7.10 64-bit ('rfpye': conda)", + "display_name": "Python 3", + "language": "python", "name": "python3" } }, diff --git a/nbs/_cythonize.ipynb b/nbs/_cythonize.ipynb index 61cc24d..5f9677e 100644 --- a/nbs/_cythonize.ipynb +++ b/nbs/_cythonize.ipynb @@ -16,7 +16,7 @@ "\n", "%load_ext autoreload\n", "%load_ext line_profiler\n", - "%load_ext cython\n", + "#%load_ext cython\n", "%autoreload 2 " ] }, @@ -56,6 +56,46 @@ "file = files.shuffle()[0]" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "7414de69-c985-4f6d-a314-456a3f11b31c", + "metadata": {}, + "outputs": [], + "source": [ + "file = Path('D:/OneDrive - ANATEL/Sensores/rfeye002295/rfeye002295_210622_T220240.bin')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dcf1d1d8-7746-461d-a954-87fd75607f10", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'filename': 'rfeye002295_210622_T220240.bin',\n", + " 'file_version': 23,\n", + " 'string': 'CRFS DATA FILE V023',\n", + " 'hostname': 'rfeye002295',\n", + " 'method': 'ScriptRFeye2021_v2.cfg',\n", + " 'unit_info': 'Stationary',\n", + " 'file_number': 0,\n", + " 'identifier': 'INFO',\n", + " 'gps': GPS Data - Median of Coordinates: -3.02318:-60.05499 Altitude: 105.00 #Satellites: 12.0,\n", + " 'spectrum': (#20) [SpecData(type=67, thread_id=300, description='PMEC 2021 (Faixa 1 de 10).', start_mega=105.0, stop_mega=140.0, dtype='dBm', ndata=3584, bw=18457, processing='peak', antuid=0),SpecData(type=67, thread_id=310, description='PMEC 2021 (Faixa 2 de 10).', start_mega=155.0, stop_mega=165.0, dtype='dBm', ndata=1024, bw=18457, processing='peak', antuid=0),SpecData(type=67, thread_id=100, description='PRD 2021 (Faixa principal 1 de 4).', start_mega=50.0, stop_mega=90.0, dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de 4).', start_mega=70.0, stop_mega=110.0, dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=120, description='PRD 2021 (Faixa principal 3 de 4).', start_mega=170.0, stop_mega=220.0, dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de 4).', start_mega=470.0, stop_mega=700.0, dtype='dBμV/m', ndata=5888, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=200, description='PMEF 2021 (Faixa 1 de 6).', start_mega=700.0, stop_mega=960.0, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=210, description='PMEF 2021 (Faixa 2 de 6).', start_mega=1710.0, stop_mega=1980.0, dtype='dBm', ndata=6912, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=220, description='PMEF 2021 (Faixa 3 de 6).', start_mega=2100.0, stop_mega=1002168.999, dtype='dBm', ndata=1792, bw=73828, processing='peak', antuid=0),SpecData(type=67, thread_id=230, description='PMEF 2021 (Faixa 4 de 6).', start_mega=2290.0, stop_mega=2390.0, dtype='dBm', ndata=2560, bw=73828, processing='peak', antuid=0)...]}" + ] + }, + "execution_count": null, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "blocks" + ] + }, { "cell_type": "code", "execution_count": null, @@ -67,37 +107,34 @@ "text/plain": [ "Timer unit: 3.52617e-07 s\n", "\n", - "Total time: 19.2928 s\n", + "Total time: 7.30025 s\n", "File: C:\\Users\\rsilva\\Code\\rfpye\\rfpye\\parser.py\n", - "Function: classify_blocks at line 196\n", + "Function: classify_blocks at line 231\n", "\n", "Line # Hits Time Per Hit % Time Line Contents\n", "==============================================================\n", - " 196 def classify_blocks(byte_blocks: Iterable) -> dict:\n", - " 197 \"\"\"Receives an iterable with binary blocks and returns a dict with the metadata from file, the gps class and a list with the different spectrum classes\"\"\"\n", - " 198 1 13.0 13.0 0.0 meta = {}\n", - " 199 1 3.0 3.0 0.0 fluxos = {}\n", - " 200 1 68.0 68.0 0.0 gps = CrfsGPS()\n", - " 201 1 21.0 21.0 0.0 gps_attrs = [f'_{k}' for k in BLOCK_ATTRS.get(40, [])]\n", - " 202 43760 94232.0 2.2 0.2 for byte_block in byte_blocks:\n", - " 203 43759 17632737.0 403.0 32.2 block = create_block(byte_block)\n", - " 204 43759 102960.0 2.4 0.2 if not block: continue\n", - " 205 42319 1514268.0 35.8 2.8 if block.type == 40:\n", - " 206 54336 117157.0 2.2 0.2 for k in BLOCK_ATTRS.get(40, []):\n", - " 207 45280 2714871.0 60.0 5.0 getattr(gps, f'_{k}').append(getattr(block, k))\n", - " 208 9056 14468.0 1.6 0.0 continue\n", - " 209 33263 20526103.0 617.1 37.5 attrs = getattrs(block, attrs=KEY_ATTRS.get(block.type, []))\n", - " 210 33263 1312795.0 39.5 2.4 if block.type in SPECTRAL_BLOCKS:\n", - " 211 33110 402839.0 12.2 0.7 values, fluxos = check_block_exists(attrs, fluxos, block)\n", - " 212 33110 4286312.0 129.5 7.8 time = getattr(block, 'wallclock_datetime')\n", - " 213 33110 1350873.0 40.8 2.5 attr = 'raw_data' if block.type in COMPRESSED else 'levels'\n", - " 214 33110 3855834.0 116.5 7.0 data = getattr(block, attr)\n", - " 215 33110 786637.0 23.8 1.4 fluxos[values]._append(time, data)\n", - " 216 else:\n", - " 217 153 711.0 4.6 0.0 meta.update(attrs)\n", - " 218 1 3.0 3.0 0.0 meta['gps'] = gps\n", - " 219 1 113.0 113.0 0.0 meta['spectrum'] = L(fluxos.values())\n", - " 220 1 4.0 4.0 0.0 return meta" + " 231 def classify_blocks(byte_blocks: Iterable) -> dict:\n", + " 232 \"\"\"Receives an iterable with binary blocks and returns a dict with the metadata from file, the gps class and a list with the different spectrum classes\"\"\"\n", + " 233 1 12.0 12.0 0.0 meta = {}\n", + " 234 1 2.0 2.0 0.0 fluxos = {}\n", + " 235 1 67.0 67.0 0.0 gps = CrfsGPS()\n", + " 236 45103 106188.0 2.4 0.5 for attrs, block in byte_blocks:\n", + " 237 #block = create_block(byte_block)\n", + " 238 45102 58087.0 1.3 0.3 if not block:\n", + " 239 3970 4129.0 1.0 0.0 continue\n", + " 240 41132 1528424.0 37.2 7.4 dtype = block.type\n", + " 241 41132 60314.0 1.5 0.3 if dtype == 40:\n", + " 242 54348 92520.0 1.7 0.4 for k in BLOCK_ATTRS.get(40, []):\n", + " 243 45290 3659149.0 80.8 17.7 getattr(gps, f\"_{k}\").append(getattr(block, k))\n", + " 244 9058 9994.0 1.1 0.0 continue\n", + " 245 #attrs = getattrs(block, KEY_ATTRS.get(dtype))\n", + " 246 32074 58408.0 1.8 0.3 if dtype in VECTOR_BLOCKS:\n", + " 247 31921 15124897.0 473.8 73.1 append_spec_data(attrs, fluxos, block)\n", + " 248 else:\n", + " 249 153 788.0 5.2 0.0 meta.update(attrs)\n", + " 250 1 3.0 3.0 0.0 meta[\"gps\"] = gps\n", + " 251 1 62.0 62.0 0.0 meta[\"spectrum\"] = L(fluxos.values())\n", + " 252 1 2.0 2.0 0.0 return meta" ] }, "metadata": {}, diff --git a/nbs/index.ipynb b/nbs/index.ipynb index d7459e1..5275454 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -209,7 +209,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Wall time: 15.2 s\n" + "Wall time: 15.1 s\n" ] } ], @@ -227,31 +227,31 @@ "data": { "text/html": [ "{\n", - " 'filename': 'rfeye002113_210626_T120001.bin',\n", + " 'filename': 'rfeye002263_210618_T210255.bin',\n", " 'file_version': 23,\n", " 'string': 'CRFS DATA FILE V023',\n", - " 'hostname': 'rfeye002113',\n", - " 'method': 'ScriptRFeye2021_v2.cfg',\n", + " 'hostname': 'rfeye002263',\n", + " 'method': 'ScriptRFeye2021_v.1',\n", " 'unit_info': 'Stationary',\n", " 'file_number': 0,\n", " 'identifier': 'INFO',\n", - " 'gps': GPS Data - Median of Coordinates: -14.81416:-39.03184 Altitude: 14.50 #Satellites:\n", - "12.0,\n", + " 'gps': GPS Data - Median of Coordinates: -23.32905:-51.13701 Altitude: 591.30 \n", + "#Satellites: 11.0,\n", " 'spectrum': [SpecData(type=67, thread_id=300, description='PMEC 2021 (Faixa 1 de 10).', \n", "start_mega=105.0, stop_mega=140.0, dtype='dBm', ndata=3584, bw=18457, processing='peak', \n", "antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=310, description='PMEC \n", "2021 (Faixa 2 de 10).', start_mega=155.0, stop_mega=165.0, dtype='dBm', ndata=1024, bw=18457,\n", "processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=100,\n", "description='PRD 2021 (Faixa principal 1 de 4).', start_mega=50.0, stop_mega=90.0, \n", - "dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-90.5, \n", - "minimum=-90.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de \n", + "dtype='dBμV/m', ndata=1024, bw=73828, processing='peak', antuid=0, thresh=-45.5, \n", + "minimum=-45.5), SpecData(type=67, thread_id=110, description='PRD 2021 (Faixa principal 2 de \n", "4).', start_mega=70.0, stop_mega=110.0, dtype='dBμV/m', ndata=1024, bw=73828, \n", - "processing='peak', antuid=0, thresh=-67.5, minimum=-67.5), SpecData(type=67, thread_id=120, \n", + "processing='peak', antuid=0, thresh=-29.5, minimum=-29.5), SpecData(type=67, thread_id=120, \n", "description='PRD 2021 (Faixa principal 3 de 4).', start_mega=170.0, stop_mega=220.0, \n", - "dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-37.5, \n", - "minimum=-37.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de \n", + "dtype='dBμV/m', ndata=1280, bw=73828, processing='peak', antuid=0, thresh=-51.5, \n", + "minimum=-51.5), SpecData(type=67, thread_id=130, description='PRD 2021 (Faixa principal 4 de \n", "4).', start_mega=470.0, stop_mega=700.0, dtype='dBμV/m', ndata=5888, bw=73828, \n", - "processing='peak', antuid=0, thresh=-41.5, minimum=-41.5), SpecData(type=67, thread_id=200, \n", + "processing='peak', antuid=0, thresh=-39.5, minimum=-39.5), SpecData(type=67, thread_id=200, \n", "description='PMEF 2021 (Faixa 1 de 6).', start_mega=700.0, stop_mega=960.0, dtype='dBm', \n", "ndata=6656, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), \n", "SpecData(type=67, thread_id=210, description='PMEF 2021 (Faixa 2 de 6).', start_mega=1710.0, \n", @@ -263,59 +263,58 @@ "dtype='dBm', ndata=2560, bw=73828, processing='peak', antuid=0, thresh=-147.5, \n", "minimum=-147.5), SpecData(type=67, thread_id=240, description='PMEF 2021 (Faixa 5 de 6).', \n", "start_mega=2500.0, stop_mega=2690.0, dtype='dBm', ndata=4864, bw=73828, processing='peak', \n", - "antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250, description='PMEF \n", - "2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', ndata=10496, \n", - "bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, \n", - "thread_id=320, description='PMEC 2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, \n", - "dtype='dBm', ndata=512, bw=73828, processing='peak', antuid=0, thresh=-147.5, \n", - "minimum=-147.5), SpecData(type=67, thread_id=330, description='PMEC 2021 (Faixa 4 de 10).', \n", - "start_mega=400.0, stop_mega=410.0, dtype='dBm', ndata=256, bw=73828, processing='peak', \n", - "antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=340, description='PMEC \n", - "2021 (Faixa 5 de 10).', start_mega=960.0, stop_mega=1001218.999, dtype='dBm', ndata=6656, \n", + "antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=320, description='PMEC \n", + "2021 (Faixa 3 de 10).', start_mega=320.0, stop_mega=340.0, dtype='dBm', ndata=512, bw=73828, \n", + "processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=330,\n", + "description='PMEC 2021 (Faixa 4 de 10).', start_mega=400.0, stop_mega=410.0, dtype='dBm', \n", + "ndata=256, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), \n", + "SpecData(type=67, thread_id=340, description='PMEC 2021 (Faixa 5 de 10).', start_mega=960.0, \n", + "stop_mega=1001218.999, dtype='dBm', ndata=6656, bw=73828, processing='peak', antuid=0, \n", + "thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=350, description='PMEC 2021 \n", + "(Faixa 6 de 10).', start_mega=1001388.999, stop_mega=1001428.999, dtype='dBm', ndata=1280, \n", "bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, \n", - "thread_id=350, description='PMEC 2021 (Faixa 6 de 10).', start_mega=1001388.999, \n", - "stop_mega=1001428.999, dtype='dBm', ndata=1280, bw=73828, processing='peak', antuid=0, \n", - "thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=360, description='PMEC 2021 \n", - "(Faixa 7 de 10).', start_mega=1530.0, stop_mega=1001648.999, dtype='dBm', ndata=3072, \n", + "thread_id=360, description='PMEC 2021 (Faixa 7 de 10).', start_mega=1530.0, \n", + "stop_mega=1001648.999, dtype='dBm', ndata=3072, bw=73828, processing='peak', antuid=0, \n", + "thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=370, description='PMEC 2021 \n", + "(Faixa 8 de 10).', start_mega=2690.0, stop_mega=1002898.999, dtype='dBm', ndata=5376, \n", "bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, \n", - "thread_id=370, description='PMEC 2021 (Faixa 8 de 10).', start_mega=2690.0, \n", - "stop_mega=1002898.999, dtype='dBm', ndata=5376, bw=73828, processing='peak', antuid=0, \n", - "thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=380, description='PMEC 2021 \n", - "(Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0, dtype='dBm', ndata=4096, bw=73828, \n", - "processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=390,\n", - "description='PMEC 2021 (Faixa 10 de 10).', start_mega=1005338.999, stop_mega=1005458.999, \n", - "dtype='dBm', ndata=3328, bw=73828, processing='peak', antuid=0, thresh=-147.5, \n", - "minimum=-147.5)]\n", + "thread_id=380, description='PMEC 2021 (Faixa 9 de 10).', start_mega=5000.0, stop_mega=5160.0,\n", + "dtype='dBm', ndata=4096, bw=73828, processing='peak', antuid=0, thresh=-147.5, \n", + "minimum=-147.5), SpecData(type=67, thread_id=390, description='PMEC 2021 (Faixa 10 de 10).', \n", + "start_mega=1005338.999, stop_mega=1005458.999, dtype='dBm', ndata=3328, bw=73828, \n", + "processing='peak', antuid=0, thresh=-147.5, minimum=-147.5), SpecData(type=67, thread_id=250,\n", + "description='PMEF 2021 (Faixa 6 de 6).', start_mega=3290.0, stop_mega=3700.0, dtype='dBm', \n", + "ndata=10496, bw=73828, processing='peak', antuid=0, thresh=-147.5, minimum=-147.5)]\n", "}\n", "\n" ], "text/plain": [ "\u001b[1m{\u001b[0m\n", - " \u001b[32m'filename'\u001b[0m: \u001b[32m'rfeye002113_210626_T120001.bin'\u001b[0m,\n", + " \u001b[32m'filename'\u001b[0m: \u001b[32m'rfeye002263_210618_T210255.bin'\u001b[0m,\n", " \u001b[32m'file_version'\u001b[0m: \u001b[1;36m23\u001b[0m,\n", " \u001b[32m'string'\u001b[0m: \u001b[32m'CRFS DATA FILE V023'\u001b[0m,\n", - " \u001b[32m'hostname'\u001b[0m: \u001b[32m'rfeye002113'\u001b[0m,\n", - " \u001b[32m'method'\u001b[0m: \u001b[32m'ScriptRFeye2021_v2.cfg'\u001b[0m,\n", + " \u001b[32m'hostname'\u001b[0m: \u001b[32m'rfeye002263'\u001b[0m,\n", + " \u001b[32m'method'\u001b[0m: \u001b[32m'ScriptRFeye2021_v.1'\u001b[0m,\n", " \u001b[32m'unit_info'\u001b[0m: \u001b[32m'Stationary'\u001b[0m,\n", " \u001b[32m'file_number'\u001b[0m: \u001b[1;36m0\u001b[0m,\n", " \u001b[32m'identifier'\u001b[0m: \u001b[32m'INFO'\u001b[0m,\n", - " \u001b[32m'gps'\u001b[0m: GPS Data - Median of Coordinates: \u001b[1;36m-14.81416\u001b[0m:\u001b[1;36m-39.03184\u001b[0m Altitude: \u001b[1;36m14.50\u001b[0m #Satellites:\n", - "\u001b[1;36m12.0\u001b[0m,\n", + " \u001b[32m'gps'\u001b[0m: GPS Data - Median of Coordinates: \u001b[1;36m-23.32905\u001b[0m:\u001b[1;36m-51.13701\u001b[0m Altitude: \u001b[1;36m591.30\u001b[0m \n", + "#Satellites: \u001b[1;36m11.0\u001b[0m,\n", " \u001b[32m'spectrum'\u001b[0m: \u001b[1m[\u001b[0m\u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m300\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 1 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \n", "\u001b[33mstart_mega\u001b[0m=\u001b[1;36m105\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m140\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m3584\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m18457\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \n", "\u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m310\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC \u001b[0m\n", "\u001b[32m2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 2 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m155\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m165\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1024\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m18457\u001b[0m,\n", "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m100\u001b[0m,\n", "\u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 1 de 4\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m50\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m90\u001b[0m\u001b[1;36m.0\u001b[0m, \n", - "\u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1024\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-90.5\u001b[0m, \n", - "\u001b[33mminimum\u001b[0m=\u001b[1;36m-90.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m110\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 2 de \u001b[0m\n", + "\u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1024\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-45.5\u001b[0m, \n", + "\u001b[33mminimum\u001b[0m=\u001b[1;36m-45.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m110\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 2 de \u001b[0m\n", "\u001b[32m4\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m70\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m110\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1024\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \n", - "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-67.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-67.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m120\u001b[0m, \n", + "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-29.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-29.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m120\u001b[0m, \n", "\u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 3 de 4\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m170\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m220\u001b[0m\u001b[1;36m.0\u001b[0m, \n", - "\u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1280\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-37.5\u001b[0m, \n", - "\u001b[33mminimum\u001b[0m=\u001b[1;36m-37.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m130\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 4 de \u001b[0m\n", + "\u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1280\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-51.5\u001b[0m, \n", + "\u001b[33mminimum\u001b[0m=\u001b[1;36m-51.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m130\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PRD 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa principal 4 de \u001b[0m\n", "\u001b[32m4\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m470\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m700\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBμV/m'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m5888\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \n", - "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-41.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-41.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m200\u001b[0m, \n", + "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-39.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-39.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m200\u001b[0m, \n", "\u001b[33mdescription\u001b[0m=\u001b[32m'PMEF 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 1 de 6\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m700\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m960\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \n", "\u001b[33mndata\u001b[0m=\u001b[1;36m6656\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \n", "\u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m210\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEF 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 2 de 6\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1710\u001b[0m\u001b[1;36m.0\u001b[0m, \n", @@ -327,29 +326,28 @@ "\u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m2560\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \n", "\u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m240\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEF 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 5 de 6\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \n", "\u001b[33mstart_mega\u001b[0m=\u001b[1;36m2500\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m2690\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m4864\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \n", - "\u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m250\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEF \u001b[0m\n", - "\u001b[32m2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 6 de 6\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m3290\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m3700\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m10496\u001b[0m, \n", - "\u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \n", - "\u001b[33mthread_id\u001b[0m=\u001b[1;36m320\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 3 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m320\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m340\u001b[0m\u001b[1;36m.0\u001b[0m, \n", - "\u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m512\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \n", - "\u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m330\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 4 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \n", - "\u001b[33mstart_mega\u001b[0m=\u001b[1;36m400\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m410\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m256\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \n", - "\u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m340\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC \u001b[0m\n", - "\u001b[32m2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 5 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m960\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001218\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m6656\u001b[0m, \n", + "\u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m320\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC \u001b[0m\n", + "\u001b[32m2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 3 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m320\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m340\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m512\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \n", + "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m330\u001b[0m,\n", + "\u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 4 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m400\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m410\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \n", + "\u001b[33mndata\u001b[0m=\u001b[1;36m256\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \n", + "\u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m340\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 5 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m960\u001b[0m\u001b[1;36m.0\u001b[0m, \n", + "\u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001218\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m6656\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \n", + "\u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m350\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\n", + "\u001b[32m(\u001b[0m\u001b[32mFaixa 6 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1001388\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001428\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1280\u001b[0m, \n", "\u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \n", - "\u001b[33mthread_id\u001b[0m=\u001b[1;36m350\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 6 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1001388\u001b[0m\u001b[1;36m.999\u001b[0m, \n", - "\u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001428\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m1280\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \n", - "\u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m360\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\n", - "\u001b[32m(\u001b[0m\u001b[32mFaixa 7 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1530\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001648\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m3072\u001b[0m, \n", + "\u001b[33mthread_id\u001b[0m=\u001b[1;36m360\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 7 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1530\u001b[0m\u001b[1;36m.0\u001b[0m, \n", + "\u001b[33mstop_mega\u001b[0m=\u001b[1;36m1001648\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m3072\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \n", + "\u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m370\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\n", + "\u001b[32m(\u001b[0m\u001b[32mFaixa 8 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m2690\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1002898\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m5376\u001b[0m, \n", "\u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \n", - "\u001b[33mthread_id\u001b[0m=\u001b[1;36m370\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 8 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m2690\u001b[0m\u001b[1;36m.0\u001b[0m, \n", - "\u001b[33mstop_mega\u001b[0m=\u001b[1;36m1002898\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m5376\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \n", - "\u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m380\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\n", - "\u001b[32m(\u001b[0m\u001b[32mFaixa 9 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m5000\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m5160\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m4096\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \n", - "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m390\u001b[0m,\n", - "\u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 10 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m1005338\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1005458\u001b[0m\u001b[1;36m.999\u001b[0m, \n", - "\u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m3328\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \n", - "\u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m\u001b[1m]\u001b[0m\n", + "\u001b[33mthread_id\u001b[0m=\u001b[1;36m380\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 9 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m5000\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m5160\u001b[0m\u001b[1;36m.0\u001b[0m,\n", + "\u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m4096\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \n", + "\u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m390\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'PMEC 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 10 de 10\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \n", + "\u001b[33mstart_mega\u001b[0m=\u001b[1;36m1005338\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m1005458\u001b[0m\u001b[1;36m.999\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \u001b[33mndata\u001b[0m=\u001b[1;36m3328\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \n", + "\u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m, \u001b[1;35mSpecData\u001b[0m\u001b[1m(\u001b[0m\u001b[33mtype\u001b[0m=\u001b[1;36m67\u001b[0m, \u001b[33mthread_id\u001b[0m=\u001b[1;36m250\u001b[0m,\n", + "\u001b[33mdescription\u001b[0m=\u001b[32m'PMEF 2021 \u001b[0m\u001b[32m(\u001b[0m\u001b[32mFaixa 6 de 6\u001b[0m\u001b[32m)\u001b[0m\u001b[32m.'\u001b[0m, \u001b[33mstart_mega\u001b[0m=\u001b[1;36m3290\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mstop_mega\u001b[0m=\u001b[1;36m3700\u001b[0m\u001b[1;36m.0\u001b[0m, \u001b[33mdtype\u001b[0m=\u001b[32m'dBm'\u001b[0m, \n", + "\u001b[33mndata\u001b[0m=\u001b[1;36m10496\u001b[0m, \u001b[33mbw\u001b[0m=\u001b[1;36m73828\u001b[0m, \u001b[33mprocessing\u001b[0m=\u001b[32m'peak'\u001b[0m, \u001b[33mantuid\u001b[0m=\u001b[1;36m0\u001b[0m, \u001b[33mthresh\u001b[0m=\u001b[1;36m-147.5\u001b[0m, \u001b[33mminimum\u001b[0m=\u001b[1;36m-147.5\u001b[0m\u001b[1m)\u001b[0m\u001b[1m]\u001b[0m\n", "\u001b[1m}\u001b[0m\n" ] }, @@ -391,11 +389,11 @@ { "data": { "text/html": [ - "GPS Data - Median of Coordinates: -14.81416:-39.03184 Altitude: 14.50 #Satellites: 12.0\n", + "GPS Data - Median of Coordinates: -23.32905:-51.13701 Altitude: 591.30 #Satellites: 11.0\n", "\n" ], "text/plain": [ - "GPS Data - Median of Coordinates: \u001b[1;36m-14.81416\u001b[0m:\u001b[1;36m-39.03184\u001b[0m Altitude: \u001b[1;36m14.50\u001b[0m #Satellites: \u001b[1;36m12.0\u001b[0m\n" + "GPS Data - Median of Coordinates: \u001b[1;36m-23.32905\u001b[0m:\u001b[1;36m-51.13701\u001b[0m Altitude: \u001b[1;36m591.30\u001b[0m #Satellites: \u001b[1;36m11.0\u001b[0m\n" ] }, "metadata": {}, @@ -448,11 +446,11 @@ { "data": { "text/html": [ - "{'altitude': 14.5, 'latitude': -14.814161, 'longitude': -39.031841, 'num_satellites': 12.0}\n", + "{'altitude': 807.8, 'latitude': -23.44242, 'longitude': -46.472522, 'num_satellites': 11.0}\n", "\n" ], "text/plain": [ - "\u001b[1m{\u001b[0m\u001b[32m'altitude'\u001b[0m: \u001b[1;36m14.5\u001b[0m, \u001b[32m'latitude'\u001b[0m: \u001b[1;36m-14.814161\u001b[0m, \u001b[32m'longitude'\u001b[0m: \u001b[1;36m-39.031841\u001b[0m, \u001b[32m'num_satellites'\u001b[0m: \u001b[1;36m12.0\u001b[0m\u001b[1m}\u001b[0m\n" + "\u001b[1m{\u001b[0m\u001b[32m'altitude'\u001b[0m: \u001b[1;36m807.8\u001b[0m, \u001b[32m'latitude'\u001b[0m: \u001b[1;36m-23.44242\u001b[0m, \u001b[32m'longitude'\u001b[0m: \u001b[1;36m-46.472522\u001b[0m, \u001b[32m'num_satellites'\u001b[0m: \u001b[1;36m11.0\u001b[0m\u001b[1m}\u001b[0m\n" ] }, "metadata": {}, @@ -486,7 +484,7 @@ { "data": { "text/plain": [ - "(#9060) [-14.814147,-14.814149,-14.814145,-14.814156,-14.814157,-14.814146,-14.814143,-14.814154,-14.814155,-14.814156...]" + "(#9058) [-23.329051,-23.329054,-23.329058,-23.329051,-23.329052,-23.329054,-23.32904,-23.329055,-23.329057,-23.32906...]" ] }, "execution_count": null, @@ -506,7 +504,7 @@ { "data": { "text/plain": [ - "(#9060) [-39.031852,-39.031857,-39.031859,-39.031857,-39.031851,-39.031846,-39.031839,-39.031822,-39.031811,-39.031814...]" + "(#9058) [-51.137013,-51.137008,-51.137002,-51.137009,-51.137008,-51.137005,-51.137015,-51.137019,-51.137025,-51.13702...]" ] }, "execution_count": null, @@ -526,7 +524,7 @@ { "data": { "text/plain": [ - "(#9060) [25.5,23.8,25.1,22.5,24.6,26.8,26.6,23.3,25.4,23.7...]" + "(#9058) [590.8,589.9,589.9,590.6,590.7,589.8,590.3,589.7,589.0,589.5...]" ] }, "execution_count": null, @@ -546,7 +544,7 @@ { "data": { "text/plain": [ - "(#9060) [12,12,12,12,12,12,12,12,12,12...]" + "(#9058) [11,11,11,11,11,11,11,11,11,11...]" ] }, "execution_count": null, @@ -738,23 +736,23 @@ { "data": { "text/html": [ - "[[-112.5 -117. -111. ... -106. -105. -99.5]\n", - " [-111.5 -115.5 -116.5 ... -103. -101.5 -101. ]\n", - " [-116.5 -113. -113.5 ... -105.5 -103.5 -105. ]\n", + "[[ -95. -87.5 -86. ... -91.5 -90.5 -91.5]\n", + " [ -85.5 -86. -87. ... -90.5 -92. -96. ]\n", + " [ -86. -90. -95.5 ... -100. -91. -91.5]\n", " ...\n", - " [-113. -111.5 -111.5 ... -99.5 -101.5 -98.5]\n", - " [-126. -124. -116. ... -97. -97.5 -98.5]\n", - " [-108.5 -110.5 -111.5 ... -98. -97.5 -103.5]]\n", + " [ -89.5 -90. -85.5 ... -96.5 -91. -91. ]\n", + " [ -91. -94. -92.5 ... -91. -96.5 -98.5]\n", + " [ -83. -83.5 -91. ... -99. -99.5 -95.5]]\n", "\n" ], "text/plain": [ - "\u001b[1m[\u001b[0m\u001b[1m[\u001b[0m\u001b[1;36m-112.5\u001b[0m \u001b[1;36m-117\u001b[0m. \u001b[1;36m-111\u001b[0m. \u001b[33m...\u001b[0m \u001b[1;36m-106\u001b[0m. \u001b[1;36m-105\u001b[0m. \u001b[1;36m-99.5\u001b[0m\u001b[1m]\u001b[0m\n", - " \u001b[1m[\u001b[0m\u001b[1;36m-111.5\u001b[0m \u001b[1;36m-115.5\u001b[0m \u001b[1;36m-116.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-103\u001b[0m. \u001b[1;36m-101.5\u001b[0m \u001b[1;36m-101\u001b[0m. \u001b[1m]\u001b[0m\n", - " \u001b[1m[\u001b[0m\u001b[1;36m-116.5\u001b[0m \u001b[1;36m-113\u001b[0m. \u001b[1;36m-113.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-105.5\u001b[0m \u001b[1;36m-103.5\u001b[0m \u001b[1;36m-105\u001b[0m. \u001b[1m]\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[1m[\u001b[0m \u001b[1;36m-95\u001b[0m. \u001b[1;36m-87.5\u001b[0m \u001b[1;36m-86\u001b[0m. \u001b[33m...\u001b[0m \u001b[1;36m-91.5\u001b[0m \u001b[1;36m-90.5\u001b[0m \u001b[1;36m-91.5\u001b[0m\u001b[1m]\u001b[0m\n", + " \u001b[1m[\u001b[0m \u001b[1;36m-85.5\u001b[0m \u001b[1;36m-86\u001b[0m. \u001b[1;36m-87\u001b[0m. \u001b[33m...\u001b[0m \u001b[1;36m-90.5\u001b[0m \u001b[1;36m-92\u001b[0m. \u001b[1;36m-96\u001b[0m. \u001b[1m]\u001b[0m\n", + " \u001b[1m[\u001b[0m \u001b[1;36m-86\u001b[0m. \u001b[1;36m-90\u001b[0m. \u001b[1;36m-95.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-100\u001b[0m. \u001b[1;36m-91\u001b[0m. \u001b[1;36m-91.5\u001b[0m\u001b[1m]\u001b[0m\n", " \u001b[33m...\u001b[0m\n", - " \u001b[1m[\u001b[0m\u001b[1;36m-113\u001b[0m. \u001b[1;36m-111.5\u001b[0m \u001b[1;36m-111.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-99.5\u001b[0m \u001b[1;36m-101.5\u001b[0m \u001b[1;36m-98.5\u001b[0m\u001b[1m]\u001b[0m\n", - " \u001b[1m[\u001b[0m\u001b[1;36m-126\u001b[0m. \u001b[1;36m-124\u001b[0m. \u001b[1;36m-116\u001b[0m. \u001b[33m...\u001b[0m \u001b[1;36m-97\u001b[0m. \u001b[1;36m-97.5\u001b[0m \u001b[1;36m-98.5\u001b[0m\u001b[1m]\u001b[0m\n", - " \u001b[1m[\u001b[0m\u001b[1;36m-108.5\u001b[0m \u001b[1;36m-110.5\u001b[0m \u001b[1;36m-111.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-98\u001b[0m. \u001b[1;36m-97.5\u001b[0m \u001b[1;36m-103.5\u001b[0m\u001b[1m]\u001b[0m\u001b[1m]\u001b[0m\n" + " \u001b[1m[\u001b[0m \u001b[1;36m-89.5\u001b[0m \u001b[1;36m-90\u001b[0m. \u001b[1;36m-85.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-96.5\u001b[0m \u001b[1;36m-91\u001b[0m. \u001b[1;36m-91\u001b[0m. \u001b[1m]\u001b[0m\n", + " \u001b[1m[\u001b[0m \u001b[1;36m-91\u001b[0m. \u001b[1;36m-94\u001b[0m. \u001b[1;36m-92.5\u001b[0m \u001b[33m...\u001b[0m \u001b[1;36m-91\u001b[0m. \u001b[1;36m-96.5\u001b[0m \u001b[1;36m-98.5\u001b[0m\u001b[1m]\u001b[0m\n", + " \u001b[1m[\u001b[0m \u001b[1;36m-83\u001b[0m. \u001b[1;36m-83.5\u001b[0m \u001b[1;36m-91\u001b[0m. \u001b[33m...\u001b[0m \u001b[1;36m-99\u001b[0m. \u001b[1;36m-99.5\u001b[0m \u001b[1;36m-95.5\u001b[0m\u001b[1m]\u001b[0m\u001b[1m]\u001b[0m\n" ] }, "metadata": {}, @@ -773,11 +771,11 @@ { "data": { "text/html": [ - "Formato da matriz com os níveis: (8715, 3584)\n", + "Formato da matriz com os níveis: (2576, 1024)\n", "\n" ], "text/plain": [ - "Formato da matriz com os níveis: \u001b[1m(\u001b[0m\u001b[1;36m8715\u001b[0m, \u001b[1;36m3584\u001b[0m\u001b[1m)\u001b[0m\n" + "Formato da matriz com os níveis: \u001b[1m(\u001b[0m\u001b[1;36m2576\u001b[0m, \u001b[1;36m1024\u001b[0m\u001b[1m)\u001b[0m\n" ] }, "metadata": {}, @@ -803,11 +801,11 @@ { "data": { "text/html": [ - "8715\n", + "9058\n", "
\n" ], "text/plain": [ - "\u001b[1;36m8715\u001b[0m\n" + "\u001b[1;36m9058\u001b[0m\n" ] }, "metadata": {}, @@ -873,44 +871,44 @@ " \n", " \n", "\n", - " \n", "2021-06-26 12:01:00.731405 \n", - "-112.5 \n", - "-117.0 \n", - "-111.0 \n", - "-111.5 \n", - "-117.0 \n", + "2021-06-18 21:03:00.762503 \n", + "-95.0 \n", + "-87.5 \n", + "-86.0 \n", + "-90.0 \n", + "-92.5 \n", "\n", - " \n", "2021-06-26 12:02:00.731287 \n", - "-111.5 \n", - "-115.5 \n", - "-116.5 \n", - "-112.5 \n", - "-107.0 \n", + "2021-06-18 21:04:01.432664 \n", + "-85.5 \n", + "-86.0 \n", + "-87.0 \n", + "-84.0 \n", + "-77.5 \n", "\n", - " \n", "2021-06-26 12:03:00.731107 \n", - "-116.5 \n", - "-113.0 \n", - "-113.5 \n", - "-109.5 \n", - "-107.5 \n", + "2021-06-18 21:05:01.182570 \n", + "-86.0 \n", + "-90.0 \n", + "-95.5 \n", + "-85.0 \n", + "-84.5 \n", "\n", - " \n", "2021-06-26 12:04:00.731401 \n", - "-111.5 \n", - "-112.0 \n", - "-110.0 \n", - "-110.5 \n", - "-109.0 \n", + "2021-06-18 21:06:00.812513 \n", + "-86.0 \n", + "-87.5 \n", + "-91.5 \n", + "-96.5 \n", + "-93.5 \n", "\n", - " \n", " \n", "\n", @@ -919,19 +917,19 @@ "text/plain": [ "Frequencies 105.000000 105.009768 105.019537 105.029305 \\\n", "Time \n", - "2021-06-26 12:01:00.731405 -112.5 -117.0 -111.0 -111.5 \n", - "2021-06-26 12:02:00.731287 -111.5 -115.5 -116.5 -112.5 \n", - "2021-06-26 12:03:00.731107 -116.5 -113.0 -113.5 -109.5 \n", - "2021-06-26 12:04:00.731401 -111.5 -112.0 -110.0 -110.5 \n", - "2021-06-26 12:05:00.731532 -113.0 -115.0 -117.5 -110.0 \n", + "2021-06-18 21:03:00.762503 -95.0 -87.5 -86.0 -90.0 \n", + "2021-06-18 21:04:01.432664 -85.5 -86.0 -87.0 -84.0 \n", + "2021-06-18 21:05:01.182570 -86.0 -90.0 -95.5 -85.0 \n", + "2021-06-18 21:06:00.812513 -86.0 -87.5 -91.5 -96.5 \n", + "2021-06-18 21:07:01.402635 -90.0 -83.0 -84.5 -88.5 \n", "\n", "Frequencies 105.039073 \n", "Time \n", - "2021-06-26 12:01:00.731405 -117.0 \n", - "2021-06-26 12:02:00.731287 -107.0 \n", - "2021-06-26 12:03:00.731107 -107.5 \n", - "2021-06-26 12:04:00.731401 -109.0 \n", - "2021-06-26 12:05:00.731532 -111.0 " + "2021-06-18 21:03:00.762503 -92.5 \n", + "2021-06-18 21:04:01.432664 -77.5 \n", + "2021-06-18 21:05:01.182570 -84.5 \n", + "2021-06-18 21:06:00.812513 -93.5 \n", + "2021-06-18 21:07:01.402635 -85.5 " ] }, "execution_count": null, @@ -2332,9 +2330,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [conda env:rfpye]", "language": "python", - "name": "python3" + "name": "conda-env-rfpye-py" } }, "nbformat": 4, diff --git a/rfpye/_nbdev.py b/rfpye/_nbdev.py index f88b8dd..1fdf25d 100644 --- a/rfpye/_nbdev.py +++ b/rfpye/_nbdev.py @@ -3,10 +3,10 @@ __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"config": "01_parser.ipynb", - "parse_bin": "01_parser.ipynb", "evaluate_checksum": "01_parser.ipynb", "byte2base_block": "01_parser.ipynb", "create_block": "01_parser.ipynb", + "parse_bin": "01_parser.ipynb", "CrfsGPS": "01_parser.ipynb", "CrfsSpectrum": "01_parser.ipynb", "check_block_exists": "01_parser.ipynb", diff --git a/rfpye/constants.py b/rfpye/constants.py index f20828c..8a67f45 100644 --- a/rfpye/constants.py +++ b/rfpye/constants.py @@ -171,6 +171,7 @@ 7: ( "type", "thread_id", + "thresh", "start_mega", "stop_mega", "namal", @@ -210,6 +211,7 @@ 61: ( "type", "thread_id", + "thresh", "start_mega", "stop_mega", "ndata", @@ -241,6 +243,7 @@ 64: ( "type", "thread_id", + "thresh", "description", "start_mega", "stop_mega", @@ -275,6 +278,7 @@ 68: ( "type", "thread_id", + "thresh", "description", "start_mega", "stop_mega", diff --git a/rfpye/parser.py b/rfpye/parser.py index c7e5db9..58d4cb6 100644 --- a/rfpye/parser.py +++ b/rfpye/parser.py @@ -1,6 +1,6 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01_parser.ipynb (unless otherwise specified). -__all__ = ['parse_bin', 'evaluate_checksum', 'byte2base_block', 'create_block', 'CrfsGPS', 'CrfsSpectrum', +__all__ = ['evaluate_checksum', 'byte2base_block', 'create_block', 'parse_bin', 'CrfsGPS', 'CrfsSpectrum', 'check_block_exists', 'append_spec_data', 'classify_blocks'] # Internal Cell @@ -38,32 +38,6 @@ } logger.configure(**config) -# Cell -def parse_bin(bin_file: Union[str, Path]) -> dict: - """Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes - A block is a piece of the .bin file with a known start and end and that contains different types of information. - It has several fields: file_type, header, data and footer. - Each field has lengths and information defined in the documentation. - Args: - bin_file (Union[str, Path]): path to the bin file - - Returns: - Dictionary with the file metadata, file_version, string info, gps and spectrum blocks. - """ - bin_file = Path(bin_file) - with open(bin_file, mode="rb") as bfile: - # The first block of the file is the header and is 36 bytes long. - header = bfile.read(BYTES_HEADER) - body = bfile.read() - meta = classify_blocks(body.split(ENDMARKER)) - parsed = { - "filename": bin_file.name, - "file_version": bin2int(header[:4]), - "string": bin2str(header[4:]), - } - parsed.update(meta) - return parsed - # Cell def evaluate_checksum(byte_block: bytes) -> int: """Receives a byte_block and verify if the calculated checksum is equal to the one registed in the specific byte""" @@ -104,19 +78,46 @@ def create_block(byte_block: bytes) -> Union[GetAttr, None]: """ base_block = byte2base_block(byte_block) if not base_block: - return None + return None, None block_type = base_block.type constructor = MAIN_BLOCKS.get(block_type) if not constructor: _ = logger.log( "INFO", f"This block type constructor is not implemented: {block_type}" ) - return None + return None, None block = constructor(base_block) if getattr(block, "gerror", -1) != -1 or getattr(block, "gps_status", -1) == 0: _ = logger.log("INFO", f"Block with error: {block_type}") - return None # spectral or gps blocks with error - return block + return None, None # spectral or gps blocks with error + return getattrs(block, KEY_ATTRS.get(block.type)), block + +# Cell +def parse_bin(bin_file: Union[str, Path]) -> dict: + """Receives a CRFS binfile and returns a dictionary with the file metadata, a GPS Class and a list with the different Spectrum Classes + A block is a piece of the .bin file with a known start and end and that contains different types of information. + It has several fields: file_type, header, data and footer. + Each field has lengths and information defined in the documentation. + Args: + bin_file (Union[str, Path]): path to the bin file + + Returns: + Dictionary with the file metadata, file_version, string info, gps and spectrum blocks. + """ + bin_file = Path(bin_file) + with open(bin_file, mode="rb") as bfile: + # The first block of the file is the header and is 36 bytes long. + header = bfile.read(BYTES_HEADER) + body = bfile.read() + blocks = parallel(create_block, body.split(ENDMARKER), threadpool=True) + meta = classify_blocks(blocks) + parsed = { + "filename": bin_file.name, + "file_version": bin2int(header[:4]), + "string": bin2str(header[4:]), + } + parsed.update(meta) + return parsed # Cell @dataclass @@ -185,37 +186,40 @@ def levels(self): gc.collect() return levels + @cached + def frequencies(self)->np.ndarray: + return np.linspace(self.start_mega, self.stop_mega, num=self.ndata) + def matrix(self): """Returns the matrix formed from the spectrum levels and timestamp""" - frequencies = np.linspace(self.start_mega, self.stop_mega, num=self.ndata) index = self._timestamp if len(self._timestamp) == len(self) else None - data = pd.DataFrame(self.levels, index=index, columns=frequencies) + data = pd.DataFrame(self.levels, index=index, columns=self.frequencies) data.columns.name = "Frequencies" data.index.name = "Time" return data # Cell -def check_block_exists(attrs, fluxos, block): +def check_block_exists(attrs, fluxos): """Receives a dict of attributes and check if its values exist as keys in fluxos, otherwise create one and set to CrfsSpectrum Class""" values = tuple(attrs.values()) if values not in fluxos: - attributes = list(attrs.keys()) - metavalues = list(values) - if hasattr(block, 'thresh'): - if 'thresh' not in attributes: - attributes.append('thresh') - metavalues.append(block.thresh) - if hasattr(block, 'minimum'): - if 'minimum' not in attributes: - attributes.append('minimum') - metavalues.append(block.minimum) - metadata = namedtuple("SpecData", attributes) - fluxos[values] = CrfsSpectrum(metadata(*metavalues)) + # attributes = list(attrs.keys()) + # metavalues = list(values) + # if hasattr(block, 'thresh'): + # if 'thresh' not in attributes: + # attributes.append('thresh') + # metavalues.append(block.thresh) + # if hasattr(block, 'minimum'): + # if 'minimum' not in attributes: + # attributes.append('minimum') + # metavalues.append(block.minimum) + metadata = namedtuple("SpecData", attrs.keys()) + fluxos[values] = CrfsSpectrum(metadata(*attrs.values())) return values, fluxos # Cell def append_spec_data(attrs, fluxos, block)->None: - values, fluxos = check_block_exists(attrs, fluxos, block) + values, fluxos = check_block_exists(attrs, fluxos) time = getattr(block, "wallclock_datetime", None) data = getattr(block, 'levels', None) if time is not None: @@ -228,16 +232,15 @@ def classify_blocks(byte_blocks: Iterable) -> dict: meta = {} fluxos = {} gps = CrfsGPS() - for byte_block in byte_blocks: - block = create_block(byte_block) + for attrs, block in byte_blocks: if not block: continue - if block.type == 40: + dtype = block.type + if dtype == 40: for k in BLOCK_ATTRS.get(40, []): getattr(gps, f"_{k}").append(getattr(block, k)) continue - attrs = getattrs(block, attrs=KEY_ATTRS.get(block.type)) - if block.type in VECTOR_BLOCKS: + if dtype in VECTOR_BLOCKS: append_spec_data(attrs, fluxos, block) else: meta.update(attrs)2021-06-26 12:05:00.731532 \n", - "-113.0 \n", - "-115.0 \n", - "-117.5 \n", - "-110.0 \n", - "-111.0 \n", + "2021-06-18 21:07:01.402635 \n", + "-90.0 \n", + "-83.0 \n", + "-84.5 \n", + "-88.5 \n", + "-85.5 \n", "