Commit 6e60a93d authored by Alessio Berti's avatar Alessio Berti
Browse files

Use numpy array and concatenate to get rid of deprecation warnings.

parent f3b30a6f
Pipeline #115726 failed with stage
in 7 seconds
......@@ -953,13 +953,13 @@ class MarsRun:
event_data['charge'] = []
event_data['arrival_time'] = []
event_data['trigger_pattern'] = scipy.array([], dtype=np.int32)
event_data['stereo_event_number'] = scipy.array([], dtype=np.int32)
event_data['pointing_zd'] = scipy.array([])
event_data['pointing_az'] = scipy.array([])
event_data['pointing_ra'] = scipy.array([])
event_data['pointing_dec'] = scipy.array([])
event_data['MJD'] = scipy.array([])
event_data['trigger_pattern'] = np.array([], dtype=np.int32)
event_data['stereo_event_number'] = np.array([], dtype=np.int32)
event_data['pointing_zd'] = np.array([])
event_data['pointing_az'] = np.array([])
event_data['pointing_ra'] = np.array([])
event_data['pointing_dec'] = np.array([])
event_data['MJD'] = np.array([])
event_data['mars_meta'] = []
# monitoring information (updated from time to time)
......@@ -967,7 +967,7 @@ class MarsRun:
monitoring_data['badpixelinfo'] = []
monitoring_data['badpixelinfoMJDrange'] = []
monitoring_data['PedestalMJD'] = scipy.array([])
monitoring_data['PedestalMJD'] = np.array([])
monitoring_data['PedestalFundamental'] = dict()
monitoring_data['PedestalFundamental']['Mean'] = []
monitoring_data['PedestalFundamental']['Rms'] = []
......@@ -1116,7 +1116,7 @@ class MarsRun:
event_mjd = event_mjd + \
(event_millisec / 1e3 + event_nanosec / 1e9) / seconds_per_day
event_data['MJD'] = scipy.concatenate(
event_data['MJD'] = np.concatenate(
(event_data['MJD'], event_mjd))
# try to read RunHeaders tree (soft fail if not present, to pass current tests)
......@@ -1190,7 +1190,7 @@ class MarsRun:
pedestal_mjd = pedestal_mjd + \
(pedestal_millisec / 1e3 +
pedestal_nanosec / 1e9) / seconds_per_day
monitoring_data['PedestalMJD'] = scipy.concatenate(
monitoring_data['PedestalMJD'] = np.concatenate(
(monitoring_data['PedestalMJD'], pedestal_mjd))
for quantity in ['Mean', 'Rms']:
for i_pedestal in range(n_pedestals):
......@@ -1279,18 +1279,18 @@ class MarsRun:
event_data['charge'].append(charge)
event_data['arrival_time'].append(arrival_time)
event_data['mars_meta'].append(mars_meta)
event_data['trigger_pattern'] = scipy.concatenate(
event_data['trigger_pattern'] = np.concatenate(
(event_data['trigger_pattern'], trigger_pattern))
event_data['stereo_event_number'] = scipy.concatenate(
event_data['stereo_event_number'] = np.concatenate(
(event_data['stereo_event_number'], stereo_event_number))
if is_mc:
event_data['pointing_zd'] = scipy.concatenate(
event_data['pointing_zd'] = np.concatenate(
(event_data['pointing_zd'], pointing_zd))
event_data['pointing_az'] = scipy.concatenate(
event_data['pointing_az'] = np.concatenate(
(event_data['pointing_az'], pointing_az))
event_data['pointing_ra'] = scipy.concatenate(
event_data['pointing_ra'] = np.concatenate(
(event_data['pointing_ra'], pointing_ra))
event_data['pointing_dec'] = scipy.concatenate(
event_data['pointing_dec'] = np.concatenate(
(event_data['pointing_dec'], pointing_dec))
mc_info = input_file['Events'].arrays(mc_list, library="np")
......
Supports Markdown
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