def write(self, psd_data_or_future, time_start, time_stop, samples):
try:<EOL><INDENT>f_array, pwr_array = psd_data_or_future.result()<EOL><DEDENT>except AttributeError:<EOL><INDENT>f_array, pwr_array = psd_data_or_future<EOL><DEDENT>try:<EOL><INDENT>step = f_array[<NUM_LIT:1>] - f_array[<NUM_LIT:0>]<EOL>self.formatter.write(<EOL>self.output,<EOL>time_start.timestamp(),<EOL>time_stop.timestamp(),<EOL>f_array[<NUM_LIT:0>],<EOL>f_array[-<NUM_LIT:1>] + step,<EOL>step,<EOL>samples,<EOL>pwr_array<EOL>)<EOL><DEDENT>except Exception as e:<EOL><INDENT>logging.exception('<STR_LIT>'.format(e))<EOL><DEDENT>
Write PSD of one frequency hop