File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments