To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 82f13655 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

adjust fetcher to be compatible with rocketlogger data files v4+

parent 4b22eb56
......@@ -374,10 +374,13 @@ def worker_powerprof(queueitem=None, nodeid=None, resultfile_path=None, resultfi
# CSV file format
rld_data = RocketLoggerData(inputfilename).merge_channels()
# get network time and convert to UNIX timestamp (UTC)
timeidx = rld_data.get_time(absolute_time=True, time_reference='network') # TODO adjust parameters for RL 1.99+
timeidx = rld_data.get_time(time_reference='network')
timeidxunix = timeidx.astype('uint64') / 1e9 # convert to s
current_ch = rld_data.get_data('I1') * 1000 # convert to mA
voltage_ch = rld_data.get_data('V2') - rld_data.get_data('V1') # voltage difference
if rld_data._header['file_version'] < 4:
voltage_ch = rld_data.get_data('V2') - rld_data.get_data('V1') # voltage difference for old file versions (channel order swapped)
else:
voltage_ch = rld_data.get_data('V1') - rld_data.get_data('V2') # voltage difference for new file versions (channel order correct)
rld_dataframe = pd.DataFrame(np.hstack((current_ch, voltage_ch)), index=timeidxunix, columns=['I', 'V'])
rld_dataframe.insert(0, 'observer_id', obsid)
rld_dataframe.insert(1, 'node_id', nodeid)
......
......@@ -334,7 +334,7 @@
<xs:simpleType name="obsIdType">
<xs:restriction base="xs:string">
<xs:pattern value="1|01|2|02|3|03|4|04|5|05|6|06|7|07|8|08|9|09|10|11|12|13|15|16|17|19|20|21|22|23|24|25|26|27|28|29|30|31|32|ALL"/>
<xs:pattern value="1|01|2|02|3|03|4|04|5|05|6|06|7|07|8|08|9|09|10|11|12|13|15|16|17|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|ALL"/>
</xs:restriction>
</xs:simpleType>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment