self.data.wake_time_count.append(float(match.group(55))) self.data.wake_power_count.append(int(match.group(56))) self.data.power_state.append(int(match.group(57))) self.data.power_board_mode.append(int(match.group(58))) self.data.power_voltage_select.append(int(match.group(59))) self.data.power_voltage_main.append(float(match.group(60))) self.data.power_current_main.append(float(match.group(61))) self.data.power_voltage_12.append(float(match.group(62))) self.data.power_current_12.append(float(match.group(63))) self.data.power_voltage_24.append(float(match.group(64))) self.data.power_current_24.append(float(match.group(65))) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for METBK superv = Parser(infile) # load the data into a buffered object and parse the data into a dictionary superv.load_ascii() superv.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, superv.data.toDict())
""" Extract the data from the relevant regex groups and assign to elements of the data dictionary. """ # Use the date_time_string to calculate an epoch timestamp (seconds since # 1970-01-01) epts = dcl_to_epoch(match.group(1)) self.data.time.append(epts) self.data.dcl_date_time_string.append(str(match.group(1))) # Assign the remaining MET data to the named parameters self.data.hydrogen_concentration.append(float(match.group(2))) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for hydrogen hydrogen = Parser(infile) # load the data into a buffered object and parse the data into a dictionary hydrogen.load_ascii() hydrogen.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, hydrogen.data.toDict())
self.data.internal_current.append(float(match.group(47))) self.data.internal_temperature.append(float(match.group(48))) self.data.fuel_cell_volume.append(float(match.group(49))) self.data.seawater_ground_state.append(int(match.group(50))) self.data.seawater_ground_positve.append(float(match.group(51))) self.data.seawater_ground_negative.append(float(match.group(52))) self.data.cvt_state.append(int(match.group(53))) self.data.cvt_voltage.append(float(match.group(54))) self.data.cvt_current.append(float(match.group(55))) self.data.cvt_interlock.append(int(match.group(56))) self.data.cvt_temperature.append(float(match.group(57))) self.data.error_flag3.append(str(match.group(58))) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for PWRSYS pwrsys = Parser(infile) # load the data into a buffered object and parse the data into a dictionary pwrsys.load_ascii() pwrsys.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, pwrsys.data.toDict())
self.data.mean_spectral_period.append(float(match.group(7))) self.data.maximum_wave_height.append(float(match.group(8))) self.data.significant_wave_height.append(float(match.group(9))) self.data.significant_wave_period.append(float(match.group(10))) self.data.average_tenth_height.append(float(match.group(11))) self.data.average_tenth_period.append(float(match.group(12))) self.data.average_wave_period.append(float(match.group(13))) self.data.peak_period.append(float(match.group(14))) self.data.peak_period_read.append(float(match.group(15))) self.data.spectral_wave_height.append(float(match.group(16))) self.data.mean_wave_direction.append(float(match.group(17))) self.data.mean_directional_spread.append(float(match.group(18))) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for wavss wavss = Parser(infile) # load the data into a buffered object and parse the data into a dictionary wavss.load_ascii() wavss.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, wavss.data.toDict())
for row in range(1, N): (a, b, c, d) = unpack('<4B', chunk[offset + 2: offset + 6]) percent1.append(a) percent2.append(b) percent3.append(c) percent4.append(d) offset += 4 self.data.percent.good_3beam.append(percent1) self.data.percent.transforms_reject.append(percent2) self.data.percent.bad_beams.append(percent3) self.data.percent.good_4beam.append(percent4) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for PWRSYS adcp = Parser(infile) # load the data into a buffered object and parse the data into a dictionary adcp.load_ascii() adcp.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, adcp.data.toDict())
# Assign the remaining MET data to the named parameters self.data.barometric_pressure.append(float(match.group(2))) self.data.relative_humidity.append(float(match.group(3))) self.data.air_temperature.append(float(match.group(4))) self.data.longwave_irradiance.append(float(match.group(5))) self.data.precipitation_level.append(float(match.group(6))) self.data.sea_surface_temperature.append(float(match.group(7))) self.data.sea_surface_conductivity.append(float(match.group(8))) self.data.shortwave_irradiance.append(float(match.group(9))) self.data.eastward_wind_velocity.append(float(match.group(10))) self.data.northward_wind_velocity.append(float(match.group(11))) if __name__ == '__main__': # load the input arguments args = inputs() infile = os.path.abspath(args.infile) outfile = os.path.abspath(args.outfile) # initialize the Parser object for METBK metbk = Parser(infile) # load the data into a buffered object and parse the data into a dictionary metbk.load_ascii() metbk.parse_data() # write the resulting Bunch object via the toDict method to a matlab # formatted structured array. sio.savemat(outfile, metbk.data.toDict())