def test_timestamps_as_data(): hdr = DataBroker[-1] events = DataBroker.fetch_events(hdr) dm = DataMuxer.from_events(events) data_name = list(dm.sources.keys()) for name in data_name: dm.include_timestamp_data(name) assert_true('{}_timestamp'.format(name) in dm._dataframe) dm.remove_timestamp_data(name) assert_false('{}_timestamp'.format(name) in dm._dataframe)
def test_attributes(): hdr = DataBroker[-1] events = DataBroker.fetch_events(hdr) dm = DataMuxer.from_events(events) # merely testing that basic usage does not error for data_key in dm.sources.keys(): getattr(dm, data_key) dm[data_key] properties = ['ncols', '_dataframe', 'col_info_by_ndim', 'sources', 'col_info', '_data', '_time', '_timestamps', '_timestamps_as_data', '_known_events', '_known_descriptors', '_stale'] for prop in properties: getattr(dm, prop)
def setUp(self): self.dm = DataMuxer.from_events(image_and_scalar.run())
def setUp(self): self.dm = DataMuxer.from_events(multisource_event.run()) self.sparse = 'Troom' self.dense = 'point_det' self.agg = np.mean self.interp = 'linear'
def setUp(self): self.dm = DataMuxer.from_events(temperature_ramp.run()) self.sparse = 'Tsam' self.dense = 'point_det' self.agg = np.mean self.interp = 'linear'
ns.sort() # For each sample plot the intra sample temperature curve for i in ns: print(i) save_folder = '../S{}'.format(i) # Get the folder where the data is folder = '/mnt/bulk-data/research_data/USC_beamtime/APS_March_2016/S' \ + str(i) + '/temp_exp' # Get the run header assocaited with that folder hdr = db(run_folder=folder)[0] # Mux the data so that we have the correct Temp->data relationship dm = DataMuxer() dm.append_events(get_events(hdr)) df = dm.to_sparse_dataframe() print(df.keys()) binned = dm.bin_on('img', interpolation={'T': 'linear'}) for plot_type in [ 'gr', 'chi' ]: if plot_type is 'gr': # Only to the G(r) key_list = [f for f in os.listdir(folder) if f.endswith('.gr') and not f.startswith('d')] # If we are working with G(r) files use these offset and read parameters offset = .1