Skip to content

Commit 25385bb

Browse files
committed
add station_active flag
1 parent 043acd8 commit 25385bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pyxlma/lmalib/io/read.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def to_dataset(lma_file, event_id_start=0):
279279
'station_altitude':'Alt',
280280
'station_event_fraction':'sources',
281281
'station_power_ratio':'<P/P_m>',
282+
'station_active':'active',
282283
}
283284
event_mapping = {
284285
'event_latitude':'lat',
@@ -335,6 +336,11 @@ def to_dataset(lma_file, event_id_start=0):
335336
station_mask_bools[:, i] = lma_data[col]
336337
ds['event_contributing_stations'][:] = station_mask_bools
337338

339+
# -- Convert the station_active flag to a psuedo-boolean --
340+
station_active_data = np.zeros(N_stations, dtype='int8')
341+
station_active_data[ds.station_active.data == b'A'] = 1
342+
station_active_data[ds.station_active.data == b'NA'] = 0
343+
ds.station_active.data = station_active_data
338344
return ds
339345

340346

0 commit comments

Comments
 (0)