def derive(self, gl=M('Gear (L) Position'), gn=M('Gear (N) Position'), gr=M('Gear (R) Position'), gc=M('Gear (C) Position')): up_state = vstack_params_where_state( (gl, 'Up'), (gn, 'Up'), (gr, 'Up'), (gc, 'Up'), ).all(axis=0) down_state = vstack_params_where_state( (gl, 'Down'), (gn, 'Down'), (gr, 'Down'), (gc, 'Down'), ).all(axis=0) transit_state = vstack_params_where_state( (gl, 'In Transit'), (gn, 'In Transit'), (gr, 'In Transit'), (gc, 'In Transit'), ).any(axis=0) param = first_valid_parameter(gl, gn, gr, gc) self.array = np_ma_masked_zeros_like(param.array) self.array[repair_mask(up_state, repair_duration=None)] = 'Up' self.array[repair_mask(down_state, repair_duration=None)] = 'Down' self.array[repair_mask(transit_state, repair_duration=None)] = 'In Transit' self.array = nearest_neighbour_mask_repair(self.array)
def derive(self, gear_L=M('Gear (L) Up In Transit'), gear_N=M('Gear (N) Up In Transit'), gear_R=M('Gear (R) Up In Transit'), gear_C=M('Gear (C) Up In Transit')): combine_params = [(x, 'Retracting') for x in (gear_L, gear_R, gear_N, gear_C) if x] if len(combine_params): self.array = vstack_params_where_state(*combine_params).any(axis=0)
def derive(self, brk1=M('Rotor Brake (1) Engaged'), brk2=M('Rotor Brake (2) Engaged')): stacked = vstack_params_where_state( (brk1, 'Engaged'), (brk2, 'Engaged'), ) self.array = stacked.any(axis=0) self.array.mask = stacked.mask.any(axis=0)
def derive(self, eng_1_oei=M('Eng (1) One Engine Inoperative'), eng_2_oei=M('Eng (2) One Engine Inoperative'), autorotation=S('Autorotation')): oei = vstack_params_where_state((eng_1_oei, 'Active'), (eng_2_oei, 'Active')).any(axis=0) for section in autorotation: oei[section.slice] = False self.array = oei
def derive(self, brk1=M('Rotor Brake (1) Engaged'), brk2=M('Rotor Brake (2) Engaged')): stacked = vstack_params_where_state( (brk1, 'Engaged'), (brk2, 'Engaged'), ) self.array = stacked.any(axis=0) self.array.mask = stacked.mask.any(axis=0)
def derive(self, eng_1_oei=M('Eng (1) One Engine Inoperative'), eng_2_oei=M('Eng (2) One Engine Inoperative'), autorotation=S('Autorotation')): oei = vstack_params_where_state((eng_1_oei, 'Active'), (eng_2_oei, 'Active')).any(axis=0) for section in autorotation: oei[section.slice] = False self.array = oei
def derive(self, ase1=M('ASE (1) Engaged'), ase2=M('ASE (2) Engaged'), ase3=M('ASE (3) Engaged')): stacked = vstack_params_where_state( (ase1, 'Engaged'), (ase2, 'Engaged'), (ase3, 'Engaged'), ) self.array = stacked.sum(axis=0) self.offset = offset_select('mean', [ase1, ase2, ase3])
def derive(self, ase1=M('ASE (1) Engaged'), ase2=M('ASE (2) Engaged'), ase3=M('ASE (3) Engaged')): stacked = vstack_params_where_state( (ase1, 'Engaged'), (ase2, 'Engaged'), (ase3, 'Engaged'), ) self.array = stacked.sum(axis=0) self.offset = offset_select('mean', [ase1, ase2, ase3])
def derive(self, gl=M('Gear (L) In Transit'), gn=M('Gear (N) In Transit'), gr=M('Gear (R) In Transit'), gc=M('Gear (C) In Transit')): # Join all available gear parameters and use whichever are available. self.array = vstack_params_where_state( (gl, 'In Transit'), (gn, 'In Transit'), (gr, 'In Transit'), (gc, 'In Transit'), ).any(axis=0)
def derive(self, gl=M('Gear (L) Up'), gn=M('Gear (N) Up'), gr=M('Gear (R) Up'), gc=M('Gear (C) Up')): # Join all available gear parameters and use whichever are available. self.array = vstack_params_where_state( (gl, 'Up'), (gn, 'Up'), (gr, 'Up'), (gc, 'Up'), ).all(axis=0) # remove any spikes _slices = runs_of_ones(self.array == 'Down') _slices = slices_remove_small_gaps(_slices, 2, self.hz) for _slice in _slices: self.array[_slice] = 'Down'